]> Dogcows Code - chaz/openbox/blobdiff - openbox/slit.c
grab button events on the slit so they dont go through to root
[chaz/openbox] / openbox / slit.c
index 45d14be226a86b41a9c6a8ad74b749de8a9b1ac9..a5d8be3b6666188845ef4fc0d8658f112b3f6502 100644 (file)
@@ -6,7 +6,8 @@
 #include "render/theme.h"
 #include "render/render.h"
 
-#define SLIT_EVENT_MASK (EnterWindowMask | LeaveWindowMask)
+#define SLIT_EVENT_MASK (ButtonPressMask | ButtonReleaseMask | \
+                         EnterWindowMask | LeaveWindowMask)
 #define SLITAPP_EVENT_MASK (StructureNotifyMask)
 
 struct Slit {
@@ -86,10 +87,11 @@ void slit_shutdown()
     g_hash_table_destroy(slit_map);
 }
 
-void slit_add(Window win, XWMHints *wmhints, XWindowAttributes *attrib)
+void slit_add(Window win, XWMHints *wmhints)
 {
     Slit *s;
     SlitApp *app;
+    XWindowAttributes attrib;
 
     /* XXX pick a slit */
     s = &slit[0];
@@ -100,8 +102,12 @@ void slit_add(Window win, XWMHints *wmhints, XWindowAttributes *attrib)
     app->icon_win = (wmhints->flags & IconWindowHint) ?
         wmhints->icon_window : win;
     
-    app->w = attrib->width;
-    app->h = attrib->height;
+    if (XGetWindowAttributes(ob_display, app->icon_win, &attrib)) {
+        app->w = attrib.width;
+        app->h = attrib.height;
+    } else {
+        app->w = app->h = 64;
+    }
 
     s->slit_apps = g_list_append(s->slit_apps, app);
     slit_configure(s);
This page took 0.024492 seconds and 4 git commands to generate.