all repos — openbox @ ec328fc04fe6e8d8c3d1ee386d4964963eb2ee17

openbox fork - make it a bit more like ryudo

Merge branch 'backport' into work

Conflicts:

	obt/keyboard.c
	openbox/actions/cyclewindows.c
	openbox/actions/directionalwindows.c
	openbox/frame.c
	openbox/openbox.c
Mikael Magnusson mikachu@comhem.se
commit

ec328fc04fe6e8d8c3d1ee386d4964963eb2ee17

parent

cfe36a0df2db3e5fd4c52e32093ea095492297cf

M openbox/actions.copenbox/actions.c

@@ -58,7 +58,6 @@ };

static GSList *registered = NULL; - void actions_startup(gboolean reconfig) { if (reconfig) return;
M openbox/actions/cyclewindows.copenbox/actions/cyclewindows.c

@@ -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"); } }
M openbox/actions/desktop.copenbox/actions/desktop.c

@@ -118,8 +118,6 @@ {

Options *o = options; guint d; - - switch (o->type) { case LAST: d = screen_last_desktop;
M openbox/actions/directionalwindows.copenbox/actions/directionalwindows.c

@@ -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"); } }
M openbox/client.copenbox/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,

@@ -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)
M openbox/config.hopenbox/config.h

@@ -197,5 +197,4 @@ src. */

void config_app_settings_copy_non_defaults(const ObAppSettings *src, ObAppSettings *dest); - #endif
M openbox/event.copenbox/event.c

@@ -1125,7 +1125,6 @@ we need to a notify then */

move = TRUE; } - if (e->xconfigurerequest.value_mask & CWStackMode) { ObClient *sibling = NULL; gulong ignore_start;
M openbox/focus.copenbox/focus.c

@@ -364,4 +364,3 @@ }

return ok; } -
M openbox/focus_cycle.copenbox/focus_cycle.c

@@ -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;
M openbox/frame.copenbox/frame.c

@@ -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);
M openbox/keyboard.copenbox/keyboard.c

@@ -324,4 +324,3 @@

popup_free(popup); popup = NULL; } -
M openbox/keytree.hopenbox/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
M openbox/menu.copenbox/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
M openbox/menuframe.copenbox/menuframe.c

@@ -701,7 +701,6 @@ XSetWindowBorderWidth(obt_display, e->window, e->border);

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 */

@@ -1090,7 +1089,6 @@ menu_frame_hide(f);

} } } - ObMenuFrame* menu_frame_under(gint x, gint y) {
M openbox/moveresize.copenbox/moveresize.c

@@ -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;
M openbox/prompt.copenbox/prompt.c

@@ -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;
M openbox/session.copenbox/session.c

@@ -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) {
M render/gradient.crender/gradient.c

@@ -659,7 +659,6 @@ data += w;

} } - static void gradient_diagonal(RrSurface *sf, gint w, gint h) { gint x, y;
M render/render.crender/render.c

@@ -333,7 +333,6 @@ g_free(a);

} } - static void pixel_data_to_pixmap(RrAppearance *l, gint x, gint y, gint w, gint h) {
M render/test.crender/test.c

@@ -90,7 +90,6 @@ }

exit (0); #endif - RrPaint(look, win, w, h); done = 0; while (!done) {
M render/theme.crender/theme.c

@@ -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,
M tests/usertimewin.ctests/usertimewin.c

@@ -66,7 +66,6 @@ XChangeProperty(display, twin, atime, XA_CARDINAL, 32,

PropModeReplace, (unsigned char*)&num, 1); XFlush(display); - while (1) { XNextEvent(display, &report); }