no more interactive mouse actions, they are evil etc. actions now "feel" much more...
authorDana Jansens <danakj@orodu.net>
Tue, 9 Sep 2003 07:16:38 +0000 (07:16 +0000)
committerDana Jansens <danakj@orodu.net>
Tue, 9 Sep 2003 07:16:38 +0000 (07:16 +0000)
openbox/action.c
openbox/action.h
openbox/event.c
openbox/keyboard.c
openbox/keyboard.h
openbox/mouse.c
openbox/mouse.h
openbox/screen.c

index e16e177..efc7f1e 100644 (file)
@@ -767,7 +767,6 @@ ObAction *action_parse(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
 }
 
 void action_run_full(ObAction *a, struct _ObClient *c,
-                     ObFrameContext context,
                      guint state, guint button, gint x, gint y,
                      gboolean cancel, gboolean done)
 {
@@ -784,7 +783,7 @@ void action_run_full(ObAction *a, struct _ObClient *c,
         a->data.inter.cancel = cancel;
         a->data.inter.final = done;
         if (!(cancel || done))
-            keyboard_interactive_grab(state, c, context, a);
+            keyboard_interactive_grab(state, c, a);
     }
 
     a->func(&a->data);
index 1852507..debae8e 100644 (file)
@@ -153,7 +153,6 @@ void action_free(ObAction *a);
 
 /*! Executes an action.
   @param c The client associated with the action. Can be NULL.
-  @param context The context in which the user action occured.
   @param state The keyboard modifiers state at the time the user action occured
   @param button The mouse button used to execute the action.
   @param x The x coord at which the user action occured.
@@ -164,21 +163,20 @@ void action_free(ObAction *a);
          affects interactive actions, but should generally always be FALSE.
 */
 void action_run_full(ObAction *a, struct _ObClient *c,
-                     ObFrameContext context,
                      guint state, guint button, gint x, gint y,
                      gboolean cancel, gboolean done);
 
-#define action_run_mouse(a, c, t, s, b, x, y) \
-    action_run_full(a, c, t, s, b, x, y, FALSE, FALSE)
+#define action_run_mouse(a, c, s, b, x, y) \
+    action_run_full(a, c, s, b, x, y, FALSE, FALSE)
 
 #define action_run_interactive(a, c, s, n, d) \
-    action_run_full(a, c, OB_FRAME_CONTEXT_NONE, s, 0, -1, -1, n, d)
+    action_run_full(a, c, s, 0, -1, -1, n, d)
 
 #define action_run_key(a, c, s, x, y) \
-    action_run_full(a, c, OB_FRAME_CONTEXT_NONE, s, 0, x, y, FALSE,FALSE)
+    action_run_full(a, c, s, 0, x, y, FALSE,FALSE)
 
 #define action_run(a, c, s) \
-    action_run_full(a, c, OB_FRAME_CONTEXT_NONE, s, 0, -1, -1, FALSE,FALSE)
+    action_run_full(a, c, s, 0, -1, -1, FALSE,FALSE)
 
 /* Execute */
 void action_execute(union ActionData *data);
index c744e3a..79d3507 100644 (file)
@@ -487,17 +487,14 @@ static void event_process(const XEvent *ec, gpointer data)
     {
         if (menu_frame_visible)
             event_handle_menu(e);
-        else if (moveresize_in_progress)
-            moveresize_event(e);
         else {
-            ObFrameContext context;
+            if (!keyboard_process_interactive_grab(e)) {
+                if (moveresize_in_progress)
+                    moveresize_event(e);
 
-            context = frame_context(client, e->xany.window);
-
-            if (!keyboard_process_interactive_grab(e, &client, &context)) {
                 if (e->type == ButtonPress || e->type == ButtonRelease ||
                     e->type == MotionNotify)
-                    mouse_event(client, context, e);
+                    mouse_event(client, e);
                 else if (e->type == KeyPress)
                     /* when in the middle of a focus cycling action, this
                        causes the window which appears to be focused to be
index 65d2f2e..fe13c97 100644 (file)
@@ -12,6 +12,7 @@
 #include "keytree.h"
 #include "keyboard.h"
 #include "translate.h"
+#include "moveresize.h"
 
 #include <glib.h>
 
@@ -129,12 +130,15 @@ gboolean keyboard_bind(GList *keylist, ObAction *action)
 }
 
 void keyboard_interactive_grab(guint state, ObClient *client,
-                               ObFrameContext context, ObAction *action)
+                               ObAction *action)
 {
     ObInteractiveState *s;
 
     g_assert(action->data.any.interactive);
 
+    if (moveresize_in_progress)
+        moveresize_end(FALSE);
+
     if (!interactive_states) {
         if (!grab_keyboard(TRUE))
             return;
@@ -149,14 +153,11 @@ void keyboard_interactive_grab(guint state, ObClient *client,
     s->state = state;
     s->client = client;
     s->action = action;
-    s->context = context;
 
     interactive_states = g_slist_append(interactive_states, s);
 }
 
-gboolean keyboard_process_interactive_grab(const XEvent *e,
-                                           ObClient **client,
-                                           ObFrameContext *context)
+gboolean keyboard_process_interactive_grab(const XEvent *e)
 {
     GSList *it, *next;
     gboolean handled = FALSE;
@@ -168,9 +169,6 @@ gboolean keyboard_process_interactive_grab(const XEvent *e,
 
         next = g_slist_next(it);
         
-        *client = s->client;
-        *context = s->context;
-
         if ((e->type == KeyRelease && 
              !(s->state & e->xkey.state)))
             done = TRUE;
index ec51fad..61fe19e 100644 (file)
@@ -21,11 +21,8 @@ void keyboard_event(struct _ObClient *client, const XEvent *e);
 void keyboard_reset_chains();
 
 void keyboard_interactive_grab(guint state, struct _ObClient *client,
-                               ObFrameContext context,
                                struct _ObAction *action);
-gboolean keyboard_process_interactive_grab(const XEvent *e,
-                                           struct _ObClient **client,
-                                           ObFrameContext *context);
+gboolean keyboard_process_interactive_grab(const XEvent *e);
 
 void keyboard_grab_for_client(struct _ObClient *c, gboolean grab);
 
index 2506840..ab628ff 100644 (file)
@@ -107,20 +107,23 @@ static gboolean fire_binding(ObMouseAction a, ObFrameContext context,
     if (it == NULL) return FALSE;
 
     for (it = b->actions[a]; it; it = it->next)
-        action_run_mouse(it->data, c, context, state, button, x, y);
+        action_run_mouse(it->data, c, state, button, x, y);
     return TRUE;
 }
 
-void mouse_event(ObClient *client, ObFrameContext context, XEvent *e)
+void mouse_event(ObClient *client, XEvent *e)
 {
     static Time ltime;
     static guint button = 0, state = 0, lbutton = 0;
-
     static Window lwindow = None;
     static int px, py;
+
+    ObFrameContext context;
     gboolean click = FALSE;
     gboolean dclick = FALSE;
 
+    context = frame_context(client, e->xany.window);
+
     switch (e->type) {
     case ButtonPress:
         px = e->xbutton.x_root;
index 31ce40f..deba7ed 100644 (file)
@@ -13,7 +13,7 @@ void mouse_shutdown(gboolean reconfig);
 gboolean mouse_bind(char *buttonstr, char *contextstr, ObMouseAction mact,
                     ObAction *action);
 
-void mouse_event(struct _ObClient *client, ObFrameContext context, XEvent *e);
+void mouse_event(struct _ObClient *client, XEvent *e);
 
 void mouse_grab_for_client(struct _ObClient *client, gboolean grab);
 
index 656206b..f109bab 100644 (file)
@@ -5,6 +5,7 @@
 #include "prop.h"
 #include "grab.h"
 #include "startupnotify.h"
+#include "moveresize.h"
 #include "config.h"
 #include "screen.h"
 #include "client.h"
@@ -410,6 +411,9 @@ void screen_set_desktop(guint num)
 
     ob_debug("Moving to desktop %d\n", num+1);
 
+    if (moveresize_client)
+        client_set_desktop(moveresize_client, num, TRUE);
+
     /* show windows before hiding the rest to lessen the enter/leave events */
 
     /* show windows from top to bottom */