]> Dogcows Code - chaz/openbox/commitdiff
i dont like this "application window" concept. swap it with "helper" windows instead...
authorDana Jansens <danakj@orodu.net>
Tue, 8 May 2007 01:31:51 +0000 (01:31 +0000)
committerDana Jansens <danakj@orodu.net>
Tue, 8 May 2007 01:31:51 +0000 (01:31 +0000)
openbox/client.c
openbox/client.h
openbox/event.c
openbox/focus.c
openbox/screen.c

index 87156eb6d370c4b552e1860d230c33aa2208e149..b38a8e079645a3435b5fca34a6145e91a500b34f 100644 (file)
@@ -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;
index 3d30c6a4605385fc92325663d47a9b665f43e2b5..ae60181c8b3f6113e6a2a453bc2dfef9b394f774 100644 (file)
@@ -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
index 9a1ebb2f9add26369f0212c43d55eeffbe94e13d..1c640f130de5eba03e771ad9950af926bbbeb61d 100644 (file)
@@ -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;
index 15c036dca7f49bc00b75e42a93aca4f9b8572579..79016bd4ed8adc54a8c620c03cd031c11da52775 100644 (file)
@@ -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 */
index ffbe7124ddaa3d6c1d45891291af6ffedd11dae4..19e18a219c1855d349cb1d08686a53e4a6a755c5 100644 (file)
@@ -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);
This page took 0.032386 seconds and 4 git commands to generate.