ObOrientation config_dock_orient;
gboolean config_dock_hide;
guint config_dock_hide_delay;
+guint config_dock_app_move_button;
+guint config_dock_app_move_modifiers;
guint config_keyboard_reset_keycode;
guint config_keyboard_reset_state;
config_dock_hide = parse_bool(doc, n);
if ((n = parse_find_node("hideDelay", node)))
config_dock_hide_delay = parse_int(doc, n) * 1000;
+ if ((n = parse_find_node("moveButton", node))) {
+ gchar *str = parse_string(doc, n);
+ guint b, s;
+ if (translate_button(str, &s, &b)) {
+ config_dock_app_move_button = b;
+ config_dock_app_move_modifiers = s;
+ } else {
+ g_warning("invalid button '%s'", str);
+ }
+ g_free(str);
+ }
}
static void parse_menu(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node, void *d)
config_dock_orient = OB_ORIENTATION_VERT;
config_dock_hide = FALSE;
config_dock_hide_delay = 300;
+ config_dock_app_move_button = 2; /* middle */
+ config_dock_app_move_modifiers = 0;
parse_register(i, "dock", parse_dock, NULL);
extern gboolean config_dock_hide;
/*! The number of microseconds to wait before hiding the dock */
extern guint config_dock_hide_delay;
+/*! The mouse button to be used to move dock apps */
+extern guint config_dock_app_move_button;
+/*! The modifiers to be used with the button to move dock apps */
+extern guint config_dock_app_move_modifiers;
/* The name of the theme */
extern char *config_theme;
StrutPartial dock_strut;
+static void dock_app_grab_button(ObDockApp *app, gboolean grab)
+{
+ if (grab) {
+ grab_button_full(config_dock_app_move_button,
+ config_dock_app_move_modifiers, app->icon_win,
+ ButtonPressMask | ButtonReleaseMask |
+ ButtonMotionMask,
+ GrabModeAsync, OB_CURSOR_MOVE);
+ } else {
+ ungrab_button(config_dock_app_move_button,
+ config_dock_app_move_modifiers, app->icon_win);
+ }
+}
+
void dock_startup(gboolean reconfig)
{
XSetWindowAttributes attrib;
if (reconfig) {
+ GList *it;
+
XSetWindowBorder(ob_display, dock->frame,
RrColorPixel(ob_rr_theme->b_color));
XSetWindowBorderWidth(ob_display, dock->frame, ob_rr_theme->bwidth);
dock_configure();
dock_hide(TRUE);
+
+ for (it = dock->dock_apps; it; it = g_list_next(it))
+ dock_app_grab_button(it->data, TRUE);
return;
}
void dock_shutdown(gboolean reconfig)
{
if (reconfig) {
+ GList *it;
+
stacking_remove(DOCK_AS_WINDOW(dock));
+
+ for (it = dock->dock_apps; it; it = g_list_next(it))
+ dock_app_grab_button(it->data, FALSE);
return;
}
XChangeSaveSet(ob_display, app->icon_win, SetModeInsert);
XSelectInput(ob_display, app->icon_win, DOCKAPP_EVENT_MASK);
- grab_button_full(2, 0, app->icon_win,
- ButtonPressMask | ButtonReleaseMask | ButtonMotionMask,
- GrabModeAsync, OB_CURSOR_MOVE);
+ dock_app_grab_button(app, TRUE);
g_hash_table_insert(window_map, &app->icon_win, app);
void dock_remove(ObDockApp *app, gboolean reparent)
{
- ungrab_button(2, 0, app->icon_win);
+ dock_app_grab_button(app, FALSE);
XSelectInput(ob_display, app->icon_win, NoEventMask);
/* remove the window from our save set */
XChangeSaveSet(ob_display, app->icon_win, SetModeDelete);