diff options
author | joey <joey@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2005-11-10 22:25:54 +0000 |
---|---|---|
committer | joey <joey@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2005-11-10 22:25:54 +0000 |
commit | 8901ee0b0a8df948b9b308558aeef661b90474ba (patch) | |
tree | a516076dd020d3f3fabf7d31d1692efdf3a8a1cc /libvo | |
parent | 8318fcd06b7e2e94a2ef309f0ae3ed8890adc01d (diff) | |
download | mpv-8901ee0b0a8df948b9b308558aeef661b90474ba.tar.bz2 mpv-8901ee0b0a8df948b9b308558aeef661b90474ba.tar.xz |
add a switch, slave command, and vo control to toggle borderless window.
includes documentation.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16969 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r-- | libvo/video_out.c | 1 | ||||
-rw-r--r-- | libvo/video_out.h | 2 | ||||
-rw-r--r-- | libvo/vo_directx.c | 28 |
3 files changed, 30 insertions, 1 deletions
diff --git a/libvo/video_out.c b/libvo/video_out.c index 9ce90a9d86..6dc90a80aa 100644 --- a/libvo/video_out.c +++ b/libvo/video_out.c @@ -45,6 +45,7 @@ int vo_adapter_num=0; int vo_refresh_rate=0; int vo_keepaspect=1; int vo_rootwin=0; +int vo_border=1; int WinID = -1; int vo_pts=0; // for hw decoding diff --git a/libvo/video_out.h b/libvo/video_out.h index bf64e98186..3f6ba5e21a 100644 --- a/libvo/video_out.h +++ b/libvo/video_out.h @@ -57,6 +57,7 @@ #define VOCTRL_ONTOP 25 #define VOCTRL_ROOTWIN 26 +#define VOCTRL_BORDER 27 // Vo can be used by xover #define VOCTRL_XOVERLAY_SUPPORT 22 @@ -202,6 +203,7 @@ extern int vo_refresh_rate; extern int vo_keepaspect; extern int vo_rootwin; extern int vo_ontop; +extern int vo_border; extern int vo_gamma_brightness; extern int vo_gamma_saturation; diff --git a/libvo/vo_directx.c b/libvo/vo_directx.c index dea6e9b6d3..ada591d483 100644 --- a/libvo/vo_directx.c +++ b/libvo/vo_directx.c @@ -670,6 +670,7 @@ static uint32_t Directx_ManageDisplay() if(!vidmode && !vo_fs){ if(WinID == -1) { RECT rdw=rd; + if (vo_border) AdjustWindowRect(&rdw,WNDSTYLE,FALSE); // printf("window: %i %i %ix%i\n",rdw.left,rdw.top,rdw.right - rdw.left,rdw.bottom - rdw.top); rdw.left += monitor_rect.left; /* move to global coordinate space */ @@ -1039,7 +1040,7 @@ static int preinit(const char *arg) if (WinID != -1) hWnd = WinID; else hWnd = CreateWindowEx(vidmode?WS_EX_TOPMOST:0, - WNDCLASSNAME_WINDOWED,"",(vidmode)?WS_POPUP:WNDSTYLE, + WNDCLASSNAME_WINDOWED,"",(vidmode || !vo_border)?WS_POPUP:WNDSTYLE, CW_USEDEFAULT, CW_USEDEFAULT, 100, 100,NULL,NULL,hInstance,NULL); wc.hbrBackground = blackbrush; wc.lpszClassName = WNDCLASSNAME_FULLSCREEN; @@ -1295,6 +1296,7 @@ config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uin rd.right = rd.left + d_image_width; rd.bottom = rd.top + d_image_height; if (WinID == -1) { + if (vo_border) AdjustWindowRect(&rd,WNDSTYLE,FALSE); SetWindowPos(hWnd,NULL, vo_dx, vo_dy,rd.right-rd.left,rd.bottom-rd.top,SWP_SHOWWINDOW|SWP_NOOWNERZORDER); } @@ -1449,6 +1451,30 @@ static int control(uint32_t request, void *data, ...) return query_format(*((uint32_t*)data)); case VOCTRL_DRAW_IMAGE: return put_image(data); + case VOCTRL_BORDER: + if(WinID != -1) return VO_TRUE; + if(vidmode) + { + mp_msg(MSGT_VO, MSGL_ERR,"<vo_directx><ERROR>border has no meaning in exclusive mode\n"); + } + else + { + if(vo_border) { + vo_border = 0; + SetWindowLong(hWnd, GWL_STYLE, WS_POPUP); + } else { + vo_border = 1; + SetWindowLong(hWnd, GWL_STYLE, WNDSTYLE); + } + // needed AFAICT to force the window to + // redisplay with the new style. --Joey + if (!vo_fs) { + ShowWindow(hWnd,SW_HIDE); + ShowWindow(hWnd,SW_SHOW); + } + Directx_ManageDisplay(); + } + return VO_TRUE; case VOCTRL_ONTOP: if(WinID != -1) return VO_TRUE; if(vidmode) |