diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2010-07-01 19:48:00 +0000 |
---|---|---|
committer | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2010-11-02 04:13:00 +0200 |
commit | 1e159f4eccc9e8bbdbd5c01043cbd5c5d48485b3 (patch) | |
tree | 51313a1d2811768065791afddaa0f08a7b4324b7 /libvo | |
parent | 30d7c19b6904a516f43d65b5ac3b01f8b208975c (diff) | |
download | mpv-1e159f4eccc9e8bbdbd5c01043cbd5c5d48485b3.tar.bz2 mpv-1e159f4eccc9e8bbdbd5c01043cbd5c5d48485b3.tar.xz |
x11_common: Do not try to grab input from -wid windows
It will most likely break their input processing.
If someone needs the previous behaviour, an option could be added (and
also used in the w32_common.c code).
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31601 b3059339-0415-0410-9bf9-f77b7e298cf2
Fix resizing with -wid after previous commit.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31604 b3059339-0415-0410-9bf9-f77b7e298cf2
Always request expose events, we have to handle them, the application
that created the -wid window can't.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31605 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r-- | libvo/x11_common.c | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/libvo/x11_common.c b/libvo/x11_common.c index 9c15c922d7..c6e8c9dbf0 100644 --- a/libvo/x11_common.c +++ b/libvo/x11_common.c @@ -763,6 +763,15 @@ void vo_x11_uninit(struct vo *vo) } } +static int check_resize(struct vo *vo) +{ + int old_w = vo->dwidth, old_h = vo->dheight; + vo_x11_update_geometry(vo); + if (vo->dwidth != old_w || vo->dheight != old_h) + return VO_EVENT_RESIZE; + return 0; +} + int vo_x11_check_events(struct vo *vo) { struct vo_x11_state *x11 = vo->x11; @@ -780,6 +789,8 @@ int vo_x11_check_events(struct vo *vo) x11->mouse_waiting_hide = 0; } + if (WinID > 0) + ret |= check_resize(vo); while (XPending(display)) { XNextEvent(display, &Event); @@ -792,12 +803,7 @@ int vo_x11_check_events(struct vo *vo) case ConfigureNotify: if (x11->window == None) break; - { - int old_w = vo->dwidth, old_h = vo->dheight; - vo_x11_update_geometry(vo); - if (vo->dwidth != old_w || vo->dheight != old_h) - ret |= VO_EVENT_RESIZE; - } + ret |= check_resize(vo); break; case KeyPress: { @@ -1044,8 +1050,15 @@ void vo_x11_create_vo_window(struct vo *vo, XVisualInfo *vis, int x, int y, XChangeWindowAttributes(mDisplay, x11->window, xswamask, &xswa); XInstallColormap(mDisplay, col_map); } - if (WinID) vo_x11_update_geometry(vo); - vo_x11_selectinput_witherr(mDisplay, x11->window, + if (WinID) { + vo_x11_update_geometry(vo); + // Expose events can only really be handled by us, so request them. + vo_x11_selectinput_witherr(mDisplay, x11->window, ExposureMask); + } else + // Do not capture events since it might break the parent application + // if it relies on events being forwarded to the parent of WinID. + // It also is consistent with the w32_common.c code. + vo_x11_selectinput_witherr(mDisplay, x11->window, StructureNotifyMask | KeyPressMask | PointerMotionMask | ButtonPressMask | ButtonReleaseMask | ExposureMask); goto final; |