[MPlayer-dev-eng] [PATCH][RFC] runtime toggle for borderless window
Reimar Döffinger
Reimar.Doeffinger at stud.uni-karlsruhe.de
Fri Sep 2 00:23:21 CEST 2005
Hi,
On Thu, Sep 01, 2005 at 04:33:37PM -0500, Joey Parrish wrote:
> Attached is a patch to toggle the window decorations on and off.
> Comes from another feature request from my users. Includes
> documentation, and the vo_directx implementation of this vo ctrl.
Can you implement it for w32_common.c, too?
> #define WNDCLASSNAME_WINDOWED "MPlayer - The Movie Player"
> #define WNDCLASSNAME_FULLSCREEN "MPlayer - Fullscreen"
> +#define WINDOW_STYLE (WS_OVERLAPPEDWINDOW|WS_SIZEBOX)
IMHO this is obfuscating, and an unrelated (cosmetic?) change.
> + if(vo_border) {
> + vo_border = 0;
> + SetWindowLong(hWnd, GWL_STYLE, WS_POPUP);
> + } else {
> + vo_border = 1;
> + SetWindowLong(hWnd, GWL_STYLE, WINDOW_STYLE);
> + }
Hmm. may I suggest
vo_border = !vo_border;
SetWindowLong(hWnd, GWL_STYLE, vo_border?...:WS_POPUP);
Of course this is a matter of taste :-)
> + if (!vo_fs) {
> + ShowWindow(hWnd,SW_HIDE);
> + ShowWindow(hWnd,SW_SHOW);
> + }
> + Directx_ManageDisplay();
Is that needed? I seem to remember that this function is quite slow, and
I hate when toggling things causes (short) hangs.
Greetings,
Reimar Döffinger
More information about the MPlayer-dev-eng
mailing list