Make the dock a context and add actions LowerDock and RaiseDock
[dana/openbox.git] / openbox / frame.c
index 1623a83..bd9527b 100644 (file)
@@ -1368,18 +1368,27 @@ ObFrameContext frame_context_from_string(const gchar *name)
         return OB_FRAME_CONTEXT_CLOSE;
     else if (!g_ascii_strcasecmp("MoveResize", name))
         return OB_FRAME_CONTEXT_MOVE_RESIZE;
+    else if (!g_ascii_strcasecmp("Dock", name))
+        return OB_FRAME_CONTEXT_DOCK;
+
     return OB_FRAME_CONTEXT_NONE;
 }
 
 ObFrameContext frame_context(ObClient *client, Window win, gint x, gint y)
 {
     ObFrame *self;
+    ObWindow *obwin;
 
     if (moveresize_in_progress)
         return OB_FRAME_CONTEXT_MOVE_RESIZE;
 
     if (win == obt_root(ob_screen))
-        return OB_FRAME_CONTEXT_ROOT ;
+        return OB_FRAME_CONTEXT_ROOT;
+    if ((obwin = window_find(win))) {
+        if (WINDOW_IS_DOCK(obwin)) {
+          return OB_FRAME_CONTEXT_DOCK;
+        }
+    }
     if (client == NULL) return OB_FRAME_CONTEXT_NONE;
     if (win == client->window) {
         /* conceptually, this is the desktop, as far as users are
@@ -1663,6 +1672,7 @@ static gboolean flash_timeout(gpointer data)
         self->focused = FALSE;
     }
 
+    XFlush(obt_display);
     return TRUE; /* go again */
 }
 
@@ -1760,11 +1770,11 @@ static gboolean frame_animate_iconify(gpointer p)
     }
 
     XMoveResizeWindow(obt_display, self->window, x, y, w, h);
-    XFlush(obt_display);
 
     if (time == 0)
         frame_end_iconify_animation(self);
 
+    XFlush(obt_display);
     return time > 0; /* repeat until we're out of time */
 }