Skip to content

FE/Qt: Place the full-screen mini-toolbar on the machine window's monitor - #843

Open
dr1fter wants to merge 1 commit into
VirtualBox:mainfrom
dr1fter:842-fullscreen-minitoolbar-screen
Open

FE/Qt: Place the full-screen mini-toolbar on the machine window's monitor#843
dr1fter wants to merge 1 commit into
VirtualBox:mainfrom
dr1fter:842-fullscreen-minitoolbar-screen

Conversation

@dr1fter

@dr1fter dr1fter commented Aug 30, 2026

Copy link
Copy Markdown

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 manager
treats 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.log records Move mini-toolbar for window #0 to 0x0.

Cause

UIMiniToolBar::sltAdjust() resolved its host screen with
UIDesktopWidgetWatchdog::screenNumber(m_pParent), which goes through
m_pParent->windowHandle()->screen(). During the full-screen transition that
native 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
WORKAROUND comment just below handles screenNumber() returning -1.

Change

Resolve the screen from the parent's geometry instead, using the existing
screenNumber(const QPoint &) overload. 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.

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.

stock patched
logged tool-bar move 0x0 1920x0
tool-bar window position 3840,0 1920,0
machine window position 1920,0 1920,0
host monitors full-screen two one
unrelated desktop panel not painted painted

To 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=false makes it return, confirming which window is
responsible.

…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>
@oracle-contributor-agreement

Copy link
Copy Markdown

Thank you for your pull request and welcome to our community! To contribute, please sign the Oracle Contributor Agreement (OCA).
The following contributors of this PR have not signed the 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.

@oracle-contributor-agreement oracle-contributor-agreement Bot added the OCA Required At least one contributor does not have an approved Oracle Contributor Agreement. label Aug 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Required At least one contributor does not have an approved Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Fullscreen mini-toolbar placed on the wrong host monitor, hiding desktop panels there

1 participant