X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=plugins%2Fmouse%2Fmouseparse.c;h=2c94fb19cd50c6a83c354a8bc6d62afb1f757ce6;hb=a0691941e88ca8a8388fe17971be637e3aa3d835;hp=d2039dd86970b1e1bed652120e6746f7e65e7d1d;hpb=038e61197479865d15cb6ef686e80e47bf2fd843;p=chaz%2Fopenbox diff --git a/plugins/mouse/mouseparse.c b/plugins/mouse/mouseparse.c index d2039dd8..2c94fb19 100644 --- a/plugins/mouse/mouseparse.c +++ b/plugins/mouse/mouseparse.c @@ -1,5 +1,6 @@ #include "kernel/action.h" #include "kernel/parse.h" +#include "kernel/prop.h" #include "mouse.h" void mouseparse(ParseToken *token) @@ -68,12 +69,24 @@ void mouseparse(ParseToken *token) action = action_from_string(token->data.identifier); /* check for valid actions for motion events */ - if ((event == MouseAction_Motion) ^ - (action && - (action->func == action_move || - action->func == action_resize))) { - action_free(action); - action = NULL; + if (event == MouseAction_Motion) { + if (action && (action->func != action_moveresize || + action->data.moveresize.corner == + prop_atoms.net_wm_moveresize_move_keyboard || + action->data.moveresize.corner == + prop_atoms.net_wm_moveresize_size_keyboard)) { + action_free(action); + action = NULL; + } + } else { + if (action && action->func == action_moveresize && + action->data.moveresize.corner != + prop_atoms.net_wm_moveresize_move_keyboard && + action->data.moveresize.corner != + prop_atoms.net_wm_moveresize_size_keyboard) { + action_free(action); + action = NULL; + } } if (action != NULL) { @@ -99,6 +112,8 @@ void mouseparse(ParseToken *token) /* these use the argument */ if (action->func == action_execute || action->func == action_restart) action->data.execute.path = g_strdup(arg_str); + else if (action->func == action_showmenu) + action->data.showmenu.name = g_strdup(arg_str); if ((action->func == action_desktop || action->func == action_send_to_desktop) && arg_int)