| Summary: | No access to the client that changed desktop in KWin::Client.desktopChanged() signal | ||
|---|---|---|---|
| Product: | [Plasma] kwin | Reporter: | LinG <lingtjien> |
| Component: | scripting | Assignee: | KWin default assignee <kwin-bugs-null> |
| Status: | RESOLVED NOT A BUG | ||
| Severity: | normal | ||
| Priority: | NOR | ||
| Version First Reported In: | 5.13.3 | ||
| Target Milestone: | --- | ||
| Platform: | Arch Linux | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
LinG
2018-08-12 11:26:28 UTC
You connect to the client's signal desktopChanged. This means you already have the client. Otherwise you could not even connect to the signal. It's your task to capture it appropriately in the lambda. Yes, I understand that at the moment when I'm connecting to the signal I have access to the client, but I don't understand how I get access to the client inside the callback method that I provide for when the signal gets triggered.
My current understanding is:
```
client.desktopChanged.connect(function () {
// how do I get the client inside this callback?
})
```
Here I provide a method (callback/lambda) that gets triggered whenever the desktop of this client changes.
The gap in my knowledge is then, how I would get access to the client inside this callback?
You refer to capturing the client in this lambda, could you please give a small example of how I would go about doing this?
|