Determining which screen a full screen window is on

View: New views
3 Messages — Rating Filter:   Alert me  

Determining which screen a full screen window is on

by Bugzilla from djarvie@kde.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On a multi-head system, is there any easy way to determine which screen a
random full-screen window resides on?

QDesktopWidget is the only Qt/KDE class I can find which gives
multi-screen information, but it only returns the screen number for a
QWidget or a QPoint. I need to be able to find this information for ANY
full-screen window - not just Qt ones - so the QWidget variant is no use.
And KWindowInfo::geometry() and KWindowInfo::frameGeometry() both return a
null QRect for a full screen window, so the QPoint variant doesn't work
either.

Are there any other library functions to give this information? I could
cobble something together based on how QDesktopWidget works, but it's not
ideal for maintainability, and could be fraught from the cross-platform
perspective also.

--
David Jarvie.
KDE developer.
KAlarm author & maintainer.
http://www.astrojar.org.uk/kalarm

 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<

Re: Determining which screen a full screen window is on

by Bugzilla from mpyne@kde.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tuesday 03 November 2009 09:39:05 David Jarvie wrote:

> On a multi-head system, is there any easy way to determine which screen a
> random full-screen window resides on?
>
> QDesktopWidget is the only Qt/KDE class I can find which gives
> multi-screen information, but it only returns the screen number for a
> QWidget or a QPoint. I need to be able to find this information for ANY
> full-screen window - not just Qt ones - so the QWidget variant is no use.
> And KWindowInfo::geometry() and KWindowInfo::frameGeometry() both return a
> null QRect for a full screen window, so the QPoint variant doesn't work
> either.
>
> Are there any other library functions to give this information? I could
> cobble something together based on how QDesktopWidget works, but it's not
> ideal for maintainability, and could be fraught from the cross-platform
> perspective also.
The NET series in kdelibs might be what you want.  (Like NET::WinInfo, etc.)

The API docs are hard to find though, you may have to Google it. :-/

Regards,
 - Michael Pyne


 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<

signature.asc (853 bytes) Download Attachment

Re: Determining which screen a full screen window is on

by Lubos Lunak :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tuesday 03 of November 2009, David Jarvie wrote:

> On a multi-head system, is there any easy way to determine which screen a
> random full-screen window resides on?
>
> QDesktopWidget is the only Qt/KDE class I can find which gives
> multi-screen information, but it only returns the screen number for a
> QWidget or a QPoint. I need to be able to find this information for ANY
> full-screen window - not just Qt ones - so the QWidget variant is no use.
> And KWindowInfo::geometry() and KWindowInfo::frameGeometry() both return a
> null QRect for a full screen window, so the QPoint variant doesn't work
> either.

 Then those KWindowInfo functions have a bug, which I consider a bit unlikely,
or you are doing something wrong. Presumably you just need to watch the
kWarning() on stderr and do what it says?

--
Lubos Lunak
KDE developer
--------------------------------------------------------------
SUSE LINUX, s.r.o.   e-mail: l.lunak@... , l.lunak@...
Lihovarska 1060/12   tel: +420 284 084 672
190 00 Prague 9      fax: +420 284 028 951
Czech Republic       http://www.suse.cz
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<