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

scripting: a signal for window being shaded?

Tags: None
(comma "," separated)
sir_herrbatka
Registered Member
Posts
212
Karma
0
Hi,

I'm wonder if there is a signal emitted when client is shaded. I couldn't find it here: http://techbase.kde.org/Development/Tut ... ng/API_4.9

Can I ask for any insight?
mgraesslin
KDE Developer
Posts
572
Karma
7
OS
tried shadeChanged() in the Client class?
sir_herrbatka
Registered Member
Posts
212
Karma
0
Yes. But I thought that there is a way to do something like: shaded.connect(function(client) { and unshaded.connect(function(client) {

I feel a little ashamed but although scripting is easy I can't make my script work with shadeChanged().
mgraesslin
KDE Developer
Posts
572
Karma
7
OS
what do you want to achieve in the script? I probably can help
sir_herrbatka
Registered Member
Posts
212
Karma
0
nothing big (as usual). All I want is to remove shaded windows from taskbar. I think I can make it work if I can get this signal right.
mgraesslin
KDE Developer
Posts
572
Karma
7
OS
ah that is not very difficult to achieve.

You need to track all windows, that is connect to whenever a window gets added. There you connect to the shadeChanged signal. That gets fired whenever the window gets shaded/unshaded. If the new state (you can query that through a client property) is shaded you set the skipTaskbar property, if it gets unshaded you remove the property again.
sir_herrbatka
Registered Member
Posts
212
Karma
0

I'm stupid.

Thu Jan 10, 2013 3:39 pm
Hi,

I don't want to bother you with silly quetions but if I want to set bool to true i just = true it like

client.keepAbove = true;

I ask because for some reason my "homework":

workspace.clientMinimized(function(client) {
if (client.shade) {
client.keepAbove = true;
}
});

does not want to work. I made it to learn how to set booleans in kwin scripts. I want to finally be able to do something on my own :<
mgraesslin
KDE Developer
Posts
572
Karma
7
OS
The code in itself looks fine, but it might be that this doesn't make sense from a semantic point of view. You set a shaded client to keep above other windows when it gets minimized. No surprise that you don't see it :-)
sir_herrbatka
Registered Member
Posts
212
Karma
0
I know. This script is not intend to do anything uesful.

But it really does not work. I can't see in the taskbar menu that it's setted to keep above. Also I thought that this will set keep above but won't unset it.
mgraesslin
KDE Developer
Posts
572
Karma
7
OS
sir_herrbatka wrote:I know. This script is not intend to do anything uesful.

But it really does not work. I can't see in the taskbar menu that it's setted to keep above. Also I thought that this will set keep above but won't unset it.

I did not look into the code, but it's possible that this is sementically not possible at that point. That is KWin just discards the request. Do something that makes sense to test :-)
sir_herrbatka
Registered Member
Posts
212
Karma
0
workspace.clientSetKeepAbove(function(client) {
if (client.shade) {
client.skipTaskbar = true;
}
});

ok this one has more sense ;-) Skip the tasbkar if shaded window is getting always on top. Still does not work. :( KDE 4.9.2.
mgraesslin
KDE Developer
Posts
572
Karma
7
OS
you are missing a .connect
sir_herrbatka
Registered Member
Posts
212
Karma
0
uh, right :)

workspace.clientSetKeepAbove.connect(function(client) {
if (client.shade) {
client.skipTaskbar = true;
}
});

Still does not work. For some reason. I tried:

workspace.clientSetKeepAbove.connect(function(client) {
if (client.onAllDesktops) {
client.skipTaskbar = true;
}
});

and this also does not work. I'm confused. What I'm doing wrong?
luebking
Karma
0
"Does not work" means the taskbar still shows it?
What's does xprop say about that client and taskbars?


Bookmarks



Who is online

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