X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fwindow.c;h=51806f9c325f346c2dbbf40730b50245054bdc77;hb=HEAD;hp=c8cb348c7cdc36950b46bed21c9675bb7907ad1b;hpb=bb97a20777e74d681e5f1912f5b243f19253600b;p=chaz%2Fopenbox diff --git a/openbox/window.c b/openbox/window.c index c8cb348c..51806f9c 100644 --- a/openbox/window.c +++ b/openbox/window.c @@ -26,6 +26,8 @@ #include "prompt.h" #include "debug.h" #include "grab.h" +#include "obt/prop.h" +#include "obt/xqueue.h" static GHashTable *window_map; @@ -146,16 +148,15 @@ void window_manage_all(void) if (children) XFree(children); } -static Bool check_unmap(Display *d, XEvent *e, XPointer arg) +static gboolean check_unmap(XEvent *e, gpointer data) { - const Window win = *(Window*)arg; + const Window win = *(Window*)data; return ((e->type == DestroyNotify && e->xdestroywindow.window == win) || (e->type == UnmapNotify && e->xunmap.window == win)); } void window_manage(Window win) { - XEvent e; XWindowAttributes attrib; gboolean no_manage = FALSE; gboolean is_dockapp = FALSE; @@ -165,12 +166,11 @@ void window_manage(Window win) /* check if it has already been unmapped by the time we started mapping. the grab does a sync so we don't have to here */ - if (XCheckIfEvent(obt_display, &e, check_unmap, (XPointer)&win)) { + if (xqueue_exists_local(check_unmap, &win)) { ob_debug("Trying to manage unmapped window. Aborting that."); no_manage = TRUE; } - - if (!XGetWindowAttributes(obt_display, win, &attrib)) + else if (!XGetWindowAttributes(obt_display, win, &attrib)) no_manage = TRUE; else { XWMHints *wmhints; @@ -187,6 +187,20 @@ void window_manage(Window win) } XFree(wmhints); } + /* This is a new method to declare that a window is a dockapp, being + implemented by Windowmaker, to alleviate pain in writing GTK+ + dock apps. + http://thread.gmane.org/gmane.comp.window-managers.openbox/4881 + */ + if (!is_dockapp) { + gchar **ss; + if (OBT_PROP_GETSS_TYPE(win, WM_CLASS, STRING_NO_CC, &ss)) + { + if (ss[0] && ss[1] && strcmp(ss[1], "DockApp") == 0) + is_dockapp = TRUE; + g_strfreev(ss); + } + } } if (!no_manage) {