I'm building the UI for an application using Qt and QML for Ubuntu Linux. I have a viewer window with a canvas element which is supposed to be fullscreen by default. On opening the application this works fine (i.e. Ubuntu sidebar and top taskbar are hidden). However, once I minimize my application and then maximize it again by using viewer->setFullScreen();
, the Ubuntu sidebar and top taskbar are still visible and there is an offset while writing on the canvas due to the same.
Any help would be appreciated.
According to this topic on askubuntu, your problem do really looks like Unity bug (or feature). But, according to somehow related bug on Launchpad, it seems that you can get desired behavior by:
Turn "Always On Top" on via right-clicking the titlebar of your window, before making it go fullscreen. This will prevent the Unity panel from rendering on top of this fullscreen-window, when using the other screen.
In Qt you can set Qt::WindowStaysOnTopHint
to your window/widget via QWidget::windowFlags
.
Pay additional attention to notes in official documentation:
setParent()
when changing the flags for a window, causing the widget to be hidden. You must call show()
to make the widget visible again.Qt::WindowStaysOnTopHint
-- Informs the window system that the window should stay on top of all other windows. Note that on some window managers on X11 you also have to pass Qt::X11BypassWindowManagerHint
for this flag to work correctly.Hope this helps.