From de82c4a5dfd771b89b6f48b56fcb578d91bd6bed Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Tue, 8 May 2007 01:31:51 +0000 Subject: [PATCH] i dont like this "application window" concept. swap it with "helper" windows instead which are the inverse. helper windows are utility/menu/toolbar windows. --- openbox/client.c | 23 ++++++++++++----------- openbox/client.h | 17 +++++++++-------- openbox/event.c | 2 +- openbox/focus.c | 5 ++--- openbox/screen.c | 2 +- 5 files changed, 25 insertions(+), 24 deletions(-) diff --git a/openbox/client.c b/openbox/client.c index 87156eb6..b38a8e07 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -2387,10 +2387,11 @@ gboolean client_normal(ObClient *self) { 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 @@ void client_activate(ObClient *self, gboolean here, gboolean user) } } -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 @@ gboolean client_has_group_siblings(ObClient *self) 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 @@ gboolean client_has_application_group_siblings(ObClient *self) 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; diff --git a/openbox/client.h b/openbox/client.h index 3d30c6a4..ae60181c 100644 --- a/openbox/client.h +++ b/openbox/client.h @@ -334,10 +334,9 @@ gboolean client_should_show(ObClient *self); 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 @@ gboolean client_focus(ObClient *self); */ 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 diff --git a/openbox/event.c b/openbox/event.c index 9a1ebb2f..1c640f13 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -504,7 +504,7 @@ static void event_process(const XEvent *ec, gpointer data) 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; diff --git a/openbox/focus.c b/openbox/focus.c index 15c036dc..79016bd4 100644 --- a/openbox/focus.c +++ b/openbox/focus.c @@ -556,9 +556,8 @@ static gboolean valid_focus_target(ObClient *ft, /* 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 */ diff --git a/openbox/screen.c b/openbox/screen.c index ffbe7124..19e18a21 100644 --- a/openbox/screen.c +++ b/openbox/screen.c @@ -498,7 +498,7 @@ void screen_set_desktop(guint num, gboolean dofocus) 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); -- 2.44.0