i dont like this "application window" concept. swap it with "helper" windows instead which are the inverse. helper windows are utility/menu/toolbar windows.
This commit is contained in:
parent
ebabf3943c
commit
de82c4a5df
5 changed files with 25 additions and 24 deletions
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue