![]() Registered Member ![]()
|
I am C++ developer, currently writting application that periodically check some network-based info and, if it finds important change, pops up showing that new change.
The wanted behaviour is to "popup" window (frame in fact) as active and topmost. If it would be possible not to steal focus at once, but wait after user clicks inside some editbox even better, but simple full focus will be good enough). I tried the same things both in wxWidgets and Qt4, both times getting the same result in the KDE 3.5.9 environment: Basically I minimise application on startup. As user I see the task in the taskbar and continue normal working with many other applications including Konqueror, Eclipse etc. On event in my code I call normalise() method to bring window to original size. The result is, that the window "normalise", but shows without focus, partly (or even completely) overlapped by other applications window(s). The taskbar icon flashes (what is correct and wanted). I tried to append raise() method call after the normalise() one, but nothing changed. I understand, that multiplatform library-based raise() method raises window only inside of one application, not over all the desktop environment. However I suspect, that there is some "kde-wide-raise()" method available somewhere in Kwin libraries, which could be called by application to achieve wanted behaviour (see top of this message). I spent two halfdays searching and googling around KDE and kwin, but giving up and asking for kind help. If there is some better documentation on kwin 3.x (am I right, that kwin is the place to search for cross applications windows manipulation and that versioning corresponds to the KDE one?) other than the almost not commented automatic doxygen one, I would highly appreciate any link, as there are more window arrangements I would like to take care on in my application, e.g. automatically popup on all desktops, eventually even minimise to trayicon instead of tasklist etc.
pmendl, proud to be a member of KDE forums since 2008-Nov.
|
![]() Mentor ![]()
|
RE: How to bring application window to the top (foremost) of all windows ?
Wed Nov 19, 2008 12:37 pm
Have a look at http://doc.trolltech.com/4.4/qt.html#WindowType-enum. These values can be passed to the QWidget constructor and can change the behavior of your window.
![]() [size=x-small]code | [url=cia.vc/stats/author/msoeken]cia.vc[/url] | [url=kde.org/support]donating KDE[/url] | [url=tinyurl.com/cto4ns]wishlist[/url][/size] |
![]() Registered Member ![]()
|
And have you noticed this is a user forum?
Do not do or want that. It was quite a lot of work to write code to prevent broken applications like this from breaking users' workflow. Use KNotification (KNotify in KDE3) from kdelibs.
I think you probably don't understand the purpose of a window manager or why it has 'manager' in its name. Applications are not supposed to do window manipulation, especially not cross applications. If the KNotif* answer above is not enough for you, find an appropriate developers mailing list at http://www.kde.org/mailinglists/ and ask there. |
![]() Administrator ![]()
|
This appears to be a developer question on how to work with KDE libraries, so moved appropriately. Also, KNotifcations do go to the top and float there, but do not steal focus. There is nothing worse when an application steals focus when you are typing ( like when the google home page loads just as you are in the middle of typing a url )
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() Registered Member ![]()
|
Excuse me addressing the wrong forum. Even if long time C++ programmer, I am very new to KDE inside and still bit confused about proper resources.
pmendl, proud to be a member of KDE forums since 2008-Nov.
|
![]() Administrator ![]()
|
Don't worry about putting it in the wrong forum, a moderator will usually move it if they believe it is in the wrong place
![]()
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() KDE Developer ![]()
|
If you really want it to integrate into KDE you should use KNotification for notifying the user about an event.
The user has to some extend control on how and if it will show on his desktop. See for more info and usage details: http://api.kde.org/4.1-api/kdelibs-apid ... ation.html For KDE 3.5 the "same" class is part of libkopete see: http://api.kde.org/3.5-api/kdenetwork-a ... ation.html
Last edited by DanielW on Fri Nov 21, 2008 7:46 am, edited 1 time in total.
DanielW, proud to be a member of KDE forums since 2008-Oct.
|
![]() Registered Member ![]()
|
RE: How to bring application window to the top (foremost) of all windows ?
Fri Nov 21, 2008 10:44 am
Many thanks for the links! I wanted to test immediately, so added small class to activate KNotification. Header file:
Not connected yet, however trying to syntax-check run application (able to run before this class addition) I am getting linker errors:
I have installed kdelibs5 and kdelibs5-dev packages under Debian/lenny. What am I missing, please?
pmendl, proud to be a member of KDE forums since 2008-Nov.
|
![]() Mentor ![]()
|
RE: How to bring application window to the top (foremost) of all windows ?
Fri Nov 21, 2008 10:46 am
How did you compile it. Can you post your g++ command or Makefile or CMakeLists.txt or .pro File whatever you are using.
![]() [size=x-small]code | [url=cia.vc/stats/author/msoeken]cia.vc[/url] | [url=kde.org/support]donating KDE[/url] | [url=tinyurl.com/cto4ns]wishlist[/url][/size] |
![]() Registered Member ![]()
|
RE: How to bring application window to the top (foremost) of all windows ?
Fri Nov 21, 2008 11:01 am
This is the complete .pro file of the whole project (taken from original source with only Notifier.h DoNotify.h and Notifier.cpp DoNotify.cpp added in respective sections.
I am using Eclipse (4.3) to make/run application and Makefile header seems to be proper and current:
pmendl, proud to be a member of KDE forums since 2008-Nov.
|
![]() KDE Developer ![]()
|
Well, you have to link to libkdeui.
DanielW, proud to be a member of KDE forums since 2008-Oct.
|
![]() Administrator ![]()
|
You will be missing the instruction to add the appropriate target link libraries. I do not know how to add them manually into a QMake project (.pro). If this is going to be a KDE application, then I would recommend using CMake instead.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered users: Bing [Bot], Evergrowing, Google [Bot], rblackwell