Merge branch 'backport' into work Conflicts: obt/keyboard.c openbox/actions/cyclewindows.c openbox/actions/directionalwindows.c openbox/frame.c openbox/openbox.c
jump to
@@ -58,7 +58,6 @@ };
static GSList *registered = NULL; - void actions_startup(gboolean reconfig) { if (reconfig) return;
@@ -75,7 +75,7 @@
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"); } }
@@ -118,8 +118,6 @@ {
Options *o = options; guint d; - - switch (o->type) { case LAST: d = screen_last_desktop;
@@ -91,7 +91,7 @@
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"); } }
@@ -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,@@ -582,7 +581,6 @@ window, self->frame->window, self->class);
hooks_queue(OB_HOOK_WIN_NEW, self); } - ObClient *client_fake_manage(Window window) {@@ -1309,7 +1307,6 @@ /* * *
Group transient windows are not allowed to have other group transient windows as their children. * * */ - /* No change has occured */ if (oldgroup == newgroup &&@@ -2126,7 +2123,6 @@ hints->icon_mask : None),
(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 @@ return (client_mouse_focusable(self) &&
self->type != OB_CLIENT_TYPE_DESKTOP); } - static void client_apply_startup_state(ObClient *self, gint x, gint y, gint w, gint h) {@@ -2932,7 +2927,6 @@
g_assert(*w > 0); g_assert(*h > 0); } - void client_configure(ObClient *self, gint x, gint y, gint w, gint h, gboolean user, gboolean final, gboolean force_reply)
@@ -197,5 +197,4 @@ src. */
void config_app_settings_copy_non_defaults(const ObAppSettings *src, ObAppSettings *dest); - #endif
@@ -1125,7 +1125,6 @@ we need to a notify then */
move = TRUE; } - if (e->xconfigurerequest.value_mask & CWStackMode) { ObClient *sibling = NULL; gulong ignore_start;
@@ -95,7 +95,6 @@ goto done_cycle;
list = client_list; } - if (focus_cycle_target == NULL) { focus_cycle_iconic_windows = TRUE; focus_cycle_all_desktops = all_desktops;
@@ -1133,15 +1133,37 @@ }
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 @@ }
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 @@ ob_rr_theme->paddingy + 1);
} 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);
@@ -42,5 +42,4 @@ void tree_assimilate(KeyBindingTree *node);
KeyBindingTree *tree_find(KeyBindingTree *search, gboolean *conflict); gboolean tree_chroot(KeyBindingTree *tree, GList *keylist); - #endif
@@ -352,7 +352,6 @@ moveresize_client->frame->area.x,
moveresize_client->frame->area.y); } - static void do_resize(void) { gint x, y, w, h, lw, lh;
@@ -292,7 +292,6 @@ RrMinSize(prompt_a_pfocus, &bw, &bh);
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;
@@ -401,7 +401,6 @@ ob_debug_type(OB_DEBUG_SM, "Saving is done (success = %d)", success);
SmcSaveYourselfDone(conn, success); } - static void sm_save_yourself(SmcConn conn, SmPointer data, gint save_type, Bool shutdown, gint interact_style, Bool fast) {
@@ -659,7 +659,6 @@ data += w;
} } - static void gradient_diagonal(RrSurface *sf, gint w, gint h) { gint x, y;
@@ -333,7 +333,6 @@ g_free(a);
} } - static void pixel_data_to_pixmap(RrAppearance *l, gint x, gint y, gint w, gint h) {
@@ -90,7 +90,6 @@ }
exit (0); #endif - RrPaint(look, win, w, h); done = 0; while (!done) {
@@ -577,7 +577,6 @@ OB_DEFAULT_ICON_pixel_data);
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,@@ -1779,7 +1778,6 @@ *interlaced = TRUE;
else *interlaced = FALSE; } - static gboolean read_appearance(XrmDatabase db, const RrInstance *inst, const gchar *rname, RrAppearance *value,
@@ -66,7 +66,6 @@ XChangeProperty(display, twin, atime, XA_CARDINAL, 32,
PropModeReplace, (unsigned char*)&num, 1); XFlush(display); - while (1) { XNextEvent(display, &report); }