all repos — openbox @ de82c4a5dfd771b89b6f48b56fcb578d91bd6bed

openbox fork - make it a bit more like ryudo

i dont like this "application window" concept. swap it with "helper" windows instead which are the inverse. helper windows are utility/menu/toolbar windows.
Dana Jansens danakj@orodu.net
commit

de82c4a5dfd771b89b6f48b56fcb578d91bd6bed

parent

ebabf3943c926547739254fb67f8024166ea000f

5 files changed, 25 insertions(+), 24 deletions(-)

jump to
M openbox/client.copenbox/client.c

@@ -2387,10 +2387,11 @@ self->type == OB_CLIENT_TYPE_DOCK ||

self->type == OB_CLIENT_TYPE_SPLASH); } -gboolean client_application(ObClient *self) +gboolean client_helper(ObClient *self) { - return (self->type == OB_CLIENT_TYPE_NORMAL || - self->type == OB_CLIENT_TYPE_DIALOG); + return (self->type == OB_CLIENT_TYPE_UTILITY || + self->type == OB_CLIENT_TYPE_MENU || + self->type == OB_CLIENT_TYPE_TOOLBAR); } static void client_apply_startup_state(ObClient *self, gint x, gint y)

@@ -3433,24 +3434,24 @@ client_present(self, here, TRUE);

} } -static void client_bring_non_application_windows_recursive(ObClient *self, - guint desktop) +static void client_bring_helper_windows_recursive(ObClient *self, + guint desktop) { GSList *it; for (it = self->transients; it; it = g_slist_next(it)) - client_bring_non_application_windows_recursive(it->data, desktop); + client_bring_helper_windows_recursive(it->data, desktop); - if (client_normal(self) && !client_application(self) && + if (client_helper(self) && self->desktop != desktop && self->desktop != DESKTOP_ALL) { client_set_desktop(self, desktop, FALSE, TRUE); } } -void client_bring_non_application_windows(ObClient *self) +void client_bring_helper_windows(ObClient *self) { - client_bring_non_application_windows_recursive(self, self->desktop); + client_bring_helper_windows_recursive(self, self->desktop); } void client_raise(ObClient *self)

@@ -3887,7 +3888,7 @@ {

return self->group && self->group->members->next; } -gboolean client_has_application_group_siblings(ObClient *self) +gboolean client_has_non_helper_group_siblings(ObClient *self) { GSList *it;

@@ -3895,7 +3896,7 @@ if (!self->group) return FALSE;

for (it = self->group->members; it; it = g_slist_next(it)) { ObClient *c = it->data; - if (c != self && client_application(c)) + if (c != self && client_normal(c) && !client_helper(c)) return TRUE; } return FALSE;
M openbox/client.hopenbox/client.h

@@ -334,10 +334,9 @@ Some windows (desktops, docks, splash screens) have special rules applied

to them in a number of places regarding focus or user interaction. */ gboolean client_normal(ObClient *self); -/*! Returns if the window is one of an application's main windows (normal or - dialog type) rather than an accessory window (utilty, menu, etc) or a - non-normal window */ -gboolean client_application(ObClient *self); +/*! Returns if the window is one of an application's helper windows + (utilty, menu, etc) */ +gboolean client_helper(ObClient *self); /* Returns if the window is focused */ gboolean client_focused(ObClient *self);

@@ -525,9 +524,9 @@ otherwise, it means an application requested it on its own

*/ void client_activate(ObClient *self, gboolean here, gboolean user); -/*! Bring all of its non-application windows to its desktop. These are the - utility and stuff windows. */ -void client_bring_non_application_windows(ObClient *client); +/*! Bring all of its helper windows to its desktop. These are the utility and + stuff windows. */ +void client_bring_helper_windows(ObClient *client); /*! Calculates the stacking layer for the client window */ void client_calc_layer(ObClient *self);

@@ -666,6 +665,8 @@ ObClient* client_under_pointer();

gboolean client_has_group_siblings(ObClient *self); -gboolean client_has_application_group_siblings(ObClient *self); +/*! Returns if a client has an group siblings which are main application + windows (not helper or non-normal windows) */ +gboolean client_has_non_helper_group_siblings(ObClient *self); #endif
M openbox/event.copenbox/event.c

@@ -504,7 +504,7 @@ focus_left_screen = FALSE;

frame_adjust_focus(client->frame, TRUE); focus_set_client(client); client_calc_layer(client); - client_bring_non_application_windows(client); + client_bring_helper_windows(client); } } else if (e->type == FocusOut) { gboolean nomove = FALSE;
M openbox/focus.copenbox/focus.c

@@ -556,9 +556,8 @@ ft->type == OB_CLIENT_TYPE_UTILITY) &&

/* let alt-tab go to these windows when a window in its group already has focus ... */ ((focus_client && ft->group == focus_client->group) || - /* ... or if there are no application windows in its - group */ - !client_has_application_group_siblings(ft)))); + /* ... or if there are no main windows in its group */ + !client_has_non_helper_group_siblings(ft)))); /* it's not set to skip the taskbar (unless it is a type that would be expected to set this hint */
M openbox/screen.copenbox/screen.c

@@ -498,7 +498,7 @@ no guarantee the window will actually take focus.. */

if (c->can_focus) { /* do this here so that if you switch desktops to a window with helper windows then the helper windows won't flash */ - client_bring_non_application_windows(c); + client_bring_helper_windows(c); /* reduce flicker by hiliting now rather than waiting for the server FocusIn event */ frame_adjust_focus(c->frame, TRUE);