This forum has been archived. All content is frozen. Please use KDE Discuss instead.

KDE window class name

Tags: None
(comma "," separated)
User avatar
TheBlackCat
Registered Member
Posts
2945
Karma
8
OS

KDE window class name

Wed Jan 19, 2011 2:09 am
In the list of window properties kwin provides, one of those properties is the class name. However, I cannot find out what this is or how to set it. Does it correspond to a particular property in X11? Is there a way to set it for ordinary Qt windows?


Man is the lowest-cost, 150-pound, nonlinear, all-purpose computer system which can be mass-produced by unskilled labor.
-NASA in 1965
User avatar
TheBlackCat
Registered Member
Posts
2945
Karma
8
OS

Re: KDE window class name

Wed Jan 19, 2011 4:18 am
It looks like this corresponds to the WM_CLASS property, but I can't figure out how to set this in qt (or, rather, pyqt).


Man is the lowest-cost, 150-pound, nonlinear, all-purpose computer system which can be mass-produced by unskilled labor.
-NASA in 1965
User avatar
dpalacio
Registered Member
Posts
240
Karma
2
OS

Re: KDE window class name

Wed Jan 19, 2011 3:38 pm
It is the application name in Qt (QCoreApplication::applicationName).

To change the class of a particular window, you have to call X methods directly.


connect(post, SIGNAL(readSignature()), qapp, SLOT(quit()));
User avatar
Damnshock
Registered Member
Posts
111
Karma
0
OS

Re: KDE window class name

Wed Jan 19, 2011 4:19 pm
dpalacio wrote:It is the application name in Qt (QCoreApplication::applicationName).

To change the class of a particular window, you have to call X methods directly.


Didn't know that, thanks :)

Regards


Damnshock, proud to be a member of KDE forums since 2008-Oct.
User avatar
TheBlackCat
Registered Member
Posts
2945
Karma
8
OS

Re: KDE window class name

Wed Jan 19, 2011 4:23 pm
Do you know if there is a way to do that within pythong? This is a python window using pyqt4.


Man is the lowest-cost, 150-pound, nonlinear, all-purpose computer system which can be mass-produced by unskilled labor.
-NASA in 1965
User avatar
dpalacio
Registered Member
Posts
240
Karma
2
OS

Re: KDE window class name

Wed Feb 02, 2011 8:08 pm
What I said before is not true. I said that from memory but, later, I could not verify it. Sorry about that.

(See http://www.xfree86.org/current/X.7.html#toc13 )
Instead, the application name comes from the executable name (this has been checked from Qt's implementation of QApplication in X11). This works for compiled and ruby script executables. e.g.

If the executable is called appname.rb and you execute that, the windows will get that class name: appname.rb.

Instead, if it is called main.rb, or main.py the windows will get a bad class name, main.py.

or...
The hard way (X11 way)
See PlasmaApp::setWmClass() in kdebase/workspace/plasma/desktop/shell/plasmaapp.cpp


connect(post, SIGNAL(readSignature()), qapp, SLOT(quit()));


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot], ourcraft