0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 12:02:23 +02:00

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
This commit is contained in:
reimar 2010-07-01 19:48:00 +00:00 committed by Uoti Urpala
parent 30d7c19b69
commit 1e159f4ecc

View File

@ -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;