rust-windowing / rust-windowing/winit

Add support for setting 'Exclusive' full screen when clicking on maximise

Open
#1,675 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C - needs discussion DS - appkit
Dominant language
Rust
Stars
6.2k
Forks
1.3k
Avg merge
2d 19h
Merged PRs (30d)
9

Description

Hello,

I'm currently working on a game that runs much better in exclusive full screen mode. I think this is because the framebuffer doesn't need to be copied and re-scaled to match the DPI settings of the monitor.

Anyway, I see that fullscreen was added in this pull request. There are two ways to interact with it:

  1. You can use WindowBuilder::with_fullscreen to set exclusive mode when the window is first created
  2. You can call Window::set_fullscreen to toggle it later

What I really want is for the game to first launch normally in a window, but then if the user clicks on maximise it enters exclusive full screen mode. I can't see that there's a way to do this?

Currently I'm using winit version 0.21.0 on macOS Catalina 10.15.6. The native resolution of my display is 2560x1600 and with DPI scaling this is reported as 2880x1800. This is what I mean by the 'maximise' button:

Screenshot 2020-08-23 at 16 04 50

I could try to detect when this has happened by checking window.inner_size() after a resize event and comparing that to the monitor's video modes but this seems like it might be brittle.

Would it be possible to add a setting that's something like...

WindowBuilder::set_maximise_behaviour(...)

...that allows me to configure how that button should be handled? Perhaps it could fall back to the default behaviour on platforms that don't support exclusive full screen mode?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing WindowBuilder::with_fullscreen and Window::set_fullscreen, including their platform-specific behavior and the existing maximise handling. Determine how the maximise button is represented across supported platforms and define the fallback behavior; done means the requested setting reliably selects exclusive fullscreen where supported without changing default behavior elsewhere.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
desktop, operating-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.