]> Dogcows Code - chaz/openbox/blobdiff - openbox/event.c
add a function client_is_oldfullscreen() that determines if a window is an "oldschool...
[chaz/openbox] / openbox / event.c
index 14aa696bb119689bca9f110947b1c13fe857b682..c4af7b232753df61f332c3b09772af24454aafcd 100644 (file)
@@ -1247,6 +1247,43 @@ static void event_handle_client(ObClient *client, XEvent *e)
                notify is sent or not */
         }
 
+        /* check for broken apps (java swing) moving to 0,0 when there is a
+           strut there.
+
+           XXX remove this some day...that would be nice. but really unexpected
+           from Sun Microsystems.
+        */
+        g_print("x %d y %d grav %d %d\n", x, y, client->gravity, NorthWestGravity);
+        if (x == 0 && y == 0 && client->gravity == NorthWestGravity) {
+            const Rect to = { x, y, w, h };
+
+            /* oldschool fullscreen windows are allowed */
+            if (!client_is_oldfullscreen(client, &to)) {
+                Rect *r;
+
+                r = screen_area(client->desktop, SCREEN_AREA_ALL_MONITORS,
+                                NULL);
+                if (r->x || r->y) {
+                    /* move the window only to the corner outside struts */
+                    x = r->x;
+                    y = r->y;
+
+                    ob_debug_type(OB_DEBUG_APP_BUGS,
+                                  "Application %s is trying to move via "
+                                  "ConfigureRequest to 0,0 using "
+                                  "NorthWestGravity, while there is a "
+                                  "strut there. "
+                                  "Moving buggy app from (0,0) to (%d,%d)",
+                                  client->title, r->x, r->y);
+                }
+
+                g_slice_free(Rect, r);
+
+                /* they still requested a move, so don't change whether a
+                   notify is sent or not */
+            }
+        }
+
         {
             gint lw, lh;
 
This page took 0.02384 seconds and 4 git commands to generate.