Skip to content

Feat/fullscreen getters#838

Merged
Osspial merged 7 commits intorust-windowing:masterfrom
acheronfail:feat/fullscreen-getters
Apr 25, 2019
Merged

Feat/fullscreen getters#838
Osspial merged 7 commits intorust-windowing:masterfrom
acheronfail:feat/fullscreen-getters

Conversation

@acheronfail
Copy link
Copy Markdown
Contributor

@acheronfail acheronfail commented Apr 12, 2019

This change adds the window.get_fullscreen() method - this is useful for many reasons and makes using this library much easier.

It also adds a get_simple_fullscreen() method to the macos WindowExt as well, so macos users can distinguish which type of fullscreen mode is currently active.

I've tested this on the following platforms:

  • macOS
  • Linux (X11)
  • Windows 10

Closes #579

@rukai
Copy link
Copy Markdown
Contributor

rukai commented Apr 12, 2019

Related issue: #579

Thanks for doing this.

Copy link
Copy Markdown
Contributor

@Osspial Osspial left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, and thanks for the PR!

One design question - if we're going to be exposing the API, is there any technical reason we can't expose it as get_fullscreen() -> Option<MonitorId>? That exposes more information than just returning bool, and also makes the type signature symmetrical with set_fullscreen(Option<MonitorId>).

Other than that, the code changes look good on the Windows end.

@acheronfail
Copy link
Copy Markdown
Contributor Author

acheronfail commented Apr 14, 2019

One design question - if we're going to be exposing the API, is there any technical reason we can't expose it as get_fullscreen() -> Option<MonitorId>?

Good idea, originally I made it a bool since macOS has two fullscreen modes (one of them doesn't use a MonitorId). But, that doesn't apply since macOS users can just use the WindowExt in order to test for the other fullscreen mode anyway.

I've updated get_fullscreen to return an Option<MonitorId> now. 😄

@Osspial Osspial merged commit 4469f29 into rust-windowing:master Apr 25, 2019
@acheronfail acheronfail deleted the feat/fullscreen-getters branch April 27, 2019 07:24
elinorbgr pushed a commit to elinorbgr/winit that referenced this pull request Apr 27, 2019
* feat: [macos] add get_fullscreen and get_simple_fullscreen

* feat: [windows] add get_fullscreen

* feat: [ios] add get_fullscreen

* feat: [android] add get_fullscreen

* feat: [emscripten] add get_fullscreen

* feat: [linux] add get_fullscreen

* feedback: `get_fullscreen() -> bool` -> `get_fullscreen() -> Option<Id>`
elinorbgr pushed a commit to elinorbgr/winit that referenced this pull request Apr 27, 2019
* feat: [macos] add get_fullscreen and get_simple_fullscreen

* feat: [windows] add get_fullscreen

* feat: [ios] add get_fullscreen

* feat: [android] add get_fullscreen

* feat: [emscripten] add get_fullscreen

* feat: [linux] add get_fullscreen

* feedback: `get_fullscreen() -> bool` -> `get_fullscreen() -> Option<Id>`
felixrabe pushed a commit to felixrabe/winit that referenced this pull request Jun 30, 2019
* feat: [macos] add get_fullscreen and get_simple_fullscreen

* feat: [windows] add get_fullscreen

* feat: [ios] add get_fullscreen

* feat: [android] add get_fullscreen

* feat: [emscripten] add get_fullscreen

* feat: [linux] add get_fullscreen

* feedback: `get_fullscreen() -> bool` -> `get_fullscreen() -> Option<Id>`

AND: Fix macos compile error in fullscreen example (rust-windowing#885)
kosyak pushed a commit to kosyak/winit that referenced this pull request Jul 10, 2019
* feat: [macos] add get_fullscreen and get_simple_fullscreen

* feat: [windows] add get_fullscreen

* feat: [ios] add get_fullscreen

* feat: [android] add get_fullscreen

* feat: [emscripten] add get_fullscreen

* feat: [linux] add get_fullscreen

* feedback: `get_fullscreen() -> bool` -> `get_fullscreen() -> Option<Id>`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Add Window::get_fullscreen() -> bool

5 participants