]> Dogcows Code - chaz/openbox/blobdiff - openbox/client.c
dont need to swallow enter events on ungrab cuz we just ignore them all now
[chaz/openbox] / openbox / client.c
index ab37bb65349b2dd61a8e3e8314add5211b84a92a..209e5397c8f103523ad51bf9798acf2fadeb33e7 100644 (file)
@@ -183,9 +183,6 @@ void client_manage_all()
        }
     }
     XFree(children);
-
-    if (config_focus_new)
-        focus_fallback(OB_FOCUS_FALLBACK_NOFOCUS);
 }
 
 void client_manage(Window window)
@@ -1960,7 +1957,7 @@ void client_configure_full(ObClient *self, ObCorner anchor,
                                     (resized && config_redraw_resize))));
 
     /* if the client is enlarging, the resize the client before the frame */
-    if (!user || (send_resize_client && (w > oldw || h > oldh)))
+    if (send_resize_client && user && (w > oldw || h > oldh))
         XResizeWindow(ob_display, self->window, MAX(w, oldw), MAX(h, oldh));
 
     /* move/resize the frame to match the request */
@@ -1995,7 +1992,7 @@ void client_configure_full(ObClient *self, ObCorner anchor,
     }
 
     /* if the client is shrinking, then resize the frame before the client */
-    if (user && (send_resize_client && (w <= oldw || h <= oldh)))
+    if (send_resize_client && (!user || (w <= oldw || h <= oldh)))
         XResizeWindow(ob_display, self->window, w, h);
 
     XFlush(ob_display);
@@ -2594,11 +2591,12 @@ gboolean client_focus(ObClient *self)
 
 void client_unfocus(ObClient *self)
 {
-    g_assert(focus_client == self);
+    if (focus_client == self) {
 #ifdef DEBUG_FOCUS
-    ob_debug("client_unfocus for %lx\n", self->window);
+        ob_debug("client_unfocus for %lx\n", self->window);
 #endif
-    focus_fallback(OB_FOCUS_FALLBACK_UNFOCUSING);
+        focus_fallback(OB_FOCUS_FALLBACK_UNFOCUSING);
+    }
 }
 
 void client_activate(ObClient *self, gboolean here)
@@ -3016,3 +3014,24 @@ int client_directional_edge_search(ObClient *c, ObDirection dir)
     }
     return dest;
 }
+
+ObClient* client_under_pointer()
+{
+    int x, y;
+    GList *it;
+    ObClient *ret = NULL;
+
+    if (screen_pointer_pos(&x, &y)) {
+        for (it = stacking_list; it != NULL; it = it->next) {
+            if (WINDOW_IS_CLIENT(it->data)) {
+                ObClient *c = WINDOW_AS_CLIENT(it->data);
+                if (c->desktop == screen_desktop &&
+                    RECT_CONTAINS(c->frame->area, x, y)) {
+                    ret = c;
+                    break;
+                }
+            }
+        }
+    }
+    return ret;
+}
This page took 0.021849 seconds and 4 git commands to generate.