aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/xlib.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/xlib.c b/src/xlib.c
index e46e358..07b50d6 100644
--- a/src/xlib.c
+++ b/src/xlib.c
@@ -226,6 +226,16 @@ void handlekeypress(XEvent *event){
void handleevent(XEvent *event){
switch(event->type){
+ /* Might not get ConfigureNotify, for example if there's no window manager */
+ case MapNotify:
+ if (!width || !height)
+ {
+ XWindowAttributes attr;
+ XGetWindowAttributes(event->xmap.display, event->xmap.window, &attr);
+ width = attr.width;
+ height = attr.height;
+ }
+ break;
case ConfigureNotify:
if(width != event->xconfigure.width || height != event->xconfigure.height){
width = event->xconfigure.width;