all repos — openbox @ b192784070b3ec03038e33f2080a39e497e5dd80

openbox fork - make it a bit more like ryudo

add <dock><moveButton> which can change which button combo is used to move dock apps around in the dock. The new default is A-Left instead of Middle, since soem dock apps use middle, assuming they can!
Dana Jansens danakj@orodu.net
commit

b192784070b3ec03038e33f2080a39e497e5dd80

parent

11615ac2c4576d6c3e0db20e8b62375184d374db

5 files changed, 47 insertions(+), 4 deletions(-)

jump to
M data/rc.xml.indata/rc.xml.in

@@ -48,6 +48,7 @@ <floatingX>0</floatingX>

<floatingY>0</floatingY> <autoHide>no</autoHide> <hideDelay>300</hideDelay> + <moveButton>A-Left</moveButton> </dock> <keyboard>
M data/rc.xsddata/rc.xsd

@@ -108,6 +108,7 @@ <xs:element name="floatingX" type="xs:integer"/>

<xs:element name="floatingY" type="xs:integer"/> <xs:element name="autoHide" type="ob:yesorno"/> <xs:element name="hideDelay" type="xs:integer"/> + <xs:element name="moveButton" type="ob:button"/> </xs:sequence> </xs:complexType> <xs:complexType name="action">
M openbox/config.copenbox/config.c

@@ -47,6 +47,8 @@ gint config_dock_y;

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;

@@ -325,6 +327,17 @@ if ((n = parse_find_node("autoHide", node)))

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)

@@ -489,6 +502,8 @@ config_dock_y = 0;

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);
M openbox/config.hopenbox/config.h

@@ -61,6 +61,10 @@ /*! Whether to auto-hide the dock when the pointer is not over it */

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;
M openbox/dock.copenbox/dock.c

@@ -34,11 +34,27 @@ static ObDock *dock;

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);

@@ -50,6 +66,9 @@ stacking_add(DOCK_AS_WINDOW(dock));

dock_configure(); dock_hide(TRUE); + + for (it = dock->dock_apps; it; it = g_list_next(it)) + dock_app_grab_button(it->data, TRUE); return; }

@@ -81,7 +100,12 @@

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; }

@@ -149,9 +173,7 @@ be reparented back to root automatically */

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);

@@ -166,7 +188,7 @@ }

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);