1
0
mirror of https://github.com/mpv-player/mpv synced 2025-03-09 07:38:22 +00:00

Fix window position when changing videos while in fullscreen and for

window managers that modify position on Map. Oked by Alexander Strasser.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18718 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
reimar 2006-06-15 08:00:37 +00:00
parent d4b348d3ef
commit 37ee8c83cb
6 changed files with 15 additions and 13 deletions

View File

@ -424,11 +424,11 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width,
while (xev.type != MapNotify
|| xev.xmap.event != vo_window);
vo_x11_nofs_sizepos(vo_dx, vo_dy, vo_dwidth, vo_dheight);
if (fullscreen)
vo_x11_fullscreen();
} else if (!fullscreen)
XMoveResizeWindow(mDisplay, vo_window, vo_dx, vo_dy,
vo_dwidth, vo_dheight);
} else
vo_x11_nofs_sizepos(vo_dx, vo_dy, vo_dwidth, vo_dheight);
}
XSync(mDisplay, False);

View File

@ -238,13 +238,13 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width,
XStoreName(mDisplay, vo_window, mTitle);
XMapWindow(mDisplay, vo_window);
vo_x11_nofs_sizepos(vo_dx, vo_dy, vo_dwidth, vo_dheight);
if (flags & VOFLAG_FULLSCREEN)
vo_x11_fullscreen();
} else if (!(flags & VOFLAG_FULLSCREEN))
XMoveResizeWindow(mDisplay, vo_window, vo_dx, vo_dy,
vo_dwidth, vo_dheight);
} else
vo_x11_nofs_sizepos(vo_dx, vo_dy, vo_dwidth, vo_dheight);
}
if (vo_gc != None)

View File

@ -348,15 +348,14 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width,
NULL, 0, &hint);
vo_x11_sizehint(hint.x, hint.y, hint.width, hint.height, 0);
XMapWindow(mDisplay, vo_window);
vo_x11_nofs_sizepos(hint.x, hint.y, hint.width, hint.height);
if (flags & VOFLAG_FULLSCREEN)
vo_x11_fullscreen();
} else
{
// vo_fs set means we were already at fullscreen
vo_x11_sizehint(hint.x, hint.y, hint.width, hint.height, 0);
if (!vo_fs)
XMoveResizeWindow(mDisplay, vo_window, hint.x, hint.y,
hint.width, hint.height);
vo_x11_nofs_sizepos(hint.x, hint.y, hint.width, hint.height);
if (flags & VOFLAG_FULLSCREEN && !vo_fs)
vo_x11_fullscreen(); // handle -fs on non-first file
}

View File

@ -367,13 +367,13 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width,
XStoreName(mDisplay, vo_window, title);
XMapWindow(mDisplay, vo_window);
vo_x11_nofs_sizepos(vo_dx, vo_dy, vo_dwidth, vo_dheight);
if (flags & VOFLAG_FULLSCREEN)
vo_x11_fullscreen();
} else if (!(flags & VOFLAG_FULLSCREEN))
XMoveResizeWindow(mDisplay, vo_window, vo_dx, vo_dy,
vo_dwidth, vo_dheight);
} else
vo_x11_nofs_sizepos(vo_dx, vo_dy, vo_dwidth, vo_dheight);
}
if (vo_gc != None)

View File

@ -701,6 +701,7 @@ found_subpic:
XSetStandardProperties(mDisplay, vo_window, hello, hello, None, NULL, 0, &hint);
XSetWMNormalHints( mDisplay,vo_window,&hint );
XMapWindow(mDisplay, vo_window);
vo_x11_nofs_sizepos(hint.x, hint.y, hint.width, hint.height);
if ( flags&VOFLAG_FULLSCREEN ) vo_x11_fullscreen();
else {
vo_x11_sizehint( hint.x, hint.y, hint.width, hint.height,0 );
@ -708,7 +709,7 @@ found_subpic:
} else {
// vo_fs set means we were already at fullscreen
vo_x11_sizehint( hint.x, hint.y, hint.width, hint.height,0 );
if ( !vo_fs ) XMoveResizeWindow( mDisplay,vo_window,hint.x,hint.y,hint.width,hint.height );
vo_x11_nofs_sizepos(hint.x, hint.y, hint.width, hint.height);
if ( flags&VOFLAG_FULLSCREEN && !vo_fs ) vo_x11_fullscreen(); // handle -fs on non-first file
}

View File

@ -1512,6 +1512,8 @@ void vo_x11_fullscreen(void)
vo_x11_setlayer(mDisplay, vo_window, vo_ontop);
XMapRaised(mDisplay, vo_window);
if ( ! (vo_fs_type & vo_wm_FULLSCREEN) ) // some WMs change window pos on map
XMoveResizeWindow(mDisplay, vo_window, x, y, w, h);
XRaiseWindow(mDisplay, vo_window);
XFlush(mDisplay);
}