diff options
author | grodriguez <guille.rodriguez@gmail.com> | 2014-01-31 10:20:36 +0100 |
---|---|---|
committer | grodriguez <guille.rodriguez@gmail.com> | 2014-01-31 10:20:36 +0100 |
commit | 0c55ec7edac2a4ffaba9eb617a5de2ca197b4bbe (patch) | |
tree | bc1390cc273b190a393bd7d26a12d1ca6aa19189 /src | |
parent | 051a91a1739e19981a7169afef7d85af4de8e62f (diff) | |
download | mirror-meh-0c55ec7edac2a4ffaba9eb617a5de2ca197b4bbe.tar.gz mirror-meh-0c55ec7edac2a4ffaba9eb617a5de2ca197b4bbe.tar.bz2 mirror-meh-0c55ec7edac2a4ffaba9eb617a5de2ca197b4bbe.zip |
Fix for use without window manager
Handle MapNotify event to make sure we have valid width and height in case we never get a ConfigureNotify event (for example when there's no window manager)
Diffstat (limited to 'src')
-rw-r--r-- | src/xlib.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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; |