System tray "close" dialog needs work

Aaron J. Seigo aseigo at kde.org
Wed Jan 5 23:19:01 GMT 2005


On Wednesday 05 January 2005 02:15, Sébastien Laoût wrote:
> * I've tryed to use kapp->widgetAt(g) (where g is a corner of the icon
> (a QPoint)), but it doesn't work since the widget is not in the current
> app (althrouth KSystemTray is a QLabel).
> So: no way to test if the kicker is raised/visible or not.

hrm.. .would sth like:

	QPoint p = systemtray->mapToGlobal(QPoint(0,0)); 
	if (QApplication::desktop()->screenGeometry()->contains(p))

work? i wonder even if just

	QApplication::desktop()->screenNumber(systemtray) == -1

would work?

this obviously doesn't cover the scenario where the panel is covered by 
something else though...

as for the KSystemTray object always returning true for isVisible(), the 
systemtray could do something like:

	KWin::WindowInfo info = KWin::windowInfo(emb->embeddedWinId());
	KWin::setState(emb->embeddedWinId(), info->state() | NET::Hidden)

and then do the reverse on showing ... 

note that the above is all completely untested, and just ideas =) it still 
won't solve things for 100% of the cases (e.g .the tray is obscured by 
another window).

Jason's suggestion to have the pixmap passed back via DCOP is likely the most 
foolproof method. as for not working in KDE, well, the user just doesn't get 
a pretty picture when they aren't in KDE?

-- 
Aaron J. Seigo
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20050105/3d950822/attachment.sig>


More information about the kde-core-devel mailing list