]> Dogcows Code - chaz/openbox/blobdiff - openbox/dock.c
ANSI function declarations, ie () -> (void)
[chaz/openbox] / openbox / dock.c
index 8cb40fb6c7ca6614c65d95272bc284fada96fbd4..9d4b56c4706985807fa0554e2be5b2b9fc2e5f85 100644 (file)
@@ -30,6 +30,8 @@
 #define DOCK_EVENT_MASK (ButtonPressMask | ButtonReleaseMask | \
                          EnterWindowMask | LeaveWindowMask)
 #define DOCKAPP_EVENT_MASK (StructureNotifyMask)
+#define DOCK_NOPROPAGATEMASK (ButtonPressMask | ButtonReleaseMask | \
+                              ButtonMotionMask)
 
 static ObDock *dock;
 
@@ -83,11 +85,13 @@ void dock_startup(gboolean reconfig)
 
     attrib.event_mask = DOCK_EVENT_MASK;
     attrib.override_redirect = True;
+    attrib.do_not_propagate_mask = DOCK_NOPROPAGATEMASK;
     dock->frame = XCreateWindow(ob_display, RootWindow(ob_display, ob_screen),
                                 0, 0, 1, 1, 0,
                                 RrDepth(ob_rr_inst), InputOutput,
                                 RrVisual(ob_rr_inst),
-                                CWOverrideRedirect | CWEventMask,
+                                CWOverrideRedirect | CWEventMask |
+                                CWDontPropagate,
                                 &attrib);
     dock->a_frame = RrAppearanceCopy(ob_rr_theme->osd_hilite_bg);
     XSetWindowBorder(ob_display, dock->frame,
@@ -138,12 +142,12 @@ void dock_add(Window win, XWMHints *wmhints)
             if (data[1])
                 app->class = g_strdup(data[1]);
         }
-        g_strfreev(data);     
+        g_strfreev(data);
     }
 
     if (app->name == NULL) app->name = g_strdup("");
     if (app->class == NULL) app->class = g_strdup("");
-    
+
     if (XGetWindowAttributes(ob_display, app->icon_win, &attrib)) {
         app->w = attrib.width;
         app->h = attrib.height;
@@ -185,7 +189,7 @@ void dock_add(Window win, XWMHints *wmhints)
     ob_debug("Managed Dock App: 0x%lx (%s)\n", app->icon_win, app->class);
 }
 
-void dock_remove_all()
+void dock_remove_all(void)
 {
     while (dock->dock_apps)
         dock_remove(dock->dock_apps->data, TRUE);
@@ -215,7 +219,7 @@ void dock_remove(ObDockApp *app, gboolean reparent)
     g_free(app);
 }
 
-void dock_configure()
+void dock_configure(void)
 {
     GList *it;
     gint hspot, vspot;
@@ -405,7 +409,7 @@ void dock_configure()
                     break;
                 }
                 break;
-            }    
+            }
         }
     }
 
@@ -431,75 +435,75 @@ void dock_configure()
             switch (config_dock_orient) {
             case OB_ORIENTATION_HORZ:
                 STRUT_PARTIAL_SET(dock_strut, 0, strh, 0, 0,
-                                  0, 0, dock->area.x, dock->area.x + dock->area.width - 1,
-                                  0, 0, 0, 0);
+                                  0, 0, dock->area.x, dock->area.x
+                                  + dock->area.width - 1, 0, 0, 0, 0);
                 break;
             case OB_ORIENTATION_VERT:
                 STRUT_PARTIAL_SET(dock_strut, strw, 0, 0, 0,
-                                  dock->area.y, dock->area.y + dock->area.height - 1,
-                                  0, 0, 0, 0, 0, 0);
+                                  dock->area.y, dock->area.y
+                                  + dock->area.height - 1, 0, 0, 0, 0, 0, 0);
                 break;
             }
             break;
         case OB_DIRECTION_NORTH:
             STRUT_PARTIAL_SET(dock_strut, 0, strh, 0, 0,
-                              0, 0, dock->area.x, dock->area.x + dock->area.width - 1,
-                              0, 0, 0, 0);
+                              0, 0, dock->area.x, dock->area.x
+                              + dock->area.width - 1, 0, 0, 0, 0);
             break;
         case OB_DIRECTION_NORTHEAST:
             switch (config_dock_orient) {
             case OB_ORIENTATION_HORZ:
                 STRUT_PARTIAL_SET(dock_strut, 0, strh, 0, 0,
-                                  0, 0, dock->area.x, dock->area.x + dock->area.width -1,
-                                  0, 0, 0, 0);
+                                  0, 0, dock->area.x, dock->area.x
+                                  + dock->area.width -1, 0, 0, 0, 0);
                 break;
             case OB_ORIENTATION_VERT:
                 STRUT_PARTIAL_SET(dock_strut, 0, 0, strw, 0,
-                                  0, 0, 0, 0,
-                                  dock->area.y, dock->area.y + dock->area.height - 1, 0, 0);
+                                  0, 0, 0, 0, dock->area.y, dock->area.y
+                                  + dock->area.height - 1, 0, 0);
                 break;
             }
             break;
         case OB_DIRECTION_WEST:
             STRUT_PARTIAL_SET(dock_strut, strw, 0, 0, 0,
-                              dock->area.y, dock->area.y + dock->area.height - 1,
-                              0, 0, 0, 0, 0, 0);
+                              dock->area.y, dock->area.y
+                              + dock->area.height - 1, 0, 0, 0, 0, 0, 0);
             break;
         case OB_DIRECTION_EAST:
             STRUT_PARTIAL_SET(dock_strut, 0, 0, strw, 0,
-                              0, 0, 0, 0,
-                              dock->area.y, dock->area.y + dock->area.height - 1, 0, 0);
+                              0, 0, 0, 0, dock->area.y, dock->area.y
+                              + dock->area.height - 1, 0, 0);
             break;
         case OB_DIRECTION_SOUTHWEST:
             switch (config_dock_orient) {
             case OB_ORIENTATION_HORZ:
                 STRUT_PARTIAL_SET(dock_strut, 0, 0, 0, strh,
-                                  0, 0, 0, 0, 0, 0,
-                                  dock->area.x, dock->area.x + dock->area.width - 1);
+                                  0, 0, 0, 0, 0, 0, dock->area.x, dock->area.x
+                                  + dock->area.width - 1);
                 break;
             case OB_ORIENTATION_VERT:
                 STRUT_PARTIAL_SET(dock_strut, strw, 0, 0, 0,
-                                  dock->area.y, dock->area.y + dock->area.height - 1,
-                                  0, 0, 0, 0, 0, 0);
+                                  dock->area.y, dock->area.y
+                                  + dock->area.height - 1, 0, 0, 0, 0, 0, 0);
                 break;
             }
             break;
         case OB_DIRECTION_SOUTH:
             STRUT_PARTIAL_SET(dock_strut, 0, 0, 0, strh,
-                              0, 0, 0, 0, 0, 0,
-                              dock->area.x, dock->area.x + dock->area.width - 1);
+                              0, 0, 0, 0, 0, 0, dock->area.x, dock->area.x
+                              + dock->area.width - 1);
             break;
         case OB_DIRECTION_SOUTHEAST:
             switch (config_dock_orient) {
             case OB_ORIENTATION_HORZ:
                 STRUT_PARTIAL_SET(dock_strut, 0, 0, 0, strh,
-                                  0, 0, 0, 0, 0, 0,
-                                  dock->area.x, dock->area.x + dock->area.width - 1);
+                                  0, 0, 0, 0, 0, 0, dock->area.x,
+                                  dock->area.x + dock->area.width - 1);
                 break;
             case OB_ORIENTATION_VERT:
                 STRUT_PARTIAL_SET(dock_strut, 0, 0, strw, 0,
-                                  0, 0, 0, 0,
-                                  dock->area.y, dock->area.y + dock->area.height - 1, 0, 0);
+                                  0, 0, 0, 0, dock->area.y, dock->area.y
+                                  + dock->area.height - 1, 0, 0);
                 break;
             }
             break;
@@ -514,10 +518,11 @@ void dock_configure()
         g_assert(dock->area.width > 0);
         g_assert(dock->area.height > 0);
 
-        XMoveResizeWindow(ob_display, dock->frame,
-                          dock->area.x, dock->area.y, dock->area.width, dock->area.height);
+        XMoveResizeWindow(ob_display, dock->frame, dock->area.x, dock->area.y,
+                          dock->area.width, dock->area.height);
 
-        RrPaint(dock->a_frame, dock->frame, dock->area.width, dock->area.height);
+        RrPaint(dock->a_frame, dock->frame, dock->area.width,
+                dock->area.height);
         XMapWindow(ob_display, dock->frame);
     } else
         XUnmapWindow(ob_display, dock->frame);
@@ -623,15 +628,17 @@ void dock_hide(gboolean hide)
 {
     if (!hide) {
         if (dock->hidden && config_dock_hide) {
-            ob_main_loop_timeout_add(ob_main_loop, config_dock_show_delay,
-                                 show_timeout, NULL, g_direct_equal, NULL);
+            ob_main_loop_timeout_add(ob_main_loop,
+                                     config_dock_show_delay * 1000,
+                                     show_timeout, NULL, g_direct_equal, NULL);
         } else if (!dock->hidden && config_dock_hide) {
             ob_main_loop_timeout_remove(ob_main_loop, hide_timeout);
         }
     } else {
         if (!dock->hidden && config_dock_hide) {
-            ob_main_loop_timeout_add(ob_main_loop, config_dock_hide_delay,
-                                 hide_timeout, NULL, g_direct_equal, NULL);
+            ob_main_loop_timeout_add(ob_main_loop,
+                                     config_dock_hide_delay * 1000,
+                                     hide_timeout, NULL, g_direct_equal, NULL);
         } else if (dock->hidden && config_dock_hide) {
             ob_main_loop_timeout_remove(ob_main_loop, show_timeout);
         }
@@ -640,5 +647,6 @@ void dock_hide(gboolean hide)
 
 void dock_get_area(Rect *a)
 {
-    RECT_SET(*a, dock->area.x, dock->area.y, dock->area.width, dock->area.height);
+    RECT_SET(*a, dock->area.x, dock->area.y,
+             dock->area.width, dock->area.height);
 }
This page took 0.027809 seconds and 4 git commands to generate.