From 71d607c3bea56534059fc115d13291f6cb7b4bf1 Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Sun, 22 Apr 2007 18:09:19 +0000 Subject: [PATCH] some temporary hackings, please don't look :) --- openbox/dock.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/openbox/dock.c b/openbox/dock.c index 70e11272..53f398ed 100644 --- a/openbox/dock.c +++ b/openbox/dock.c @@ -629,3 +629,51 @@ void dock_hide(gboolean hide) } } } + +int main(int argc, char *argv[]) +{ + XEvent e; + Window window; + XWMHints *wmhint; + XWindowAttributes attrib; + ObDockApp *dockapp = NULL; + + dock_startup(FALSE); + while (XNextEvent(ob_display, &e)) { + if (e->type == MapRequest + && (!XGetWindowAttributes(ob_display, window, &attrib) + || attrib.override_redirect) + && (wmhint = XGetWMHints(ob_display, window))) + { + if ((wmhint->flags & StateHint) + && wmhint->initial_state == WithdrawnState) + dock_add(window, wmhint); + XFree(wmhint); + } + + window = event_get_window(e); + if ((dockapp = g_hash_table_lookup(window_map, &window))) + switch (e->type) { + case MotionNotify: + dock_app_drag(dockapp, &e->xmotion); + break; + case UnmapNotify: + if (app->ignore_unmaps) { + app->ignore_unmaps--; + break; + } + dock_remove(dockapp, TRUE); + break; + case DestroyNotify: + dock_remove(dockapp, FALSE); + break; + case ReparentNotify: + dock_remove(dockapp, FALSE); + break; + case ConfigureNotify: + dock_app_configure(dockapp, e->xconfigure.width, e->xconfigure.height); + break; + } + + } +} -- 2.34.1