all repos — openbox @ a484ba5e1953c62a4696010bfd34b91770915d28

openbox fork - make it a bit more like ryudo

dont let windows be placed offscreen
Dana Jansens danakj@orodu.net
commit

a484ba5e1953c62a4696010bfd34b91770915d28

parent

b15007ca362cfb09b848bee2617f48c3131e829b

1 files changed, 8 insertions(+), 0 deletions(-)

jump to
M plugins/placement/history.cplugins/placement/history.c

@@ -2,6 +2,7 @@ #include "kernel/openbox.h"

#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

@@ -54,6 +55,13 @@ hi->placed = TRUE;

if (ob_state != State_Starting) { 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 */