From: Mikael Magnusson Date: Fri, 8 Jan 2010 17:22:18 +0000 (+0100) Subject: "Fix" releasing the mouse button over a window. X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=a795f50268cc8b575e79920152998297b8b2db98;p=mikachu%2Fopenbox.git "Fix" releasing the mouse button over a window. 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. --- diff --git a/openbox/event.c b/openbox/event.c index 243f2078..83ac345d 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -117,6 +117,8 @@ static ObClient *focus_delay_timeout_client = NULL; static guint unfocus_delay_timeout_id = 0; static ObClient *unfocus_delay_timeout_client = NULL; +extern guint button; + #ifdef USE_SM static gboolean ice_handler(GIOChannel *source, GIOCondition cond, gpointer conn) @@ -721,6 +723,10 @@ static void event_process(const XEvent *ec, gpointer data) if (e->type == ButtonPress) pressed = e->xbutton.button; + /* 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 || diff --git a/openbox/mouse.c b/openbox/mouse.c index 2f0c8f59..b0e214db 100644 --- a/openbox/mouse.c +++ b/openbox/mouse.c @@ -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) @@ -209,7 +211,7 @@ void mouse_replay_pointer(void) gboolean 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, lx = -10, ly = -10; gboolean used = FALSE;