Skip to content
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

servoshell: add fullscreen option #30614

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

MarybethGasman
Copy link

These changes add a cli option to start servo in fullscreen mode. As requested in #30599.
It is currently in draft form as we need to have further discussions to determine whether we truly need it.

servo --fullscreen

No tests for now.

@MarybethGasman MarybethGasman marked this pull request as ready for review October 27, 2023 06:13
@mrobinson mrobinson requested a review from delan October 30, 2023 14:39
@delan delan added the T-windows Do a try run on Windows label Nov 13, 2023
@github-actions github-actions bot removed the T-windows Do a try run on Windows label Nov 13, 2023
Copy link

🔨 Triggering try run (#6846095678) with platforms=windows and layout=none

Copy link
Sponsor Member

@delan delan left a comment

Choose a reason for hiding this comment

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

Thanks for the patch!

I think fullscreen generally means not having any window decorations, not just maximised. We should also return whether we started in fullscreen in the Window.fullscreen of our return value.

You can use WindowBuilder::with_fullscreen or winit Window::set_fullscreen for this, or even better, call .set_fullscreen(true) on our headed Window before returning it.

Copy link

✨ Try run (#6846095678) succeeded.

@MarybethGasman
Copy link
Author

Appreciate your advice.
I call set_fullscreen on our headed Window before returning it.

It works as expected when launching.
image

When I refresh page, the web content seems not displayed in fullscreen mode.
image

And I can't exit fullscreen mode or servo by Esc.

The Esc problem is because fullscreen is a whatwg web api.
It will do nothing if there is no fullscreen element in the document.
So I change the code to always Send EmbedderMsg first.

The web content not in fullscreen problem is solved by call .with_maximized on the window builder.
I have no idea why.
Am I missing something?

@@ -139,7 +142,7 @@ impl Window {
.expect("Failed to create WR surfman");

debug!("Created window {:?}", winit_window.id());
Window {
let window = Window {
Copy link
Contributor

Choose a reason for hiding this comment

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

why this is needed?

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.

None yet

4 participants