]> Dogcows Code - chaz/openbox/blobdiff - openbox/client.c
don't force clients on screen when restarting
[chaz/openbox] / openbox / client.c
index 973cbc7980c0bc26a5736a49728482a5aa89e42f..4cfece1dd2e8996bcc83632ab195e8b70ebfab46 100644 (file)
@@ -411,10 +411,11 @@ void client_manage(Window window)
                                 splash screens get "transient" set to TRUE by
                                 the place_client call
                              */
-                             transient ||
-                             (!(self->positioned & USPosition) &&
-                              client_normal(self) &&
-                              !self->session));
+                             ob_state() == OB_STATE_RUNNING &&
+                             (transient ||
+                              (!(self->positioned & USPosition) &&
+                               client_normal(self) &&
+                               !self->session)));
     }
 
     /* if the window isn't user-sized, then make it fit inside
@@ -426,10 +427,11 @@ void client_manage(Window window)
        splash screens get "transient" set to TRUE by
        the place_client call
     */
-    if (transient ||
-        (!(self->sized & USSize) &&
-         client_normal(self) &&
-         !self->session))
+    if (ob_state() == OB_STATE_RUNNING &&
+        (transient ||
+         (!(self->sized & USSize) &&
+          client_normal(self) &&
+          !self->session)))
     {
         /* make a copy to modify */
         Rect a = *screen_area_monitor(self->desktop, client_monitor(self));
@@ -629,6 +631,7 @@ void client_unmanage(ObClient *self)
 {
     guint j;
     GSList *it;
+    gulong ignore_start;
 
     ob_debug("Unmanaging window: 0x%x plate 0x%x (%s) (%s)\n",
              self->window, self->frame->window,
@@ -640,13 +643,16 @@ void client_unmanage(ObClient *self)
        don't generate more events */
     XSelectInput(ob_display, self->window, NoEventMask);
 
+    /* ignore enter events from the unmap so it doesnt mess with the focus */
+    if (!client_focused(self) || !config_focus_under_mouse)
+        ignore_start = event_start_ignore_all_enters();
+
     frame_hide(self->frame);
     /* flush to send the hide to the server quickly */
     XFlush(ob_display);
 
-    /* ignore enter events from the unmap so it doesnt mess with the
-       focus */
-    event_ignore_all_queued_enters();
+    if (!client_focused(self) || !config_focus_under_mouse)
+        event_end_ignore_all_enters(ignore_start);
 
     mouse_grab_for_client(self, FALSE);
 
@@ -1148,6 +1154,9 @@ static void client_get_desktop(ObClient *self)
 
                 for (it = self->group->members; it; it = g_slist_next(it)) {
                     ObClient *c = it->data;
+
+                    if (c->desktop == DESKTOP_ALL) continue;
+
                     if (c != self) {
                         if (first) {
                             all = c->desktop;
@@ -3515,10 +3524,6 @@ gboolean client_focus(ObClient *self)
     self = client_focus_target(self);
 
     if (!client_can_focus(self)) {
-        if (!self->frame->visible) {
-            /* update the focus lists */
-            focus_order_to_top(self);
-        }
         ob_debug_type(OB_DEBUG_FOCUS,
                       "Client %s can't be focused\n", self->title);
         return FALSE;
@@ -3876,12 +3881,12 @@ ObClient *client_search_transient(ObClient *self, ObClient *search)
 }
 
 #define WANT_EDGE(cur, c) \
-            if(cur == c)                                                      \
+            if (cur == c)                                                     \
                 continue;                                                     \
-            if(c->desktop != cur->desktop && cur->desktop != DESKTOP_ALL &&   \
-               c->desktop != DESKTOP_ALL)                                     \
+            if (c->desktop != cur->desktop && cur->desktop != DESKTOP_ALL &&  \
+                cur->desktop != screen_desktop)                               \
                 continue;                                                     \
-            if(cur->iconic)                                                   \
+            if (cur->iconic)                                                  \
                 continue;
 
 #define HIT_EDGE(my_edge_start, my_edge_end, his_edge_start, his_edge_end) \
This page took 0.023211 seconds and 4 git commands to generate.