c++qtuser-interfaceqt3

Available screen size on Linux in Qt 3


QDesktopWidget * screen = QApplication::desktop();
QRect size = screen->availableGeometry(this);

The documentation says,

What is available will be subrect of screenGeometry() based on what the platform decides is available (for example excludes the Dock and Menubar on Mac OS X, or the taskbar on Windows).

What I want to know is how can I get the available screen geometry (without panels) on Linux? I tried above code on Linux, but it returns physical screen size.


Solution

  • For most of the cases availableGeometry() works. I'm using virtual screen. Sometimes it doesn't work properly.