]> Dogcows Code - chaz/openbox/blobdiff - openbox/client.c
Resizing removes maximization now, so don't only snap "grow to edge" to screen edges.
[chaz/openbox] / openbox / client.c
index 35b146eb93415f94f0e7b49d3425b6b202d3c141..6a169336cae0452b97e2cd556ffec4667190da57 100644 (file)
@@ -303,9 +303,10 @@ void client_manage(Window window, ObPrompt *prompt)
     ob_debug("Going to try activate new window? %s",
              try_activate ? "yes" : "no");
     if (try_activate)
-        do_activate = client_can_steal_focus(self, settings->focus,
-                                             !!launch_time,
-                                             event_time(), launch_time);
+        do_activate = client_can_steal_focus(
+            self, settings->focus == 1,
+            (!!launch_time || settings->focus == 1),
+            event_time(), launch_time);
     else
         do_activate = FALSE;
 
@@ -712,9 +713,11 @@ static gboolean client_can_steal_focus(ObClient *self,
     /* This is focus stealing prevention */
     ob_debug("Want to focus window 0x%x at time %u "
              "launched at %u (last user interaction time %u) "
-             "request from %s",
+             "request from %s, allow other desktop: %s",
              self->window, steal_time, launch_time,
-             event_last_user_time, (request_from_user ? "user" : "other"));
+             event_last_user_time,
+             (request_from_user ? "user" : "other"),
+             (allow_other_desktop ? "yes" : "no"));
 
     /*
       if no launch time is provided for an application, make one up.
@@ -826,7 +829,8 @@ static gboolean client_can_steal_focus(ObClient *self,
             }
             /* Don't move focus if the window is not visible on the current
                desktop and none of its relatives are focused */
-            else if (!screen_compare_desktops(self->desktop, screen_desktop) &&
+            else if (!allow_other_desktop &&
+                     !screen_compare_desktops(self->desktop, screen_desktop) &&
                      !relative_focused)
             {
                 steal = FALSE;
@@ -2870,6 +2874,13 @@ void client_try_configure(ObClient *self, gint *x, gint *y, gint *w, gint *h,
        the updated frame dimensions. */
     frame_adjust_area(self->frame, FALSE, TRUE, TRUE);
 
+    /* cap any X windows at the size of an unsigned short */
+    *w = MIN(*w,
+             G_MAXUSHORT - self->frame->size.left - self->frame->size.right);
+    *h = MIN(*h,
+             G_MAXUSHORT - self->frame->size.top - self->frame->size.bottom);
+
+
     /* gets the frame's position */
     frame_client_gravity(self->frame, x, y);
 
@@ -4314,32 +4325,26 @@ void client_find_edge_directional(ObClient *self, ObDirection dir,
     }
 
     /* search for edges of clients */
-    if (((dir == OB_DIRECTION_NORTH || dir == OB_DIRECTION_SOUTH) &&
-         !self->max_vert) ||
-        ((dir == OB_DIRECTION_EAST || dir == OB_DIRECTION_WEST) &&
-         !self->max_horz))
-    {
-        for (it = client_list; it; it = g_list_next(it)) {
-            ObClient *cur = it->data;
+    for (it = client_list; it; it = g_list_next(it)) {
+        ObClient *cur = it->data;
 
-            /* skip windows to not bump into */
-            if (cur == self)
-                continue;
-            if (cur->iconic)
-                continue;
-            if (self->desktop != cur->desktop && cur->desktop != DESKTOP_ALL &&
-                cur->desktop != screen_desktop)
-                continue;
+        /* skip windows to not bump into */
+        if (cur == self)
+            continue;
+        if (cur->iconic)
+            continue;
+        if (self->desktop != cur->desktop && cur->desktop != DESKTOP_ALL &&
+            cur->desktop != screen_desktop)
+            continue;
 
-            ob_debug("trying window %s", cur->title);
+        ob_debug("trying window %s", cur->title);
 
-            detect_edge(cur->frame->area, dir, my_head, my_size, my_edge_start,
-                        my_edge_size, dest, near_edge);
-        }
-        dock_get_area(&dock_area);
-        detect_edge(dock_area, dir, my_head, my_size, my_edge_start,
+        detect_edge(cur->frame->area, dir, my_head, my_size, my_edge_start,
                     my_edge_size, dest, near_edge);
     }
+    dock_get_area(&dock_area);
+    detect_edge(dock_area, dir, my_head, my_size, my_edge_start,
+                my_edge_size, dest, near_edge);
 
     g_slice_free(Rect, a);
 }
This page took 0.022624 seconds and 4 git commands to generate.