diff options
author | joey <joey@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2003-11-30 16:36:10 +0000 |
---|---|---|
committer | joey <joey@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2003-11-30 16:36:10 +0000 |
commit | 640f93d0183419c1d7894fa09ef7cafac416ab9f (patch) | |
tree | 02aebf4bf1fb37c053faaf4a95d41e15cf51c88d /libvo/w32_common.c | |
parent | 4daef48770c3d434aa87d4449e864ad733cb194a (diff) | |
download | mpv-640f93d0183419c1d7894fa09ef7cafac416ab9f.tar.bz2 mpv-640f93d0183419c1d7894fa09ef7cafac416ab9f.tar.xz |
runtime 'stay-on-top' functionality
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@11543 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/w32_common.c')
-rw-r--r-- | libvo/w32_common.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/libvo/w32_common.c b/libvo/w32_common.c index a6d770149a..2a46ee1206 100644 --- a/libvo/w32_common.c +++ b/libvo/w32_common.c @@ -146,18 +146,20 @@ static void resetMode(void) { } int createRenderingContext(void) { + HWND layer = HWND_NOTOPMOST; if (wglContext) return 1; + if (vo_fs || vo_ontop) layer = HWND_TOPMOST; if (vo_fs) { changeMode(); - SetWindowPos(vo_hwnd, HWND_TOPMOST, 0, 0, vo_screenwidth, vo_screenheight, SWP_SHOWWINDOW); + SetWindowPos(vo_hwnd, layer, 0, 0, vo_screenwidth, vo_screenheight, SWP_SHOWWINDOW); if (cursor) { ShowCursor(0); cursor = 0; } } else { resetMode(); - SetWindowPos(vo_hwnd, HWND_NOTOPMOST, (vo_screenwidth - vo_dwidth) / 2, (vo_screenheight - vo_dheight) / 2, vo_dwidth, vo_dheight, SWP_SHOWWINDOW); + SetWindowPos(vo_hwnd, layer, (vo_screenwidth - vo_dwidth) / 2, (vo_screenheight - vo_dheight) / 2, vo_dwidth, vo_dheight, SWP_SHOWWINDOW); if (!cursor) { ShowCursor(1); cursor = 1; @@ -256,6 +258,16 @@ void vo_w32_fullscreen(void) { createRenderingContext(); } +void vo_w32_ontop( void ) +{ + vo_ontop = !vo_ontop; + if (!vo_fs) { + HWND layer = HWND_NOTOPMOST; + if (vo_ontop) layer = HWND_TOPMOST; + SetWindowPos(vo_hwnd, layer, (vo_screenwidth - vo_dwidth) / 2, (vo_screenheight - vo_dheight) / 2, vo_dwidth, vo_dheight, SWP_SHOWWINDOW); + } +} + void vo_w32_uninit() { mp_msg(MSGT_VO, MSGL_V, "vo: win32: uninit\n"); resetMode(); |