diff options
author | wm4 <wm4@nowhere> | 2016-07-25 11:28:06 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-07-25 11:28:06 +0200 |
commit | cb4342dda4389abb2d5c81f7bc660675199a313d (patch) | |
tree | be105cf54458d2b23b5d6fa7fecd1f2d5c63ae8f /video/out/x11_common.c | |
parent | ebe798a333fe547b77a5c0169a7fd8aadf8b8beb (diff) | |
download | mpv-cb4342dda4389abb2d5c81f7bc660675199a313d.tar.bz2 mpv-cb4342dda4389abb2d5c81f7bc660675199a313d.tar.xz |
x11: do not accidentally discard event flags
It seems vo_x11_check_events() was supposed to return the currently
flagged events and reset them. But there are many places where
vo_x11_check_events() is called without checking its return value. This
could lead to forgotten events.
Change the code such that they can't get lost.
Diffstat (limited to 'video/out/x11_common.c')
-rw-r--r-- | video/out/x11_common.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/video/out/x11_common.c b/video/out/x11_common.c index b0082086bb..ee19e1be73 100644 --- a/video/out/x11_common.c +++ b/video/out/x11_common.c @@ -1019,7 +1019,7 @@ static void vo_x11_check_net_wm_state_fullscreen_change(struct vo *vo) } } -int vo_x11_check_events(struct vo *vo) +void vo_x11_check_events(struct vo *vo) { struct vo_x11_state *x11 = vo->x11; Display *display = vo->x11->display; @@ -1178,9 +1178,6 @@ int vo_x11_check_events(struct vo *vo) } update_vo_size(vo); - int ret = x11->pending_vo_events; - x11->pending_vo_events = 0; - return ret; } static void vo_x11_sizehint(struct vo *vo, struct mp_rect rc, bool override_pos) @@ -1791,7 +1788,9 @@ int vo_x11_control(struct vo *vo, int *events, int request, void *arg) struct vo_x11_state *x11 = vo->x11; switch (request) { case VOCTRL_CHECK_EVENTS: - *events |= vo_x11_check_events(vo); + vo_x11_check_events(vo); + *events |= x11->pending_vo_events; + x11->pending_vo_events = 0; return VO_TRUE; case VOCTRL_FULLSCREEN: opts->fullscreen = !opts->fullscreen; |