FE/Qt: Place the full-screen mini-toolbar on the machine window's monitor - #843
Open
dr1fter wants to merge 1 commit into
Open
FE/Qt: Place the full-screen mini-toolbar on the machine window's monitor#843dr1fter wants to merge 1 commit into
dr1fter wants to merge 1 commit into
Conversation
…itor UIMiniToolBar::sltAdjust() resolved its host screen via UIDesktopWidgetWatchdog::screenNumber(m_pParent), which goes through m_pParent->windowHandle()->screen(). During a full-screen transition that native screen association can still lag behind the geometry already assigned to the top-level widget by UIMachineWindowFullscreen::placeOnScreen(), so the tool-bar is sized and placed against the wrong monitor. Because the mini-tool-bar's outer window is screen-sized and full-screen, the window manager then considers that unrelated monitor to hold a full-screen window, and desktop panels on it stop being painted for as long as the VM runs. Resolve the screen from the parent's geometry instead. sltAdjust() is queued from the parent's show event, i.e. after placeOnScreen() has moved the parent, so its geometry is authoritative at that point. Fixes: VirtualBox#842 Signed-off-by: Christian Cwienk <ccwienk@dr1fter.de>
|
Thank you for your pull request and welcome to our community! To contribute, please sign the Oracle Contributor Agreement (OCA).
To sign the OCA, please create an Oracle account and sign the OCA in Oracle's Contributor Agreement Application. When signing the OCA, please provide your GitHub username. After signing the OCA and getting an OCA approval from Oracle, this PR will be automatically updated. If you are an Oracle employee, please make sure that you are a member of the main Oracle GitHub organization, and your membership in this organization is public. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #842.
Problem
In full-screen mode the mini-tool-bar's outer window can be placed on a
different host monitor than the machine window it belongs to. That window is
screen-sized and carries
_NET_WM_STATE_FULLSCREEN, so the window managertreats the unrelated monitor as holding a full-screen window and desktop panels
on it stop being painted for as long as the VM runs.
Observed with one guest screen on a three-monitor X11 host: the machine window
is correctly on DP-2 (+1920+0) while the tool-bar lands on DP-4 (+3840+0), and
VBox.logrecordsMove mini-toolbar for window #0 to 0x0.Cause
UIMiniToolBar::sltAdjust()resolved its host screen withUIDesktopWidgetWatchdog::screenNumber(m_pParent), which goes throughm_pParent->windowHandle()->screen(). During the full-screen transition thatnative association can still lag behind the geometry already assigned to the
top-level widget by
UIMachineWindowFullscreen::placeOnScreen().The surrounding code already treats this area as racy — the existing
WORKAROUNDcomment just below handlesscreenNumber()returning -1.Change
Resolve the screen from the parent's geometry instead, using the existing
screenNumber(const QPoint &)overload.sltAdjust()is queued from theparent's show event, i.e. after
placeOnScreen()has moved the parent, so itsgeometry is authoritative at that point.
Validation
Arch Linux, X11, Cinnamon 6.6.9/Muffin 6.6.3, three 1920x1200 monitors,
VirtualBox 7.2.16, Qt 6.11.2. Guest with
monitorcount=1,GUI/Fullscreen=true, mini-tool-bar enabled.0x01920x03840,01920,01920,01920,0To reproduce without the patch: start a single-screen guest full-screen on a
multi-monitor host where Qt's screen order differs from the window manager's,
and observe the panel on another monitor stop being drawn. Setting
GUI/ShowMiniToolBar=falsemakes it return, confirming which window isresponsible.