]> Dogcows Code - chaz/openbox/commitdiff
dont let windows be placed offscreen
authorDana Jansens <danakj@orodu.net>
Sun, 6 Apr 2003 19:17:54 +0000 (19:17 +0000)
committerDana Jansens <danakj@orodu.net>
Sun, 6 Apr 2003 19:17:54 +0000 (19:17 +0000)
plugins/placement/history.c

index dfdcea281b86987fc88b2532b247355669bde805..58434780b687c6b71862d5b09ef5f84184d7b40f 100644 (file)
@@ -2,6 +2,7 @@
 #include "kernel/dispatch.h"
 #include "kernel/frame.h"
 #include "kernel/client.h"
+#include "kernel/screen.h"
 #include <glib.h>
 #include <string.h>
 #ifdef HAVE_STDLIB_H
@@ -55,6 +56,13 @@ gboolean place_history(Client *c)
             x = hi->x;
             y = hi->y;
 
+            /* make sure the window is on the display */
+            if (x >= screen_physical_size.width ||
+                y >= screen_physical_size.height ||
+                x + c->frame->area.width < 1 ||
+                y + c->frame->area.height < 1)
+                return FALSE;
+
             frame_frame_gravity(c->frame, &x, &y); /* get where the client
                                                       should be */
             client_configure(c, Corner_TopLeft, x, y,
This page took 0.025445 seconds and 4 git commands to generate.