From 0c7978cf9caa81d1e6ef7e32458a5ff1834fa004 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 31 Aug 2013 21:21:05 +0200 Subject: input: deal with spurious X11 LeaveNotify events If the mpv window is unfocus, clicking on the OSC should focus the window (done by the window manager) and allow interaction with the OSC. But somehow X sends a spurious LeaveNotify event, immediately followed by an EnterNotify event. This happens at least with IceWM. The result is that the OSC will disappear (due to receiving MOUSE_LEAVE). The OSC will stay invisible, because EnterNotify isn't handled, and there's nothing that could make the OSC appear again. Solve this by handling EnterNotify. We cause a redundant MOUSE_MOVE event to be sent, which triggers the code to make the OSC visible. We have to remove the code from input.c, which ignores redundant mouse move events. Since the code ignoring redundant mouse move events is still needed on Windows, move that code to w32_common.c. The need for this is documented in the code, also see commit 03fd2fe. (The original idea was to save some code by having this code in the core, but now it turns out that this didn't quite work out.) --- mpvcore/input/input.c | 6 ------ 1 file changed, 6 deletions(-) (limited to 'mpvcore') diff --git a/mpvcore/input/input.c b/mpvcore/input/input.c index bfe18e0377..12e07a22dd 100644 --- a/mpvcore/input/input.c +++ b/mpvcore/input/input.c @@ -1647,12 +1647,6 @@ void mp_input_put_axis(struct input_ctx *ictx, int direction, double value) void mp_input_set_mouse_pos(struct input_ctx *ictx, int x, int y) { input_lock(ictx); - // we're already there - if (ictx->mouse_vo_x == x && ictx->mouse_vo_y == y) { - input_unlock(ictx); - return; - } - mp_msg(MSGT_INPUT, MSGL_DBG2, "input: mouse move %d/%d\n", x, y); ictx->mouse_event_counter++; -- cgit v1.2.3