mirror of
https://github.com/mpv-player/mpv
synced 2024-12-24 15:52:25 +00:00
window resize bug fixed
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@5987 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
2d3655ed71
commit
8c9b41e72a
@ -98,7 +98,11 @@ void guiGetEvent( int type,char * arg )
|
||||
break;
|
||||
case guiSetShVideo:
|
||||
{
|
||||
mplResizeToMovieSize( vo_dwidth,vo_dheight );
|
||||
if ( !appMPlayer.subWindow.isFullScreen )
|
||||
{
|
||||
wsResizeWindow( &appMPlayer.subWindow,vo_dwidth,vo_dheight );
|
||||
wsMoveWindow( &appMPlayer.subWindow,True,appMPlayer.sub.x,appMPlayer.sub.y );
|
||||
}
|
||||
guiIntfStruct.MovieWidth=vo_dwidth;
|
||||
guiIntfStruct.MovieHeight=vo_dwidth;
|
||||
}
|
||||
|
@ -207,15 +207,6 @@ void ChangeSkin( char * name )
|
||||
btnModify( evFullScreen,!appMPlayer.subWindow.isFullScreen );
|
||||
}
|
||||
|
||||
void mplResizeToMovieSize( unsigned int width,unsigned int height )
|
||||
{
|
||||
if ( !appMPlayer.subWindow.isFullScreen )
|
||||
{
|
||||
wsResizeWindow( &appMPlayer.subWindow,width,height );
|
||||
wsMoveWindow( &appMPlayer.subWindow,True,appMPlayer.sub.x,appMPlayer.sub.y );
|
||||
}
|
||||
}
|
||||
|
||||
void mplSetFileName( char * fname )
|
||||
{
|
||||
if ( !fname ) return;
|
||||
|
@ -15,7 +15,6 @@ extern void mplPause( void );
|
||||
extern void mplState( void );
|
||||
extern void mplPrev( void );
|
||||
extern void mplNext( void );
|
||||
extern void mplResizeToMovieSize( unsigned int width,unsigned int height );
|
||||
|
||||
extern void mplIncAudioBufDelay( void );
|
||||
extern void mplDecAudioBufDelay( void );
|
||||
|
11
Gui/wm/ws.c
11
Gui/wm/ws.c
@ -361,6 +361,7 @@ void wsCreateWindow( wsTWindow * win,int X,int Y,int wX,int hY,int bW,int cV,uns
|
||||
win->SizeHint.y=win->Y;
|
||||
win->SizeHint.width=win->Width;
|
||||
win->SizeHint.height=win->Height;
|
||||
|
||||
if ( D & wsMinSize )
|
||||
{
|
||||
win->SizeHint.flags|=PMinSize;
|
||||
@ -373,6 +374,7 @@ void wsCreateWindow( wsTWindow * win,int X,int Y,int wX,int hY,int bW,int cV,uns
|
||||
win->SizeHint.max_width=win->Width;
|
||||
win->SizeHint.max_height=win->Height;
|
||||
}
|
||||
|
||||
win->SizeHint.height_inc=1;
|
||||
win->SizeHint.width_inc=1;
|
||||
win->SizeHint.base_width=win->Width;
|
||||
@ -770,9 +772,12 @@ void wsResizeWindow( wsTWindow * win,int sx, int sy )
|
||||
win->Width=sx;
|
||||
win->Height=sy;
|
||||
|
||||
win->SizeHint.flags=PSize | PWinGravity;
|
||||
win->SizeHint.flags=PPosition | PSize | PWinGravity | PBaseSize;
|
||||
win->SizeHint.x=win->X;
|
||||
win->SizeHint.y=win->Y;
|
||||
win->SizeHint.width=win->Width;
|
||||
win->SizeHint.height=win->Height;
|
||||
/*
|
||||
if ( win->Property & wsMinSize )
|
||||
{
|
||||
win->SizeHint.flags|=PMinSize;
|
||||
@ -785,9 +790,13 @@ void wsResizeWindow( wsTWindow * win,int sx, int sy )
|
||||
win->SizeHint.max_width=win->Width;
|
||||
win->SizeHint.max_height=win->Height;
|
||||
}
|
||||
*/
|
||||
win->SizeHint.win_gravity=StaticGravity;
|
||||
win->SizeHint.base_width=sx; win->SizeHint.base_height=sy;
|
||||
if ( !wsIsKDE ) XUnmapWindow( wsDisplay,win->WindowID );
|
||||
XSetWMNormalHints( wsDisplay,win->WindowID,&win->SizeHint );
|
||||
XResizeWindow( wsDisplay,win->WindowID,sx,sy );
|
||||
XMapRaised( wsDisplay,win->WindowID );
|
||||
if ( win->ReSize ) win->ReSize( win->X,win->Y,win->Width,win->Height );
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user