From: Mikael Magnusson Date: Mon, 7 Jul 2008 19:20:34 +0000 (+0200) Subject: "Fix" releasing the mouse button over a window. X-Git-Tag: mikabox-3.4.7.2~34 X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=cbbe8ee5082e1c079ab180941fa2491b8d467cf6;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 db7a5629..a8e5c3f2 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -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 || diff --git a/openbox/mouse.c b/openbox/mouse.c index e00a22f7..58ec5b7d 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) @@ -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;