X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fslit.c;h=a5d8be3b6666188845ef4fc0d8658f112b3f6502;hb=3689fa4b7a80926ef526bd9bb2484f33fc80d6e5;hp=45d14be226a86b41a9c6a8ad74b749de8a9b1ac9;hpb=ed4f84ac33765eee594ad6771df38768afd842a4;p=chaz%2Fopenbox diff --git a/openbox/slit.c b/openbox/slit.c index 45d14be2..a5d8be3b 100644 --- a/openbox/slit.c +++ b/openbox/slit.c @@ -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);