Skip to content

servoshell: Use Window.current_monitor() in HeadedWindow.set_fullscreen to show fullscreen on current window - #45556

Merged
jdm merged 2 commits into
servo:mainfrom
rhventures:rhit-kapilaar/full-screen-on-multiple-screens
Jun 12, 2026
Merged

servoshell: Use Window.current_monitor() in HeadedWindow.set_fullscreen to show fullscreen on current window#45556
jdm merged 2 commits into
servo:mainfrom
rhventures:rhit-kapilaar/full-screen-on-multiple-screens

Conversation

@rhit-kapilaar

Copy link
Copy Markdown
Contributor

To ensure the servoshell window is rendered in fullscreen in current active screen, we need to get the current monitor
on runtime every time set_fullscreen is run. However, currently it uses the 'monitor' field of HeadedWindow struct which was just defined once at app startup. This prevents servoshell running on fullscreen on other monitors apart from the one at start. This change removes the monitor field from HeadedWindow and uses Window.current_monitor() in set_fullscreen function to get the current monitor at runtime and then display window on fullscreen on that monitor.

Testing: Although I am not fully certain, since this is just a small fix for servoshell, it doesn't require any additional testing methods since there aren't any tests for servoshell.

Fixes: #45488

@rhit-kapilaar
rhit-kapilaar requested a review from atbrakhi as a code owner June 10, 2026 14:24
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Jun 10, 2026

@yezhizhen yezhizhen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks reasonable.

@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Jun 12, 2026
@jdm jdm added the S-fails-tidy `./mach test-tidy` reported errors. label Jun 12, 2026
Signed-off-by: rhit-kapilaar <kapilaar@rose-hulman.edu>
Signed-off-by: rhit-kapilaar <kapilaar@rose-hulman.edu>
@rhit-kapilaar
rhit-kapilaar force-pushed the rhit-kapilaar/full-screen-on-multiple-screens branch from db1beea to f1acf71 Compare June 12, 2026 12:29
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Jun 12, 2026
@jdm
jdm enabled auto-merge June 12, 2026 12:31
@jdm
jdm added this pull request to the merge queue Jun 12, 2026
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Jun 12, 2026
Merged via the queue into servo:main with commit 4f4fdf7 Jun 12, 2026
34 checks passed
@servo-highfive servo-highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Jun 12, 2026
@rhit-kapilaar
rhit-kapilaar deleted the rhit-kapilaar/full-screen-on-multiple-screens branch June 12, 2026 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-awaiting-review There is new code that needs to be reviewed. S-fails-tidy `./mach test-tidy` reported errors.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fullscreen Mode makes servoshell window dissapear on other screens

4 participants