mirror of https://github.com/mpv-player/mpv
Make -wid behave more consistent.
Original patch by kiriuja |mplayer-patches >ta< en-directo >tod< net| git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@15541 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
140b59994a
commit
362be18be6
|
@ -377,6 +377,8 @@ static uint32_t config(uint32_t width, uint32_t height, uint32_t d_width,
|
||||||
vo_window = WinID ? ((Window) WinID) : mRootWin;
|
vo_window = WinID ? ((Window) WinID) : mRootWin;
|
||||||
if (WinID)
|
if (WinID)
|
||||||
{
|
{
|
||||||
|
int border;
|
||||||
|
Window win;
|
||||||
XUnmapWindow(mDisplay, vo_window);
|
XUnmapWindow(mDisplay, vo_window);
|
||||||
XChangeWindowAttributes(mDisplay, vo_window, xswamask,
|
XChangeWindowAttributes(mDisplay, vo_window, xswamask,
|
||||||
&xswa);
|
&xswa);
|
||||||
|
@ -389,6 +391,9 @@ static uint32_t config(uint32_t width, uint32_t height, uint32_t d_width,
|
||||||
ButtonReleaseMask |
|
ButtonReleaseMask |
|
||||||
ExposureMask);
|
ExposureMask);
|
||||||
XMapWindow(mDisplay, vo_window);
|
XMapWindow(mDisplay, vo_window);
|
||||||
|
XGetGeometry(mDisplay, vo_window, &mRootWin,
|
||||||
|
&vo_dx, &vo_dy, &vo_dwidth, &vo_dheight,
|
||||||
|
&border, &depth);
|
||||||
} else
|
} else
|
||||||
XSelectInput(mDisplay, vo_window, ExposureMask);
|
XSelectInput(mDisplay, vo_window, ExposureMask);
|
||||||
} else
|
} else
|
||||||
|
|
|
@ -213,6 +213,7 @@ static uint32_t config(uint32_t width, uint32_t height, uint32_t d_width,
|
||||||
ButtonPressMask |
|
ButtonPressMask |
|
||||||
ButtonReleaseMask |
|
ButtonReleaseMask |
|
||||||
ExposureMask);
|
ExposureMask);
|
||||||
|
XMapWindow(mDisplay, vo_window);
|
||||||
} else
|
} else
|
||||||
XSelectInput(mDisplay, vo_window, ExposureMask);
|
XSelectInput(mDisplay, vo_window, ExposureMask);
|
||||||
|
|
||||||
|
|
|
@ -300,6 +300,7 @@ static uint32_t config(uint32_t width, uint32_t height, uint32_t d_width,
|
||||||
XUnmapWindow(mDisplay, vo_window);
|
XUnmapWindow(mDisplay, vo_window);
|
||||||
XChangeWindowAttributes(mDisplay, vo_window, xswamask, &xswa);
|
XChangeWindowAttributes(mDisplay, vo_window, xswamask, &xswa);
|
||||||
vo_x11_selectinput_witherr( mDisplay,vo_window,StructureNotifyMask | KeyPressMask | PropertyChangeMask | PointerMotionMask | ButtonPressMask | ButtonReleaseMask | ExposureMask );
|
vo_x11_selectinput_witherr( mDisplay,vo_window,StructureNotifyMask | KeyPressMask | PropertyChangeMask | PointerMotionMask | ButtonPressMask | ButtonReleaseMask | ExposureMask );
|
||||||
|
XMapWindow(mDisplay, vo_window);
|
||||||
} else XSelectInput( mDisplay,vo_window,ExposureMask );
|
} else XSelectInput( mDisplay,vo_window,ExposureMask );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -298,6 +298,11 @@ static uint32_t config(uint32_t width, uint32_t height, uint32_t d_width,
|
||||||
ButtonReleaseMask |
|
ButtonReleaseMask |
|
||||||
ExposureMask);
|
ExposureMask);
|
||||||
XMapWindow(mDisplay, vo_window);
|
XMapWindow(mDisplay, vo_window);
|
||||||
|
XGetGeometry(mDisplay, vo_window, &mRoot,
|
||||||
|
&drwX, &drwY, &vo_dwidth, &vo_dheight,
|
||||||
|
&drwBorderWidth, &drwDepth);
|
||||||
|
drwX = drwY = 0; // coordinates need to be local to the window
|
||||||
|
aspect_save_prescale(vo_dwidth, vo_dheight);
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
drwX = vo_dx;
|
drwX = vo_dx;
|
||||||
|
|
|
@ -347,6 +347,7 @@ static uint32_t config(uint32_t width, uint32_t height, uint32_t d_width,
|
||||||
ButtonPressMask |
|
ButtonPressMask |
|
||||||
ButtonReleaseMask |
|
ButtonReleaseMask |
|
||||||
ExposureMask);
|
ExposureMask);
|
||||||
|
XMapWindow(mDisplay, vo_window);
|
||||||
} else
|
} else
|
||||||
XSelectInput(mDisplay, vo_window, ExposureMask);
|
XSelectInput(mDisplay, vo_window, ExposureMask);
|
||||||
} else
|
} else
|
||||||
|
|
|
@ -666,10 +666,17 @@ found_subpic:
|
||||||
vo_window = WinID ? ((Window)WinID) : mRootWin;
|
vo_window = WinID ? ((Window)WinID) : mRootWin;
|
||||||
if ( WinID )
|
if ( WinID )
|
||||||
{
|
{
|
||||||
|
Window mRoot;
|
||||||
|
uint32_t drwBorderWidth, drwDepth;
|
||||||
XUnmapWindow( mDisplay,vo_window );
|
XUnmapWindow( mDisplay,vo_window );
|
||||||
XChangeWindowAttributes( mDisplay,vo_window,xswamask,&xswa );
|
XChangeWindowAttributes( mDisplay,vo_window,xswamask,&xswa );
|
||||||
vo_x11_selectinput_witherr( mDisplay,vo_window,StructureNotifyMask | KeyPressMask | PropertyChangeMask | PointerMotionMask | ButtonPressMask | ButtonReleaseMask | ExposureMask );
|
vo_x11_selectinput_witherr( mDisplay,vo_window,StructureNotifyMask | KeyPressMask | PropertyChangeMask | PointerMotionMask | ButtonPressMask | ButtonReleaseMask | ExposureMask );
|
||||||
XMapWindow( mDisplay,vo_window );
|
XMapWindow( mDisplay,vo_window );
|
||||||
|
XGetGeometry(mDisplay, vo_window, &mRoot,
|
||||||
|
&drwX, &drwY, &vo_dwidth, &vo_dheight,
|
||||||
|
&drwBorderWidth, &drwDepth);
|
||||||
|
drwX = drwY = 0; // coordinates need to be local to the window
|
||||||
|
aspect_save_prescale(vo_dwidth, vo_dheight);
|
||||||
} else { drwX=vo_dx; drwY=vo_dy; }
|
} else { drwX=vo_dx; drwY=vo_dy; }
|
||||||
} else
|
} else
|
||||||
if ( vo_window == None ){
|
if ( vo_window == None ){
|
||||||
|
|
Loading…
Reference in New Issue