RFC: Systray window closing helper

Lubos Lunak l.lunak at suse.cz
Mon Jul 16 15:11:17 BST 2007


 Hello,

 I'd like to add something like this to KSystemTrayIcon:

======
/**
 * Function to be used from function handling closing of the window associated 
with the tray icon (i.e. QWidget::closeEvent(), KMainWindow::queryClose() or 
similar). When false is returned, the window closing should proceed normally, 
when true is returned, special systray-related handling should take place.
 */
bool mainWindowCloseHelper() const;
======

 Already the fact that you now need to ask why this should be added is the 
reason why it should be added :). Seriously. One of the idiotic things about 
systray is that the app itself has to take care of many things itself - 
showing, hiding, closing, whatnot. Showing/hiding is a functionality of the 
systray class itself, so it's at least handled there, but the window closing 
is about the window, not about KSystemTrayIcon, so every app has handwritten 
code for that, and all of them get it wrong (e.g. breaking logout). This way 
apps would just call thing function.

 Even a better plan would be to add event filter for the close event, but then 
I'm not quite sure about the interactions, I'd expect that if KSystemTrayIcon 
simply filtered out the close and hid the main window, somebody would 
complain about not getting any event about that.

 Oh, and suggestions for a better name are welcome.

-- 
Lubos Lunak
KDE developer
--------------------------------------------------------------
SUSE LINUX, s.r.o.   e-mail: l.lunak at suse.cz , l.lunak at kde.org
Lihovarska 1060/12   tel: +420 284 028 972
190 00 Prague 9      fax: +420 284 028 951
Czech Republic       http//www.suse.cz




More information about the kde-core-devel mailing list