[MPlayer-dev-eng] [PATCH][RFC] runtime toggle for borderless window

Joey Parrish joey at nicewarrior.org
Sat Sep 3 03:05:46 CEST 2005


On Fri, Sep 02, 2005 at 12:23:21AM +0200, Reimar Döffinger wrote:
> 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?

Quite possibly.  I'll get back to you on that.

> >  #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.

No.  The window style is being used more often in the new code, so
moving the style definition to a macro will help keep sync in the
future.  If we need to change the default style, we now only change it
in one place.

> > +				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 :-)

I could.  The patch keeps consistency with the original directx code by
Sascha, IIRC.

> > +				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.

Yes.  ManageDisplay does the adjustment of the window size and location.
This changes when you turn decorations on or off.

--Joey

-- 
"I know Kung Fu." --Darth Vader




More information about the MPlayer-dev-eng mailing list