summaryrefslogtreecommitdiff
path: root/plugins/placement
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-04-06 19:17:54 +0000
committerDana Jansens <danakj@orodu.net>2003-04-06 19:17:54 +0000
commita484ba5e1953c62a4696010bfd34b91770915d28 (patch)
tree52acf96e6de668862cf3519ea8226dc35a704e82 /plugins/placement
parentb15007ca362cfb09b848bee2617f48c3131e829b (diff)
dont let windows be placed offscreen
Diffstat (limited to 'plugins/placement')
-rw-r--r--plugins/placement/history.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/plugins/placement/history.c b/plugins/placement/history.c
index dfdcea28..58434780 100644
--- a/plugins/placement/history.c
+++ b/plugins/placement/history.c
@@ -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,