#define DOCK_EVENT_MASK (ButtonPressMask | ButtonReleaseMask | \
EnterWindowMask | LeaveWindowMask)
#define DOCKAPP_EVENT_MASK (StructureNotifyMask)
+#define DOCK_NOPROPAGATEMASK (ButtonPressMask | ButtonReleaseMask | \
+ ButtonMotionMask)
static ObDock *dock;
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,
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;
break;
}
break;
- }
+ }
}
}
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;
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);
{
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);
}
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);
}