PDA

View Full Version : Available Screen Problem



December
3rd July 2007, 16:11
Hi All,

I am having a problem placing a window just above the taskbar, and detecting if there is a taskbar at the top (normal for Gnome and OSX, not usually on KDE and Windows).

For some reason both..

QApplication::desktop()->screenGeometry() and
QApplication::desktop()->availableGeometry()

..are returning exactly the same, the full size of the screen.

Any ideas what I might be doing wrong?

Thanks

guilugi
3rd July 2007, 16:55
There was a similar thread a while ago :

Don't know if it helps.

http://www.qtcentre.org/forum/f-qt-programming-2/t-how-can-i-get-the-systray-height--6020.html/?highlight=systray

December
4th July 2007, 15:33
Thanks for the post, but what is being suggested in the thread is what I am already doing.

The problem is that availableGeometry is returning exatly the same as screenGeometry.

guilugi
4th July 2007, 16:06
Well, maybe I'm silly on this one, but does QDesktopWidget::availableGeometry() is exactly the same as QApplication::desktop()->availableGeometry() ?

Another (ugly) hint, would be to deduce the systray height from the QSystemTrayIcon geometry (which is available)

My 2 cents..

December
4th July 2007, 16:53
From the documentation:


QDesktopWidget::QDesktopWidget ()

Creates the desktop widget.

If the system supports a virtual desktop, this widget will have the size of the virtual desktop; otherwise this widget will have the size of the primary screen.

Instead of using QDesktopWidget directly, use QApplication::desktop().


This seems to imply the way to use QDesktopWidget is to get it return from QApplication.

A quick test creating a new Desktop widget also had the same result. For some reason it availableGeometry is ignoring any taskbars on the screen totally.

guilugi
4th July 2007, 17:01
Maybe you should suggest something about this feature to Trolls, then ;-)