PDA

View Full Version : Don't show on panel?



neverlander
24th May 2010, 21:56
I am trying to write a simple aplication (a continuously changing label on a window on the upper left side of the screen) and I don't want it to be seen on panel but only on system tray.Because it will run for a long time. How can I do that? Thanks.

PS: I am using python and pyqt.

high_flyer
25th May 2010, 12:02
I take it that you did manage to have an icon in the system tray, and that you only want to remove the task from the taskbar.
Note, that this operation is probably not portable.
Googling suggests that:
Adding WS_EX_TOOLWINDOW and removing WS_EX_APPWINDOW, should do the trick.
http://msdn.microsoft.com/en-us/library/aa969325.aspx#Managing_Taskbar_But

neverlander
25th May 2010, 16:48
Thank you for your reply but I did not understand what you mean. I have only one window and I am using Linux but I want it to be portable. I aded a photo to show what I wanted .

high_flyer
25th May 2010, 20:13
You didn't say for which window managing system you want to achieve this, I just assumed it was windows.
From the screenshot it looks like its KDE.
As I said, this is not portable, so the solution is specific for the windowing system (in this case KDE).
You might have more luck in KDE programming related forums.

Talei
25th May 2010, 20:30
You could use Qt::SplashScreen for that task.
In program use this->setWindowFlags( Qt::SplashScreen );
Ofcourse that will force program to be only splashscreen but, if I understand what You want to do correctly, this should be enoght.
Tested on Win, I don't know if kdm will do the same on KDE.

neverlander
26th May 2010, 13:52
Thanks Talei. It works, but when I clicked on the window it disappears. I have context menu on the window, so I must click on it. Do you have any solution for it?

Talei
26th May 2010, 15:35
Well this is a splash screen, so it's probably not the best way of doing it, but the fastest one.
I don't know why it disappear, maybe You are doing something else in program that force this behaviour (I use QWidget as base class), or simply it hides behind plasmoids on KDE (I doubt about that).
I tested this flag with my programs (one that use context menu) and programs behaves normally.
I will try to test it on KDE and see if something goes wrong.
In meantime try other flags with conjunction with splashscreen like:
Qt::X11BypassWindowManagerHint
and
Qt::WindowStaysOnTopHint
Also I use this code in my main class constructor, it last "entry" after all other initializations are done, so maybe this will help.

neverlander
26th May 2010, 16:38
I used hints (Qt::X11BypassWindowManagerHint, Qt::WindowStaysOnTopHint), my base class was qmainwindow, I changed it to qwidget. but nothing changed.


the link high_flyer gave says:

The Shell creates a button on the taskbar whenever an application creates a window that isn't owned. To ensure that the window button is placed on the taskbar, create an unowned window with the WS_EX_APPWINDOW extended style. To prevent the window button from being placed on the taskbar, create the unowned window with the WS_EX_TOOLWINDOW extended style. As an alternative, you can create a hidden window and make this hidden window the owner of your visible window.

I will try that!
Thank you for your help!

Talei
26th May 2010, 17:41
AFAIK This will not work on KDE, because WS_EX_TOOLWINDOW is a WinApi.

neverlander
26th May 2010, 17:54
No I did not use that. I tried to make a hidden window and I made that window parent for my real window.Bu It didnot work either. When I hide the window my real window becomes hidden too.

neverlander
27th May 2010, 21:34
I found the solution. I set the window flag as "Qt.Popup". Now there is no window on the panel.