google / flutter-desktop-embedding

Experimental plugins for Flutter for Desktop
Apache License 2.0
7.1k stars 604 forks source link

Added enterFullscreen & exitFullscreen methods for Windows & Linux #859

Closed alexmercerind closed 2 years ago

alexmercerind commented 3 years ago

Added enterFullscreen & exitFullscreen to enter and exit seamless fullscreen mode (without titlebar).

Usage

Demo

https://user-images.githubusercontent.com/28951144/121733126-b6b28480-cb10-11eb-9708-b5ac73d3a7ff.mp4

google-cla[bot] commented 3 years ago

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

:memo: Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

alexmercerind commented 3 years ago

@googlebot I signed it!

alexmercerind commented 3 years ago

I can try to add Linux support aswell.

alexmercerind commented 3 years ago

Added Linux support aswell. Looking forward for any requested changes to get this merged.

Thankyou.

alexmercerind commented 3 years ago

Now I've followed Google code style precisely.

Now exitFullscreen no longer requires frame parameter and window restores to initial size now after exiting fullscreen.

On windows, there isn't a specific API to use for fullscreen like GTK, so I had to do that. Now I made it store initial window frame as RECT globally before going fullscreen and restore window to that frame upon exiting from fullscreen mode. As a result, I also improved the Windows implementation by using this example.

alexmercerind commented 3 years ago

@stuartmorgan what do i do now? 😖

stuartmorgan commented 3 years ago

@alexmercerind What do you do about what? I'm not sure what the question is.

bdlukaa commented 3 years ago

Any chance of this getting merged soon?

stuartmorgan commented 3 years ago

I need to have time to review it before it can be merged. If you can't wait until that has happened, you can use the PR's branch.

sabin26 commented 3 years ago

@alexmercerind When windows button is pressed from keyboard to access the Taskbar after entering full screen, I am unable to view other applications after opening them from the taskbar. The flutter window stays on top of other windows. So, only flutter window is on the front view. Please have a look at it.

stuartmorgan commented 3 years ago

Just wanted to update to say that I haven't forgotten about this, I'm just balancing a lot of priorities, and context switching to two platforms I'm no longer regularly using requires a significant time investment.

/cc @robert-ancell and @clarkezone in case you have time to review your respective platforms of expertise here.

stuartmorgan commented 2 years ago

I apologize that this PR has been in limbo for so long.

After recently taking stock of all of the work across desktop and plugins in general, it's clear that expanding the scope of window_size with additional functionality isn't the best use of the Flutter team's resources, so I've updated the plugin's README to lay out the new, more restricted plan for the scope of the plugin. (The long delay on this PR demonstrates the problem with leaving an open-ended scope for a plugin that is in practice very low priority relative to all of the other work.)

Given that new scope, I'm going to close this PR. I encourage you to create a new plugin for this purpose, or to submit it to an existing community-developed window manipulation plugin.

(I understand that it may seem strange not to take an already-written PR based on resourcing considerations, but there is still non-trivial cost in taking the PR; in addition to review, there would undoubtedly be follow-up issues due to interaction with other parts of the API, edge cases with OS behaviors, etc., since full-screen is inherently complex. Having that in a plugin that will get the resources needed to maintain it more actively than we can currently maintain window_size will be a better experience for everyone.)