-
Notifications
You must be signed in to change notification settings - Fork 74
Add "-noborder" launch argument for borderless windowed mode #327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
773404a
to
a0d9145
Compare
a0d9145
to
42e597b
Compare
Co-authored-by: Cody Brittain <[email protected]>
I don't quite understand what this new commandline option is for. In case you want the window to be completely visible, the recently merged PR #541 also addressed that. Would that be good enough? |
@helmutbuhler That PR has no connection to this one. This PR removes the title bar / border that's around the game window. Hence, borderless windowed mode. (I also just noticed that the very corners of the client windows are rounded on windows 11 when borders are present, gross lol) |
What is the benefit of no border? |
....huh? Borderless windowed mode is a pretty standard feature in like 99% of modern games. It's entirely a personal preference/asthetic option, as a large number of folks hate seeing brightly colored title bars. This does not change the default behavior, it just adds a command line option to enable the option. |
I seriously hope you’re joking. |
This is not adding a true "Borderless window" mode as the game does not properly support that and it needs to be added internally. The game needs to support scaling the rendering output within the window based on the chosen resolution etc. With the recent window centering fix, if you run the game in a window and with your resolution matching the desktop it will remove the window borders and fill the screen. This mostly replicates borderless window and allows easy window switching. |
Do you mean Windowed Fullscreen Mode? If this PR is trying to accomplish that, it needs quite a bit of work.
I don't understand this either. |
That is not what I mean, no. Windowed borderless is not the same thing as windowed fullscreen mode, those are two different things.
Age of Chivalry, Alien Swarm, Aperture Tag, Apex Legends, Black Mesa, Blade Symphony, Bloody Good Time, Coastline to Atmosphere, Consortium, Contagion, Counter-Strike: Global Offensive, Counter-Strike: Malvinas, Counter-Strike: Online 2, Counter-Strike: Source, Dark Messiah of Might and Magic, Day of Defeat: Source, Day of Infamy, Deadlock, Dear Esther, Dino D-Day, Dota 2, Dystopia, E.Y.E.: Divine Cybermancy, Empires, Entropy: Zero, Entropy: Zero 2, Eternal Silence, Fistful of Frags, Flipside, Fortress Forever, G String, Garry's Mod, GoldenEye: Source, Half-Life 2, Half-Life 2: Capture the Flag, Half-Life 2: Deathmatch, Half-Life 2: Episode One, Half-Life 2: Episode Two, Half-Life 2: Lost Coast, Half-Life Deathmatch: Source, Half-Life: Source, Hunt Down the Freeman, Hybrid, Infra, Insurgency, Insurgency: Modern Infantry Combat, Iron Grip: The Oppression, JBMod, Jabroni Brawl, Jailbreak Source, Jurassic Life, Klaus Veen's Treason, Korsakovia, Left 4 Dead, Left 4 Dead 2, Mario Kart: Source, Minerva, Multiplayer mods, NeoTokyo, Nightmare House 2, No More Room in Hell, Nuclear Dawn, Operation Black Mesa, Perfect Dark: Source, Pirates, Vikings and Knights II, Portal, Portal 2, Portal Reloaded, Portal Stories: Mel, Portal: Prelude, Portal: Revolution, Postal III, Prospekt, Research and Development, Rexaura, Riot Act, SiN Episodes, SourceForts, Swelter, Synergy, Tactical Intervention, Team Fortress 2, Team Fortress 2 Classic, Terminal 7, The Beginner's Guide, The Hidden, The Ship, The Stanley Parable, Thinking with Time Machine, Titan: XCIX, Titanfall, Titanfall 2, Vampire: The Masquerade – Bloodlines, Vindictus, Zeno Clash, and Zombie Panic! Source -all- support this functionality with the exact same |
@@ -75,6 +75,7 @@ | |||
HINSTANCE ApplicationHInstance = NULL; ///< our application instance | |||
HWND ApplicationHWnd = NULL; ///< our application window handle | |||
Bool ApplicationIsWindowed = false; | |||
Bool ApplicationIsBorderless = false; // TheSuperHackers @feature @ShizCalev 04/04/2025 - Borderless Windowed support |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ShizCalev
@@ -674,7 +675,8 @@ static Bool initializeAppWindows( HINSTANCE hInstance, Int nCmdShow, Bool runWin | |||
// Create our main window | |||
windowStyle = WS_POPUP|WS_VISIBLE; | |||
if (runWindowed) | |||
windowStyle |= WS_DLGFRAME | WS_CAPTION | WS_SYSMENU; | |||
if(!ApplicationIsBorderless) | |||
windowStyle |= WS_DLGFRAME | WS_CAPTION | WS_SYSMENU; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No WS_SYSMENU when ApplicationIsBorderless ? Fullscreen has WS_SYSMENU.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... Source -all- support this functionality with the exact same
-noborder -windowed
(or some variant thereof) launch parameter.
So, what is this Multiplayer mods
game that you listed there? ;)
You could have just said that the Source-Engine has this option and a bunch of games inherit that option from there. So I'm still not convinced this option is that useful, but if you are this invested in it I guess we can take it in.
@@ -926,6 +928,8 @@ Int APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, | |||
//added a preparse step for this flag because it affects window creation style | |||
if (stricmp(token,"-win")==0) | |||
ApplicationIsWindowed=true; | |||
if(stricmp(token,"-noborder")==0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add this in CommandLine.cpp as well, just as a dummy or comment? Reason being that if someone wants to know which options are available, that is the place to look.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a side note: I think it would be neat to implement a logging that prints out all possible arguments when launching it on the command line. In some future change.
@@ -901,6 +903,8 @@ Int APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, | |||
//added a preparse step for this flag because it affects window creation style | |||
if (stricmp(token,"-win")==0) | |||
ApplicationIsWindowed=true; | |||
if(stricmp(token,"-noborder")==0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (
:)
@@ -926,6 +928,8 @@ Int APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, | |||
//added a preparse step for this flag because it affects window creation style | |||
if (stricmp(token,"-win")==0) | |||
ApplicationIsWindowed=true; | |||
if(stricmp(token,"-noborder")==0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a side note: I think it would be neat to implement a logging that prints out all possible arguments when launching it on the command line. In some future change.
WS_POPUP|WS_VISIBLE being the only flags = noborder.
Currently set to only trigger if both
-win
&-noborder
are set as launch params, can simplify it down to just one of that's preferred.