From: Mikael Magnusson Date: Sat, 8 Mar 2008 16:43:32 +0000 (+0100) Subject: Merge branch 'backport' into work X-Git-Url: https://git.dogcows.com/gitweb?a=commitdiff_plain;h=ec328fc04fe6e8d8c3d1ee386d4964963eb2ee17;hp=cfe36a0df2db3e5fd4c52e32093ea095492297cf;p=chaz%2Fopenbox Merge branch 'backport' into work Conflicts: obt/keyboard.c openbox/actions/cyclewindows.c openbox/actions/directionalwindows.c openbox/frame.c openbox/openbox.c --- diff --git a/openbox/actions.c b/openbox/actions.c index 8f72714e..1ec53287 100644 --- a/openbox/actions.c +++ b/openbox/actions.c @@ -58,7 +58,6 @@ struct _ObActionsAct { static GSList *registered = NULL; - void actions_startup(gboolean reconfig) { if (reconfig) return; diff --git a/openbox/actions/cyclewindows.c b/openbox/actions/cyclewindows.c index 44d87cf6..5354f087 100644 --- a/openbox/actions/cyclewindows.c +++ b/openbox/actions/cyclewindows.c @@ -75,7 +75,7 @@ static gpointer setup_func(xmlNodePtr node) m = obt_parse_find_node(n->children, "action"); while (m) { ObActionsAct *action = actions_parse(m); - if (action) o->actions = g_slist_prepend(o->actions, action); + if (action) o->actions = g_slist_append(o->actions, action); m = obt_parse_find_node(m->next, "action"); } } diff --git a/openbox/actions/desktop.c b/openbox/actions/desktop.c index d5535f6c..e1bd5520 100644 --- a/openbox/actions/desktop.c +++ b/openbox/actions/desktop.c @@ -118,8 +118,6 @@ static gboolean run_func(ObActionsData *data, gpointer options) Options *o = options; guint d; - - switch (o->type) { case LAST: d = screen_last_desktop; diff --git a/openbox/actions/directionalwindows.c b/openbox/actions/directionalwindows.c index c5c25c11..d3633d50 100644 --- a/openbox/actions/directionalwindows.c +++ b/openbox/actions/directionalwindows.c @@ -91,7 +91,7 @@ static gpointer setup_func(xmlNodePtr node) m = obt_parse_find_node(n->children, "action"); while (m) { ObActionsAct *action = actions_parse(m); - if (action) o->actions = g_slist_prepend(o->actions, action); + if (action) o->actions = g_slist_append(o->actions, action); m = obt_parse_find_node(m->next, "action"); } } diff --git a/openbox/client.c b/openbox/client.c index a055e632..0ccb343b 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -108,7 +108,6 @@ static void client_call_notifies(ObClient *self, GSList *list); static void client_ping_event(ObClient *self, gboolean dead); static void client_prompt_kill(ObClient *self); - void client_startup(gboolean reconfig) { if ((client_default_icon = RrImageCacheFind(ob_rr_icons, @@ -583,7 +582,6 @@ void client_manage(Window window, ObPrompt *prompt) hooks_queue(OB_HOOK_WIN_NEW, self); } - ObClient *client_fake_manage(Window window) { ObClient *self; @@ -1310,7 +1308,6 @@ static void client_update_transient_tree(ObClient *self, transient windows as their children. * * */ - /* No change has occured */ if (oldgroup == newgroup && oldgtran == newgtran && @@ -2126,7 +2123,6 @@ void client_update_icons(ObClient *self) (gint*)&w, (gint*)&h, &data); obt_display_ignore_errors(FALSE); - if (xicon) { if (w > 0 && h > 0) { /* is this icon in the cache yet? */ @@ -2623,7 +2619,6 @@ gboolean client_enter_focusable(ObClient *self) self->type != OB_CLIENT_TYPE_DESKTOP); } - static void client_apply_startup_state(ObClient *self, gint x, gint y, gint w, gint h) { @@ -2933,7 +2928,6 @@ void client_try_configure(ObClient *self, gint *x, gint *y, gint *w, gint *h, g_assert(*h > 0); } - void client_configure(ObClient *self, gint x, gint y, gint w, gint h, gboolean user, gboolean final, gboolean force_reply) { diff --git a/openbox/config.h b/openbox/config.h index 8a01ee1f..cc5fa89a 100644 --- a/openbox/config.h +++ b/openbox/config.h @@ -197,5 +197,4 @@ ObAppSettings* config_create_app_settings(void); void config_app_settings_copy_non_defaults(const ObAppSettings *src, ObAppSettings *dest); - #endif diff --git a/openbox/event.c b/openbox/event.c index a0ce223a..aca69cc3 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -1125,7 +1125,6 @@ static void event_handle_client(ObClient *client, XEvent *e) move = TRUE; } - if (e->xconfigurerequest.value_mask & CWStackMode) { ObClient *sibling = NULL; gulong ignore_start; diff --git a/openbox/focus.c b/openbox/focus.c index 23cf9101..baf88e81 100644 --- a/openbox/focus.c +++ b/openbox/focus.c @@ -364,4 +364,3 @@ gboolean focus_valid_target(ObClient *ft, return ok; } - diff --git a/openbox/focus_cycle.c b/openbox/focus_cycle.c index 4d793777..063de644 100644 --- a/openbox/focus_cycle.c +++ b/openbox/focus_cycle.c @@ -95,7 +95,6 @@ ObClient* focus_cycle(gboolean forward, gboolean all_desktops, list = client_list; } - if (focus_cycle_target == NULL) { focus_cycle_iconic_windows = TRUE; focus_cycle_all_desktops = all_desktops; diff --git a/openbox/frame.c b/openbox/frame.c index 25c47048..8a7b1aef 100644 --- a/openbox/frame.c +++ b/openbox/frame.c @@ -1133,15 +1133,37 @@ static gboolean is_button_present(ObFrame *self, const gchar *lc, gint dir) { return FALSE; } +static void place_button(ObFrame *self, const char *lc, gint bwidth, + gint left, gint i, + gint *x, gint *button_on, gint *button_x) +{ + if (!(*button_on = is_button_present(self, lc, i))) + return; + + self->label_width -= bwidth; + if (i > 0) + *button_x = *x; + *x += i * bwidth; + if (i < 0) { + if (self->label_x <= left || *x > self->label_x) { + *button_x = *x; + } else { + /* the button would have been drawn on top of another button */ + *button_on = FALSE; + self->label_width += bwidth; + } + } +} + static void layout_title(ObFrame *self) { gchar *lc; gint i; const gint bwidth = ob_rr_theme->button_size + ob_rr_theme->paddingx + 1; - /* position of the left most button */ + /* position of the leftmost button */ const gint left = ob_rr_theme->paddingx + 1; - /* position of the right most button */ + /* position of the rightmost button */ const gint right = self->width; /* turn them all off */ @@ -1180,53 +1202,23 @@ static void layout_title(ObFrame *self) break; /* break the for loop, do other side of label */ } else if (*lc == 'N') { if (firstcon) *firstcon = OB_FRAME_CONTEXT_ICON; - if ((self->icon_on = is_button_present(self, lc, i))) { - /* icon is bigger than buttons */ - self->label_width -= bwidth + 2; - if (i > 0) self->icon_x = x; - x += i * (bwidth + 2); - if (i < 0) self->icon_x = x; - } + /* icon is bigger than buttons */ + place_button(self, lc, bwidth + 2, left, i, &x, &self->icon_on, &self->icon_x); } else if (*lc == 'D') { if (firstcon) *firstcon = OB_FRAME_CONTEXT_ALLDESKTOPS; - if ((self->desk_on = is_button_present(self, lc, i))) { - self->label_width -= bwidth; - if (i > 0) self->desk_x = x; - x += i * bwidth; - if (i < 0) self->desk_x = x; - } + place_button(self, lc, bwidth, left, i, &x, &self->desk_on, &self->desk_x); } else if (*lc == 'S') { if (firstcon) *firstcon = OB_FRAME_CONTEXT_SHADE; - if ((self->shade_on = is_button_present(self, lc, i))) { - self->label_width -= bwidth; - if (i > 0) self->shade_x = x; - x += i * bwidth; - if (i < 0) self->shade_x = x; - } + place_button(self, lc, bwidth, left, i, &x, &self->shade_on, &self->shade_x); } else if (*lc == 'I') { if (firstcon) *firstcon = OB_FRAME_CONTEXT_ICONIFY; - if ((self->iconify_on = is_button_present(self, lc, i))) { - self->label_width -= bwidth; - if (i > 0) self->iconify_x = x; - x += i * bwidth; - if (i < 0) self->iconify_x = x; - } + place_button(self, lc, bwidth, left, i, &x, &self->iconify_on, &self->iconify_x); } else if (*lc == 'M') { if (firstcon) *firstcon = OB_FRAME_CONTEXT_MAXIMIZE; - if ((self->max_on = is_button_present(self, lc, i))) { - self->label_width -= bwidth; - if (i > 0) self->max_x = x; - x += i * bwidth; - if (i < 0) self->max_x = x; - } + place_button(self, lc, bwidth, left, i, &x, &self->max_on, &self->max_x); } else if (*lc == 'C') { if (firstcon) *firstcon = OB_FRAME_CONTEXT_CLOSE; - if ((self->close_on = is_button_present(self, lc, i))) { - self->label_width -= bwidth; - if (i > 0) self->close_x = x; - x += i * bwidth; - if (i < 0) self->close_x = x; - } + place_button(self, lc, bwidth, left, i, &x, &self->close_on, &self->close_x); } else continue; /* don't set firstcon */ firstcon = NULL; @@ -1276,8 +1268,7 @@ static void layout_title(ObFrame *self) } else XUnmapWindow(obt_display, self->close); - if (self->label_on) { - self->label_width = MAX(1, self->label_width); /* no lower than 1 */ + if (self->label_on && self->label_width > 0) { XMapWindow(obt_display, self->label); XMoveWindow(obt_display, self->label, self->label_x, ob_rr_theme->paddingy); diff --git a/openbox/keyboard.c b/openbox/keyboard.c index 5ac42363..a693a71c 100644 --- a/openbox/keyboard.c +++ b/openbox/keyboard.c @@ -324,4 +324,3 @@ void keyboard_shutdown(gboolean reconfig) popup_free(popup); popup = NULL; } - diff --git a/openbox/keytree.h b/openbox/keytree.h index 391cb154..66edc3c7 100644 --- a/openbox/keytree.h +++ b/openbox/keytree.h @@ -42,5 +42,4 @@ void tree_assimilate(KeyBindingTree *node); KeyBindingTree *tree_find(KeyBindingTree *search, gboolean *conflict); gboolean tree_chroot(KeyBindingTree *tree, GList *keylist); - #endif diff --git a/openbox/menu.c b/openbox/menu.c index 432aa2be..f7d50e39 100644 --- a/openbox/menu.c +++ b/openbox/menu.c @@ -58,7 +58,6 @@ static gunichar parse_shortcut(const gchar *label, gboolean allow_shortcut, gchar **strippedlabel, guint *position, gboolean *always_show); - static void client_dest(ObClient *client, gpointer data) { /* menus can be associated with a client, so close any that are since diff --git a/openbox/menuframe.c b/openbox/menuframe.c index 7b4c872b..1e767e96 100644 --- a/openbox/menuframe.c +++ b/openbox/menuframe.c @@ -701,7 +701,6 @@ void menu_frame_render(ObMenuFrame *self) XSetWindowBorder(obt_display, e->window, RrColorPixel(ob_rr_theme->menu_border_color)); - text_a = (e->entry->type == OB_MENU_ENTRY_TYPE_NORMAL && !e->entry->data.normal.enabled ? /* disabled */ @@ -1091,7 +1090,6 @@ void menu_frame_hide_all_client(ObClient *client) } } - ObMenuFrame* menu_frame_under(gint x, gint y) { ObMenuFrame *ret = NULL; diff --git a/openbox/moveresize.c b/openbox/moveresize.c index ddc518ad..f501996b 100644 --- a/openbox/moveresize.c +++ b/openbox/moveresize.c @@ -352,7 +352,6 @@ static void do_move(gboolean keyboard, gint keydist) moveresize_client->frame->area.y); } - static void do_resize(void) { gint x, y, w, h, lw, lh; diff --git a/openbox/prompt.c b/openbox/prompt.c index 31d805ae..52223f19 100644 --- a/openbox/prompt.c +++ b/openbox/prompt.c @@ -292,7 +292,6 @@ static void prompt_layout(ObPrompt *self) self->button[i].width = MAX(self->button[i].width, bw); self->button[i].height = MAX(self->button[i].height, bh); - self->button[i].width += BUTTON_HMARGIN * 2; self->button[i].height += BUTTON_VMARGIN * 2; diff --git a/openbox/session.c b/openbox/session.c index ea909897..e4ecb6c7 100644 --- a/openbox/session.c +++ b/openbox/session.c @@ -401,7 +401,6 @@ static void sm_save_yourself_2(SmcConn conn, SmPointer data) SmcSaveYourselfDone(conn, success); } - static void sm_save_yourself(SmcConn conn, SmPointer data, gint save_type, Bool shutdown, gint interact_style, Bool fast) { diff --git a/render/gradient.c b/render/gradient.c index fc75047f..2f9bfd27 100644 --- a/render/gradient.c +++ b/render/gradient.c @@ -659,7 +659,6 @@ static void gradient_vertical(RrSurface *sf, gint w, gint h) } } - static void gradient_diagonal(RrSurface *sf, gint w, gint h) { gint x, y; diff --git a/render/render.c b/render/render.c index fd442d26..7c00c146 100644 --- a/render/render.c +++ b/render/render.c @@ -333,7 +333,6 @@ void RrAppearanceFree(RrAppearance *a) } } - static void pixel_data_to_pixmap(RrAppearance *l, gint x, gint y, gint w, gint h) { diff --git a/render/test.c b/render/test.c index 36c962da..55ab621e 100644 --- a/render/test.c +++ b/render/test.c @@ -90,7 +90,6 @@ gint main() exit (0); #endif - RrPaint(look, win, w, h); done = 0; while (!done) { diff --git a/render/theme.c b/render/theme.c index ece4037c..47c8a9c9 100644 --- a/render/theme.c +++ b/render/theme.c @@ -577,7 +577,6 @@ RrTheme* RrThemeNew(const RrInstance *inst, const gchar *name, theme->def_win_icon_w = OB_DEFAULT_ICON_WIDTH; theme->def_win_icon_h = OB_DEFAULT_ICON_HEIGHT; - /* read the decoration textures */ if (!read_appearance(db, inst, "window.active.title.bg", theme->a_focused_title, @@ -1780,7 +1779,6 @@ static void parse_appearance(gchar *tex, RrSurfaceColorType *grad, *interlaced = FALSE; } - static gboolean read_appearance(XrmDatabase db, const RrInstance *inst, const gchar *rname, RrAppearance *value, gboolean allow_trans) diff --git a/tests/usertimewin.c b/tests/usertimewin.c index 7ef934f2..7a2aa973 100644 --- a/tests/usertimewin.c +++ b/tests/usertimewin.c @@ -66,7 +66,6 @@ int main () { PropModeReplace, (unsigned char*)&num, 1); XFlush(display); - while (1) { XNextEvent(display, &report); }