Add asserts to default: in switch statements
Store pointed to variables locally so it knows they don't change
Remove some dead assignments
Mark ob_exit_with_error as noreturn
Use "%s", msg instead of just msg to printf style functions
Use the c_pfocus variable
19 files changed:
- if ((c = g_hash_table_lookup(i->callbacks, tag))) {
+ if (g_hash_table_lookup(i->callbacks, tag)) {
g_error("Tag '%s' already registered", tag);
return;
}
g_error("Tag '%s' already registered", tag);
return;
}
d = screen_find_desktop(screen_desktop,
o->u.rel.dir, o->u.rel.wrap, o->u.rel.linear);
break;
d = screen_find_desktop(screen_desktop,
o->u.rel.dir, o->u.rel.wrap, o->u.rel.linear);
break;
+ default:
+ g_assert_not_reached();
}
if (d < screen_num_desktops && d != screen_desktop) {
}
if (d < screen_num_desktops && d != screen_desktop) {
gint x, y, lw, lh, w, h;
c = data->client;
gint x, y, lw, lh, w, h;
c = data->client;
- x = data->client->area.x + o->x;
- y = data->client->area.y + o->y;
- w = data->client->area.width;
- h = data->client->area.height;
- client_try_configure(data->client, &x, &y, &w, &h, &lw, &lh, TRUE);
- client_find_onscreen(data->client, &x, &y, w, h, FALSE);
+ x = c->area.x + o->x;
+ y = c->area.y + o->y;
+ w = c->area.width;
+ h = c->area.height;
+ client_try_configure(c, &x, &y, &w, &h, &lw, &lh, TRUE);
+ client_find_onscreen(c, &x, &y, w, h, FALSE);
actions_client_move(data, TRUE);
actions_client_move(data, TRUE);
- client_configure(data->client, x, y, w, h, TRUE, TRUE, FALSE);
+ client_configure(c, x, y, w, h, TRUE, TRUE, FALSE);
actions_client_move(data, FALSE);
}
actions_client_move(data, FALSE);
}
static gboolean prompt_cb(ObPrompt *p, gint result, gpointer data)
{
static gboolean prompt_cb(ObPrompt *p, gint result, gpointer data)
{
if (result) {
#ifdef USE_SM
if (result) {
#ifdef USE_SM
session_request_logout(o->silent);
#else
/* TRANSLATORS: Don't translate the word "SessionLogout" as it's the
session_request_logout(o->silent);
#else
/* TRANSLATORS: Don't translate the word "SessionLogout" as it's the
for (it = self->parents; it; it = g_slist_next(it)) {
ObClient *c = it->data;
for (it = self->parents; it; it = g_slist_next(it)) {
ObClient *c = it->data;
- if ((c = client_search_focus_tree_full(it->data))) return c;
+ if ((c = client_search_focus_tree_full(c))) return c;
value = self->demands_attention;
else if (state == OBT_PROP_ATOM(OB_WM_STATE_UNDECORATED))
value = undecorated;
value = self->demands_attention;
else if (state == OBT_PROP_ATOM(OB_WM_STATE_UNDECORATED))
value = undecorated;
+ else
+ g_assert_not_reached();
action = value ? OBT_PROP_ATOM(NET_WM_STATE_REMOVE) :
OBT_PROP_ATOM(NET_WM_STATE_ADD);
}
action = value ? OBT_PROP_ATOM(NET_WM_STATE_REMOVE) :
OBT_PROP_ATOM(NET_WM_STATE_ADD);
}
gboolean x_pos_given;
while (app) {
gboolean x_pos_given;
while (app) {
- name_set = class_set = type_set = x_pos_given = FALSE;
class_set = obt_parse_attr_string(app, "class", &class);
name_set = obt_parse_attr_string(app, "name", &name);
class_set = obt_parse_attr_string(app, "class", &class);
name_set = obt_parse_attr_string(app, "name", &name);
+ g_debug("%s", message);
case NotifyGrab: modestr="NotifyGrab"; break;
case NotifyUngrab: modestr="NotifyUngrab"; break;
case NotifyWhileGrabbed: modestr="NotifyWhileGrabbed"; break;
case NotifyGrab: modestr="NotifyGrab"; break;
case NotifyUngrab: modestr="NotifyUngrab"; break;
case NotifyWhileGrabbed: modestr="NotifyWhileGrabbed"; break;
+ default: g_assert_not_reached();
}
switch (detail) {
case NotifyAncestor: detailstr="NotifyAncestor"; break;
}
switch (detail) {
case NotifyAncestor: detailstr="NotifyAncestor"; break;
case NotifyPointer: detailstr="NotifyPointer"; break;
case NotifyPointerRoot: detailstr="NotifyPointerRoot"; break;
case NotifyDetailNone: detailstr="NotifyDetailNone"; break;
case NotifyPointer: detailstr="NotifyPointer"; break;
case NotifyPointerRoot: detailstr="NotifyPointerRoot"; break;
case NotifyDetailNone: detailstr="NotifyDetailNone"; break;
+ default: g_assert_not_reached();
}
if (mode == NotifyGrab || mode == NotifyUngrab)
}
if (mode == NotifyGrab || mode == NotifyUngrab)
client->shaped_input = ((XShapeEvent*)e)->shaped;
kind = ShapeInput;
break;
client->shaped_input = ((XShapeEvent*)e)->shaped;
kind = ShapeInput;
break;
+ default:
+ g_assert_not_reached();
}
frame_adjust_shape_kind(client->frame, kind);
}
}
frame_adjust_shape_kind(client->frame, kind);
}
gint l, t, r, b;
gint x, y, w, h;
Rect *screen_area = NULL;
gint l, t, r, b;
gint x, y, w, h;
Rect *screen_area = NULL;
- gint rgbax, rgbay, rgbaw, rgbah;
gint i;
GList *it;
const ObFocusCyclePopupTarget *newtarget;
gint i;
GList *it;
const ObFocusCyclePopupTarget *newtarget;
+ ObFocusCyclePopupMode mode = p->mode;
gint icons_per_row;
gint icon_rows;
gint textw, texth;
gint icons_per_row;
gint icon_rows;
gint textw, texth;
gint up_arrow_y, down_arrow_y;
gboolean showing_arrows = FALSE;
gint up_arrow_y, down_arrow_y;
gboolean showing_arrows = FALSE;
- g_assert(p->mode == OB_FOCUS_CYCLE_POPUP_MODE_ICONS ||
- p->mode == OB_FOCUS_CYCLE_POPUP_MODE_LIST);
+ g_assert(mode == OB_FOCUS_CYCLE_POPUP_MODE_ICONS ||
+ mode == OB_FOCUS_CYCLE_POPUP_MODE_LIST);
screen_area = screen_physical_area_active();
screen_area = screen_physical_area_active();
/* get the width from the text and keep it within limits */
w = l + r + p->maxtextw;
/* get the width from the text and keep it within limits */
w = l + r + p->maxtextw;
- if (p->mode == OB_FOCUS_CYCLE_POPUP_MODE_LIST)
+ if (mode == OB_FOCUS_CYCLE_POPUP_MODE_LIST)
/* when in list mode, there are icons down the side */
w += list_mode_icon_column_w;
w = MIN(w, MAX(screen_area->width/3, POPUP_WIDTH)); /* max width */
/* when in list mode, there are icons down the side */
w += list_mode_icon_column_w;
w = MIN(w, MAX(screen_area->width/3, POPUP_WIDTH)); /* max width */
/* get the text height */
texth = RrMinHeight(p->a_hilite_text);
/* get the text height */
texth = RrMinHeight(p->a_hilite_text);
- if (p->mode == OB_FOCUS_CYCLE_POPUP_MODE_LIST)
+ if (mode == OB_FOCUS_CYCLE_POPUP_MODE_LIST)
texth = MAX(MAX(texth, RrMinHeight(p->a_text)), HILITE_SIZE);
else
texth += TEXT_BORDER * 2;
texth = MAX(MAX(texth, RrMinHeight(p->a_text)), HILITE_SIZE);
else
texth += TEXT_BORDER * 2;
- if (p->mode == OB_FOCUS_CYCLE_POPUP_MODE_ICONS) {
+ if (mode == OB_FOCUS_CYCLE_POPUP_MODE_ICONS) {
/* how many icons will fit in that row? make the width fit that */
w -= l + r;
icons_per_row = (w + HILITE_SIZE - 1) / HILITE_SIZE;
/* how many icons will fit in that row? make the width fit that */
w -= l + r;
icons_per_row = (w + HILITE_SIZE - 1) / HILITE_SIZE;
/* get the text width */
textw = w - l - r;
/* get the text width */
textw = w - l - r;
- if (p->mode == OB_FOCUS_CYCLE_POPUP_MODE_LIST)
+ if (mode == OB_FOCUS_CYCLE_POPUP_MODE_LIST)
/* leave space on the side for the icons */
textw -= list_mode_icon_column_w;
/* leave space on the side for the icons */
textw -= list_mode_icon_column_w;
/* find the height of the dialog */
h = t + b + (icon_rows * MAX(HILITE_SIZE, texth));
/* find the height of the dialog */
h = t + b + (icon_rows * MAX(HILITE_SIZE, texth));
- if (p->mode == OB_FOCUS_CYCLE_POPUP_MODE_ICONS)
+ if (mode == OB_FOCUS_CYCLE_POPUP_MODE_ICONS)
/* in icon mode the text sits below the icons, so make some space */
h += OUTSIDE_BORDER + texth;
/* in icon mode the text sits below the icons, so make some space */
h += OUTSIDE_BORDER + texth;
/* scroll the list if needed */
last_scroll = p->scroll;
/* scroll the list if needed */
last_scroll = p->scroll;
- if (p->mode == OB_FOCUS_CYCLE_POPUP_MODE_LIST) {
+ if (mode == OB_FOCUS_CYCLE_POPUP_MODE_LIST) {
const gint top = p->scroll + SCROLL_MARGIN;
const gint bottom = p->scroll + icon_rows - SCROLL_MARGIN;
const gint min_scroll = 0;
const gint top = p->scroll + SCROLL_MARGIN;
const gint bottom = p->scroll + icon_rows - SCROLL_MARGIN;
const gint min_scroll = 0;
}
/* show the scroll arrows when appropriate */
}
/* show the scroll arrows when appropriate */
- if (p->scroll && p->mode == OB_FOCUS_CYCLE_POPUP_MODE_LIST) {
+ if (p->scroll && mode == OB_FOCUS_CYCLE_POPUP_MODE_LIST) {
XMapWindow(obt_display, p->list_mode_up);
showing_arrows = TRUE;
} else
XUnmapWindow(obt_display, p->list_mode_up);
if (p->scroll < p->n_targets - icon_rows &&
XMapWindow(obt_display, p->list_mode_up);
showing_arrows = TRUE;
} else
XUnmapWindow(obt_display, p->list_mode_up);
if (p->scroll < p->n_targets - icon_rows &&
- p->mode == OB_FOCUS_CYCLE_POPUP_MODE_LIST)
+ mode == OB_FOCUS_CYCLE_POPUP_MODE_LIST)
{
XMapWindow(obt_display, p->list_mode_down);
showing_arrows = TRUE;
{
XMapWindow(obt_display, p->list_mode_down);
showing_arrows = TRUE;
+ ob_rr_theme->down_arrow_mask->height + OUTSIDE_BORDER;
/* center the icons if there is less than one row */
+ ob_rr_theme->down_arrow_mask->height + OUTSIDE_BORDER;
/* center the icons if there is less than one row */
- if (p->mode == OB_FOCUS_CYCLE_POPUP_MODE_ICONS && icon_rows == 1)
+ if (mode == OB_FOCUS_CYCLE_POPUP_MODE_ICONS && icon_rows == 1)
icons_center_x = (w - p->n_targets * HILITE_SIZE) / 2;
else
icons_center_x = 0;
icons_center_x = (w - p->n_targets * HILITE_SIZE) / 2;
else
icons_center_x = 0;
- if (p->mode == OB_FOCUS_CYCLE_POPUP_MODE_ICONS) {
+ if (mode == OB_FOCUS_CYCLE_POPUP_MODE_ICONS) {
/* get the position of the text */
icon_mode_textx = l;
icon_mode_texty = h - texth - b;
/* get the position of the text */
icon_mode_textx = l;
icon_mode_texty = h - texth - b;
y = screen_area->y + (screen_area->height -
(h + ob_rr_theme->obwidth * 2)) / 2;
y = screen_area->y + (screen_area->height -
(h + ob_rr_theme->obwidth * 2)) / 2;
- /* get the dimensions of the target hilite texture */
- rgbax = ml;
- rgbay = mt;
- rgbaw = w - ml - mr;
- rgbah = h - mt - mb;
-
if (!p->mapped) {
/* position the background but don't draw it */
XMoveResizeWindow(obt_display, p->bg, x, y, w, h);
if (!p->mapped) {
/* position the background but don't draw it */
XMoveResizeWindow(obt_display, p->bg, x, y, w, h);
- if (p->mode == OB_FOCUS_CYCLE_POPUP_MODE_ICONS) {
+ if (mode == OB_FOCUS_CYCLE_POPUP_MODE_ICONS) {
/* position the text */
XMoveResizeWindow(obt_display, p->icon_mode_text,
icon_mode_textx, icon_mode_texty, textw, texth);
/* position the text */
XMoveResizeWindow(obt_display, p->icon_mode_text,
icon_mode_textx, icon_mode_texty, textw, texth);
RrPaint(p->a_bg, p->bg, w, h);
/* draw the scroll arrows */
RrPaint(p->a_bg, p->bg, w, h);
/* draw the scroll arrows */
- if (!p->mapped && p->mode == OB_FOCUS_CYCLE_POPUP_MODE_LIST) {
+ if (!p->mapped && mode == OB_FOCUS_CYCLE_POPUP_MODE_LIST) {
p->a_arrow->texture[0].data.mask.mask =
ob_rr_theme->up_arrow_mask;
p->a_arrow->surface.parent = p->a_bg;
p->a_arrow->texture[0].data.mask.mask =
ob_rr_theme->up_arrow_mask;
p->a_arrow->surface.parent = p->a_bg;
iconx, icony, HILITE_SIZE, HILITE_SIZE);
/* position the text */
iconx, icony, HILITE_SIZE, HILITE_SIZE);
/* position the text */
- if (p->mode == OB_FOCUS_CYCLE_POPUP_MODE_LIST)
+ if (mode == OB_FOCUS_CYCLE_POPUP_MODE_LIST)
XMoveResizeWindow(obt_display, target->textwin,
list_mode_textx, list_mode_texty,
textw, texth);
XMoveResizeWindow(obt_display, target->textwin,
list_mode_textx, list_mode_texty,
textw, texth);
/* show/hide the right windows */
if (row >= 0 && row < icon_rows) {
XMapWindow(obt_display, target->iconwin);
/* show/hide the right windows */
if (row >= 0 && row < icon_rows) {
XMapWindow(obt_display, target->iconwin);
- if (p->mode == OB_FOCUS_CYCLE_POPUP_MODE_LIST)
+ if (mode == OB_FOCUS_CYCLE_POPUP_MODE_LIST)
XMapWindow(obt_display, target->textwin);
else
XUnmapWindow(obt_display, target->textwin);
} else {
XUnmapWindow(obt_display, target->textwin);
XMapWindow(obt_display, target->textwin);
else
XUnmapWindow(obt_display, target->textwin);
} else {
XUnmapWindow(obt_display, target->textwin);
- if (p->mode == OB_FOCUS_CYCLE_POPUP_MODE_LIST)
+ if (mode == OB_FOCUS_CYCLE_POPUP_MODE_LIST)
XUnmapWindow(obt_display, target->iconwin);
else
XMapWindow(obt_display, target->iconwin);
XUnmapWindow(obt_display, target->iconwin);
else
XMapWindow(obt_display, target->iconwin);
RrPaint(p->a_icon, target->iconwin, HILITE_SIZE, HILITE_SIZE);
/* draw the text */
RrPaint(p->a_icon, target->iconwin, HILITE_SIZE, HILITE_SIZE);
/* draw the text */
- if (p->mode == OB_FOCUS_CYCLE_POPUP_MODE_LIST ||
+ if (mode == OB_FOCUS_CYCLE_POPUP_MODE_LIST ||
target == newtarget)
{
text = (target == newtarget) ? p->a_hilite_text : p->a_text;
text->texture[0].data.text.string = target->text;
text->surface.parentx =
target == newtarget)
{
text = (target == newtarget) ? p->a_hilite_text : p->a_text;
text->texture[0].data.text.string = target->text;
text->surface.parentx =
- p->mode == OB_FOCUS_CYCLE_POPUP_MODE_ICONS ?
+ mode == OB_FOCUS_CYCLE_POPUP_MODE_ICONS ?
icon_mode_textx : list_mode_textx;
text->surface.parenty =
icon_mode_textx : list_mode_textx;
text->surface.parenty =
- p->mode == OB_FOCUS_CYCLE_POPUP_MODE_ICONS ?
+ mode == OB_FOCUS_CYCLE_POPUP_MODE_ICONS ?
icon_mode_texty : list_mode_texty;
RrPaint(text,
icon_mode_texty : list_mode_texty;
RrPaint(text,
- (p->mode == OB_FOCUS_CYCLE_POPUP_MODE_ICONS ?
+ (mode == OB_FOCUS_CYCLE_POPUP_MODE_ICONS ?
p->icon_mode_text : target->textwin),
textw, texth);
}
p->icon_mode_text : target->textwin),
textw, texth);
}
ob_rr_theme->a_menu_text_normal);
sub = self->entry->data.submenu.submenu;
text_a->texture[0].data.text.string = sub ? sub->title : "";
ob_rr_theme->a_menu_text_normal);
sub = self->entry->data.submenu.submenu;
text_a->texture[0].data.text.string = sub ? sub->title : "";
- if (sub->shortcut && (self->frame->menu->show_all_shortcuts ||
+ if (sub && sub->shortcut && (self->frame->menu->show_all_shortcuts ||
sub->shortcut_always_show ||
sub->shortcut_position > 0))
{
sub->shortcut_always_show ||
sub->shortcut_position > 0))
{
else
text_a = ob_rr_theme->a_menu_text_normal;
break;
else
text_a = ob_rr_theme->a_menu_text_normal;
break;
+ default:
+ g_assert_not_reached();
}
switch (self->entry->type) {
}
switch (self->entry->type) {
2*ob_rr_theme->menu_sep_paddingy);
}
break;
2*ob_rr_theme->menu_sep_paddingy);
}
break;
+ default:
+ g_assert_not_reached();
}
if (self->entry->type == OB_MENU_ENTRY_TYPE_NORMAL &&
}
if (self->entry->type == OB_MENU_ENTRY_TYPE_NORMAL &&
2*ob_rr_theme->menu_sep_paddingy - 2*PADDING;
}
break;
2*ob_rr_theme->menu_sep_paddingy - 2*PADDING;
}
break;
+ default:
+ g_assert_not_reached();
}
tw += 2*PADDING;
th += 2*PADDING;
}
tw += 2*PADDING;
th += 2*PADDING;
static void resize_with_keys(gint keycode, gint state)
{
gint dw = 0, dh = 0, pdx = 0, pdy = 0, opx, opy, px, py;
static void resize_with_keys(gint keycode, gint state)
{
gint dw = 0, dh = 0, pdx = 0, pdy = 0, opx, opy, px, py;
- gint dist = 0, resist = 0;
ObDirection dir;
/* pick the edge if it needs to move */
ObDirection dir;
/* pick the edge if it needs to move */
key_resize_edge = OB_DIRECTION_EAST;
return;
}
key_resize_edge = OB_DIRECTION_EAST;
return;
}
- }
- if (keycode == ob_keycode(OB_KEY_LEFT)) {
+ } else if (keycode == ob_keycode(OB_KEY_LEFT)) {
dir = OB_DIRECTION_WEST;
if (key_resize_edge != OB_DIRECTION_WEST &&
key_resize_edge != OB_DIRECTION_EAST)
dir = OB_DIRECTION_WEST;
if (key_resize_edge != OB_DIRECTION_WEST &&
key_resize_edge != OB_DIRECTION_EAST)
key_resize_edge = OB_DIRECTION_WEST;
return;
}
key_resize_edge = OB_DIRECTION_WEST;
return;
}
- }
- if (keycode == ob_keycode(OB_KEY_UP)) {
+ } else if (keycode == ob_keycode(OB_KEY_UP)) {
dir = OB_DIRECTION_NORTH;
if (key_resize_edge != OB_DIRECTION_NORTH &&
key_resize_edge != OB_DIRECTION_SOUTH)
dir = OB_DIRECTION_NORTH;
if (key_resize_edge != OB_DIRECTION_NORTH &&
key_resize_edge != OB_DIRECTION_SOUTH)
key_resize_edge = OB_DIRECTION_NORTH;
return;
}
key_resize_edge = OB_DIRECTION_NORTH;
return;
}
- }
- if (keycode == ob_keycode(OB_KEY_DOWN)) {
+ } else /* if (keycode == ob_keycode(OB_KEY_DOWN)) */ {
dir = OB_DIRECTION_SOUTH;
if (key_resize_edge != OB_DIRECTION_NORTH &&
key_resize_edge != OB_DIRECTION_SOUTH)
dir = OB_DIRECTION_SOUTH;
if (key_resize_edge != OB_DIRECTION_NORTH &&
key_resize_edge != OB_DIRECTION_SOUTH)
if (key_resize_edge == OB_DIRECTION_WEST) {
if (dir == OB_DIRECTION_WEST)
if (key_resize_edge == OB_DIRECTION_WEST) {
if (dir == OB_DIRECTION_WEST)
}
else if (key_resize_edge == OB_DIRECTION_EAST) {
if (dir == OB_DIRECTION_EAST)
}
else if (key_resize_edge == OB_DIRECTION_EAST) {
if (dir == OB_DIRECTION_EAST)
}
else if (key_resize_edge == OB_DIRECTION_NORTH) {
if (dir == OB_DIRECTION_NORTH)
}
else if (key_resize_edge == OB_DIRECTION_NORTH) {
if (dir == OB_DIRECTION_NORTH)
}
else /*if (key_resize_edge == OB_DIRECTION_SOUTH)*/ {
if (dir == OB_DIRECTION_SOUTH)
}
else /*if (key_resize_edge == OB_DIRECTION_SOUTH)*/ {
if (dir == OB_DIRECTION_SOUTH)
void ob_exit_with_error(const gchar *msg)
{
void ob_exit_with_error(const gchar *msg)
{
session_shutdown(TRUE);
exit(EXIT_FAILURE);
}
session_shutdown(TRUE);
exit(EXIT_FAILURE);
}
void ob_reconfigure(void);
void ob_reconfigure(void);
-void ob_exit_with_error(const gchar *msg);
+void ob_exit_with_error(const gchar *msg) G_GNUC_NORETURN;
Cursor ob_cursor(ObCursor cursor);
Cursor ob_cursor(ObCursor cursor);
gint textx, texty, textw, texth;
gint iconx, icony, iconw, iconh;
Rect *area, mon;
gint textx, texty, textw, texth;
gint iconx, icony, iconw, iconh;
Rect *area, mon;
+ gboolean hasicon = self->hasicon;
/* when there is no icon and the text is not parent relative, then
fill the whole dialog with the text appearance, don't use the bg at all
*/
/* when there is no icon and the text is not parent relative, then
fill the whole dialog with the text appearance, don't use the bg at all
*/
- if (self->hasicon || self->a_text->surface.grad == RR_SURFACE_PARENTREL)
+ if (hasicon || self->a_text->surface.grad == RR_SURFACE_PARENTREL)
RrMargins(self->a_bg, &l, &t, &r, &b);
else
l = t = r = b = 0;
RrMargins(self->a_bg, &l, &t, &r, &b);
else
l = t = r = b = 0;
iconx = textx = l + ob_rr_theme->paddingx;
emptyx = l + r + ob_rr_theme->paddingx * 2;
iconx = textx = l + ob_rr_theme->paddingx;
emptyx = l + r + ob_rr_theme->paddingx * 2;
iconw = texth * self->iconwm;
iconh = texth * self->iconhm;
textx += iconw + ob_rr_theme->paddingx;
iconw = texth * self->iconwm;
iconh = texth * self->iconhm;
textx += iconw + ob_rr_theme->paddingx;
/* when there is no icon, then fill the whole dialog with the text
appearance
*/
/* when there is no icon, then fill the whole dialog with the text
appearance
*/
{
textx = texty = 0;
texth += emptyy;
{
textx = texty = 0;
texth += emptyy;
/* when there is no icon and the text is not parent relative, then
fill the whole dialog with the text appearance, don't use the bg at all
*/
/* when there is no icon and the text is not parent relative, then
fill the whole dialog with the text appearance, don't use the bg at all
*/
- if (self->hasicon || self->a_text->surface.grad == RR_SURFACE_PARENTREL)
+ if (hasicon || self->a_text->surface.grad == RR_SURFACE_PARENTREL)
RrPaint(self->a_bg, self->bg, w, h);
if (textw) {
RrPaint(self->a_bg, self->bg, w, h);
if (textw) {
RrPaint(self->a_text, self->text, textw, texth);
}
RrPaint(self->a_text, self->text, textw, texth);
}
self->draw_icon(iconx, icony, iconw, iconh, self->draw_icon_data);
/* do the actual showing */
self->draw_icon(iconx, icony, iconw, iconh, self->draw_icon_data);
/* do the actual showing */
prompt_a_button->texture[0].data.text.color = c_button;
prompt_a_focus->texture[0].data.text.color = c_focus;
prompt_a_press->texture[0].data.text.color = c_press;
prompt_a_button->texture[0].data.text.color = c_button;
prompt_a_focus->texture[0].data.text.color = c_focus;
prompt_a_press->texture[0].data.text.color = c_press;
- prompt_a_pfocus->texture[0].data.text.color = c_press;
+ prompt_a_pfocus->texture[0].data.text.color = c_pfocus;
prompt_a_focus->texture[1].data.lineart.color = c_focus;
prompt_a_focus->texture[2].data.lineart.color = c_focus;
prompt_a_focus->texture[1].data.lineart.color = c_focus;
prompt_a_focus->texture[2].data.lineart.color = c_focus;
Rect *area, *parea;
gint al, at, ar, ab; /* screen boundaries */
gint pl, pt, pr, pb; /* physical screen boundaries */
Rect *area, *parea;
gint al, at, ar, ab; /* screen boundaries */
gint pl, pt, pr, pb; /* physical screen boundaries */
guint i;
Rect desired_area;
guint i;
Rect desired_area;
t = RECT_TOP(c->frame->area);
b = RECT_BOTTOM(c->frame->area);
t = RECT_TOP(c->frame->area);
b = RECT_BOTTOM(c->frame->area);
- incw = c->size_inc.width;
- inch = c->size_inc.height;
-
RECT_SET(desired_area, c->area.x, c->area.y, *w, *h);
for (i = 0; i < screen_num_monitors; ++i) {
RECT_SET(desired_area, c->area.x, c->area.y, *w, *h);
for (i = 0; i < screen_num_monitors; ++i) {
void screen_set_num_desktops(guint num)
{
void screen_set_num_desktops(guint num)
{
gulong *viewport;
GList *it, *stacking_copy;
gulong *viewport;
GList *it, *stacking_copy;
if (screen_num_desktops == num) return;
if (screen_num_desktops == num) return;
- old = screen_num_desktops;
screen_num_desktops = num;
OBT_PROP_SET32(obt_root(ob_screen), NET_NUMBER_OF_DESKTOPS, CARDINAL, num);
screen_num_desktops = num;
OBT_PROP_SET32(obt_root(ob_screen), NET_NUMBER_OF_DESKTOPS, CARDINAL, num);
- gint l, r, t, b, al, ar, at, ab;
guint i, d;
gboolean us = search != NULL; /* user provided search */
guint i, d;
gboolean us = search != NULL; /* user provided search */
/* only include monitors which the search area lines up with */
if (RECT_INTERSECTS_RECT(monitor_area[screen_num_monitors], *search)) {
/* only include monitors which the search area lines up with */
if (RECT_INTERSECTS_RECT(monitor_area[screen_num_monitors], *search)) {
- al = l = RECT_RIGHT(monitor_area[screen_num_monitors]);
- at = t = RECT_BOTTOM(monitor_area[screen_num_monitors]);
- ar = r = RECT_LEFT(monitor_area[screen_num_monitors]);
- ab = b = RECT_TOP(monitor_area[screen_num_monitors]);
+ l = RECT_RIGHT(monitor_area[screen_num_monitors]);
+ t = RECT_BOTTOM(monitor_area[screen_num_monitors]);
+ r = RECT_LEFT(monitor_area[screen_num_monitors]);
+ b = RECT_TOP(monitor_area[screen_num_monitors]);
for (i = 0; i < screen_num_monitors; ++i) {
/* add the monitor if applicable */
if (RANGES_INTERSECT(search->x, search->width,
monitor_area[i].x, monitor_area[i].width))
{
for (i = 0; i < screen_num_monitors; ++i) {
/* add the monitor if applicable */
if (RANGES_INTERSECT(search->x, search->width,
monitor_area[i].x, monitor_area[i].width))
{
- at = t = MIN(t, RECT_TOP(monitor_area[i]));
- ab = b = MAX(b, RECT_BOTTOM(monitor_area[i]));
+ t = MIN(t, RECT_TOP(monitor_area[i]));
+ b = MAX(b, RECT_BOTTOM(monitor_area[i]));
}
if (RANGES_INTERSECT(search->y, search->height,
monitor_area[i].y, monitor_area[i].height))
{
}
if (RANGES_INTERSECT(search->y, search->height,
monitor_area[i].y, monitor_area[i].height))
{
- al = l = MIN(l, RECT_LEFT(monitor_area[i]));
- ar = r = MAX(r, RECT_RIGHT(monitor_area[i]));
+ l = MIN(l, RECT_LEFT(monitor_area[i]));
+ r = MAX(r, RECT_RIGHT(monitor_area[i]));
- al = l = RECT_LEFT(monitor_area[screen_num_monitors]);
- at = t = RECT_TOP(monitor_area[screen_num_monitors]);
- ar = r = RECT_RIGHT(monitor_area[screen_num_monitors]);
- ab = b = RECT_BOTTOM(monitor_area[screen_num_monitors]);
+ l = RECT_LEFT(monitor_area[screen_num_monitors]);
+ t = RECT_TOP(monitor_area[screen_num_monitors]);
+ r = RECT_RIGHT(monitor_area[screen_num_monitors]);
+ b = RECT_BOTTOM(monitor_area[screen_num_monitors]);
}
for (d = 0; d < screen_num_desktops; ++d) {
}
for (d = 0; d < screen_num_desktops; ++d) {
#ifdef DEBUG
GList *next;
#ifdef DEBUG
GList *next;
/* pls only restack stuff in the same layer at a time */
for (it = wins; it; it = next) {
next = g_list_next(it);
/* pls only restack stuff in the same layer at a time */
for (it = wins; it; it = next) {
next = g_list_next(it);
void RrFontDraw(XftDraw *d, RrTextureText *t, RrRect *area)
{
void RrFontDraw(XftDraw *d, RrTextureText *t, RrRect *area)
{
XftColor c;
gint mw;
PangoRectangle rect;
XftColor c;
gint mw;
PangoRectangle rect;
w = area->width;
if (t->flow) w = MAX(w, t->maxwidth);
w -= 4;
w = area->width;
if (t->flow) w = MAX(w, t->maxwidth);
w -= 4;
+ /* h = area->height; */
if (t->flow)
ell = PANGO_ELLIPSIZE_NONE;
if (t->flow)
ell = PANGO_ELLIPSIZE_NONE;
case RR_ELLIPSIZE_END:
ell = PANGO_ELLIPSIZE_END;
break;
case RR_ELLIPSIZE_END:
ell = PANGO_ELLIPSIZE_END;
break;
+ default:
+ g_assert_not_reached();