Skip to content

Add support for borderless Windows#1890

Open
Flamefire wants to merge 3 commits intoReturn-To-The-Roots:masterfrom
Flamefire:lock-window-size
Open

Add support for borderless Windows#1890
Flamefire wants to merge 3 commits intoReturn-To-The-Roots:masterfrom
Flamefire:lock-window-size

Conversation

@Flamefire
Copy link
Member

Continuation of #1602 to add a 3rd mode:

  • Fullscreen
  • Windowed
  • Borderless window

This removes the whole window frame making it non-resizeable:

{779ACE15-30E1-4978-87E3-6A30D3AC59D7}

Closes #1602 Fixes #1512

In the options screen I added a similar drop-down.

As an extension I would change "Fullscreen resolution" to "Window size" when selecting a windowed option in both settings. There all resolution options and the current window size will be added. Shall I? @Spikeone

Add a hidden setting to control whether the window is resizable.

Fixes Return-To-The-Roots#1512
Change the bitset to an enum with 3 modes for Fullscreen and window with
and without border.
Implement those modes in both VideoDrivers.

Fixes Return-To-The-Roots#1512
Check correct type and avoid clang-tidy trying to "simplify" the
resulting boolean condition, i.e.
>  warning: boolean expression can be simplified by DeMorgan's theorem [readability-simplify-boolean-expr]
@Spikeone
Copy link
Member

Sounds good to me - just some question, I never thought about borderless window (Although this is probably what I'd like to have anyway) but wouldn't this be somewhat confusing for people since most would think its fullscreen windowed (as most modern game name it) but we don't have such option at all?

@Flamefire
Copy link
Member Author

My concern is rather: Without a title bar you cannot move it and it will always be centered. Not sure this suits everyone but you can't have that anyway.

fullscreen windowed (as most modern game name it) but we don't have such option at all?

The closest would be to set the size accordingly.
Additionally, if fullscreen isn't possible I implemented a fallback to a fullscreen, borderless window

That being said we can add a 4th option "Fullscreen windowed" (or maybe "windowed fullscreen" or "fullscreen window"?) to automatically set the size to the desktop size. IIRC SDL has even a flag for that, something called FULLSCREEN_DESKTOP or so.

@Spikeone
Copy link
Member

Oh, so the borderless window is the one that is not resizable? I honestly thought we'd just ignore the resize event and add an option to ignore that event

@Flamefire
Copy link
Member Author

Having no border makes it clear that the window cannot be resized as there is nothing to do that.
For the normal window we actually set a flag to make it resizable. The original PR #1602 was using a bitset so we can represent that in our settings too. Downside of course are some combinations like "resizable fullscreen" make no sense. I'd ignore that though.

I see it rather as an UI issue: Now we have 3 clear display modes. How/Where would be disable window resizing? Or shall we have a "fixed size window" option there?

@Spikeone
Copy link
Member

Well, what I was thinking about in general:

  • Fullscreen
  • Fullscreen Borderless Windowed
  • Windowed

Those are the 3 modes I'd expect. Then I'd just love to have an additional option to:

  • Enable / Disable Resize window

Which would only apply to windowed mode. I still want to move the window around, but I don't want to resize it by accident. That was my initial intention when I asked @falbrechtskirchinger for this :)

@Flamefire
Copy link
Member Author

Hm, back to a bitset for the option then:

  • Fullscreen
  • Windowed
  • Resizeable

Fullscreen | Windowed would then be a borderless window and Resizeable only specifically handled for non-Fullscreen, ignoring it for fullscreen option

@Spikeone
Copy link
Member

Hm, back to a bitset for the option then:

* Fullscreen

* Windowed

* Resizeable

Fullscreen | Windowed would then be a borderless window and Resizeable only specifically handled for non-Fullscreen, ignoring it for fullscreen option

If I don't missunderstand this - yes. (Honestly, as long as I can play windowed, move the window and prevent it from resizing by accident, I'm happy)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lock window size

3 participants

Comments