Skip to content

Commit

Permalink
Changed Win32: When running in windowed mode, use the dimensions of t…
Browse files Browse the repository at this point in the history
…he virtual desktop for window position and sizing purposes (formerly the dimensions of the primary display).

Added Win32: Command line option "-noframe": used in combination with "-wnd"/"-window" to obtain fullscreen-like window behavior (useful for configuring multi-monitor setups).
  • Loading branch information
danij-deng committed May 7, 2010
1 parent 4a65795 commit 613820b
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions doomsday/engine/win32/src/sys_window.c
Expand Up @@ -3,8 +3,8 @@
* License: GPL
* Online License Link: http://www.gnu.org/licenses/gpl.html
*
*\author Copyright © 2003-2008 Jaakko Keränen <jaakko.keranen@iki.fi>
*\author Copyright © 2005-2009 Daniel Swanson <danij@dengine.net>
*\author Copyright © 2003-2010 Jaakko Keränen <jaakko.keranen@iki.fi>
*\author Copyright © 2005-2010 Daniel Swanson <danij@dengine.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -993,6 +993,7 @@ static boolean setDDWindow(ddwindow_t *window, int newX, int newY,
boolean noMove = (uFlags & DDSW_NOMOVE);
boolean noSize = (uFlags & DDSW_NOSIZE);
boolean inControlPanel = false;
boolean noFrame;

if(uFlags & DDSW_NOCHANGES)
return true; // Nothing to do.
Expand All @@ -1005,6 +1006,7 @@ static boolean setDDWindow(ddwindow_t *window, int newX, int newY,
height = window->height;
bpp = window->normal.bpp;
flags = window->flags;
noFrame = ArgCheck("-noframe");
// Force update on init?
if(!window->inited && window->type == WT_NORMAL)
{
Expand Down Expand Up @@ -1104,8 +1106,8 @@ static boolean setDDWindow(ddwindow_t *window, int newX, int newY,
{
if(flags & DDWF_CENTER)
{ // Auto centering mode.
x = (GetSystemMetrics(SM_CXSCREEN) - width) / 2;
y = (GetSystemMetrics(SM_CYSCREEN) - height) / 2;
x = (GetSystemMetrics(SM_CXVIRTUALSCREEN) - width) / 2;
y = (GetSystemMetrics(SM_CYVIRTUALSCREEN) - height) / 2;
}
else if(x != newX || y != newY)
{
Expand All @@ -1114,11 +1116,11 @@ static boolean setDDWindow(ddwindow_t *window, int newX, int newY,
}

// Are we in range here?
if(width > GetSystemMetrics(SM_CXSCREEN))
width = GetSystemMetrics(SM_CXSCREEN);
if(width > GetSystemMetrics(SM_CXVIRTUALSCREEN))
width = GetSystemMetrics(SM_CXVIRTUALSCREEN);

if(height > GetSystemMetrics(SM_CYSCREEN))
height = GetSystemMetrics(SM_CYSCREEN);
if(height > GetSystemMetrics(SM_CYVIRTUALSCREEN))
height = GetSystemMetrics(SM_CYVIRTUALSCREEN);
}

// Change visibility?
Expand Down Expand Up @@ -1149,15 +1151,15 @@ static boolean setDDWindow(ddwindow_t *window, int newX, int newY,
{ // We need to request changes to the window style.
LONG style;

if(flags & DDWF_FULLSCREEN)
if((flags & DDWF_FULLSCREEN) || noFrame)
style = FULLSCREENSTYLE;
else
style = WINDOWEDSTYLE;

SetWindowLong(hWnd, GWL_STYLE, style);
}

if(!(flags & DDWF_FULLSCREEN))
if(!(flags & DDWF_FULLSCREEN) && !noFrame)
{ // We need to have a large enough client area.
RECT rect;

Expand Down

0 comments on commit 613820b

Please sign in to comment.