"Fix" releasing the mouse button over a window.
authorMikael Magnusson <mikachu@gmail.com>
Mon, 7 Jul 2008 19:20:34 +0000 (21:20 +0200)
committerMikael Magnusson <mikachu@gmail.com>
Mon, 7 Jul 2008 19:20:34 +0000 (21:20 +0200)
Previously if you click-drag-released the left button on the root window to a client window,
Openbox would ignore the release because we don't own the client window. Now check if we
are in a button press or not before ignoring it. The bug was we would initiate a move when
the cursor was moved over a titlebar even when the button was unpressed because the variable
didn't get cleared properly.

This fix is very ugly.

openbox/event.c
openbox/mouse.c

index db7a5629056b82cf307c53c7084c9f3adc9af0f4..a8e5c3f21b4ed5fddd3b68815b6a2d5be8a98977 100644 (file)
@@ -103,8 +103,10 @@ static void focus_delay_client_dest(ObClient *client, gpointer data);
 Time event_curtime = CurrentTime;
 Time event_last_user_time = CurrentTime;
 Time client_swoon = CurrentTime;
-/*! The serial of the current X event */
 
+extern int button;
+
+/*! The serial of the current X event */
 static gulong event_curserial;
 static gboolean focus_left_screen = FALSE;
 /*! A list of ObSerialRanges which are to be ignored for mouse enter events */
@@ -738,6 +740,10 @@ static void event_process(const XEvent *ec, gpointer data)
             {
                 event_handle_user_input(client, e);
             }
+            /* If we have grabbed the mouse actively, I think this is how
+               to check it? */
+            else if (button)
+                event_handle_user_input(NULL, e);
         }
     }
     else if (e->type == KeyPress || e->type == KeyRelease ||
index e00a22f7a67c183dd540f6aa58c66fdb83d267dd..58ec5b7d52c9ddc409a702de263812022468fb10 100644 (file)
@@ -43,6 +43,8 @@ static GSList *bound_contexts[OB_FRAME_NUM_CONTEXTS];
    to send it to other applications */
 static gboolean replay_pointer_needed;
 
+guint button;
+
 ObFrameContext mouse_button_frame_context(ObFrameContext context,
                                           guint button,
                                           guint state)
@@ -208,7 +210,7 @@ void mouse_replay_pointer(void)
 void mouse_event(ObClient *client, XEvent *e)
 {
     static Time ltime;
-    static guint button = 0, state = 0, lbutton = 0;
+    static guint state = 0, lbutton = 0;
     static Window lwindow = None;
     static gint px, py, pwx = -1, pwy = -1;