From 7886b797a36f5a035a75a19424e0b3cf7825baf8 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Thu, 17 Apr 2003 05:28:35 +0000 Subject: move the move/resize functionality into moveresize.c, for use with the netwm atoms. use it from teh plugins. combine the two actions. --- plugins/mouse/mouseparse.c | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) (limited to 'plugins/mouse/mouseparse.c') diff --git a/plugins/mouse/mouseparse.c b/plugins/mouse/mouseparse.c index 099dbaa8..f9f5f2f6 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,26 @@ 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 (action->func == action_moveresize) + g_message("%d", action->data.moveresize.corner); + 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) { -- cgit v1.2.3