The KWin Scripting functionality has been reworked and extended in the KDE Plasma Workspaces version 4.9. Unfortunately it was not possible to keep the API 100 % compatible. This document lists most changes. The new API is documented in Development/Tutorials/KWin/Scripting/API_4.9.
var opacity = client.opacity();
opacity = opacity*0.5;
client.opacity = client.opacity*0.5;
All methods are available as properties with the same name as the getter methods in the old API except hasAlpha which is just alpha.
The following methods are no longer available:
- close() (might be added again)
- move(): use the geometry property
- resize(): use the geometry property
- getWindowInfo(): properties of WindowInfo are merged into Toplevel and Client. See notes to WindowInfo.
- activate(): use workspace.activateClient() (TODO: currently not yet available)
- unminimize(): set minimized property to false.
The following methods have been renamed as properties:
- isTransient() -> transient
- isTransientFor() -> transientFor
- isShade() -> shade
- isShadeable() -> shadeable
- isMinimized() -> minimized
- isMinimizable() -> minimizable
- isMaximizable() -> maximizable
- isResizable() -> resizeable
- isMovable() -> moveable
- isMovableAcrossScreens() -> moveableAcrossScreens
- isCloseable() -> closeable
- isFullScreen()/setFullScreen() -> fullScreen
- isFullScreenable() -> fullScreenable
The events are documented as Signals in the new documentation. The new API follows the pattern of emitting a signal whenever a value changes. Use the property to query the new value. If the old value is required you should save the state in your script.
The following signals have been renamed:
- clientMoved -> geometryChanged
- minimized -> minimizedChanged
- activated -> activeChanged
- unminimized -> minimizedChanged
- fullScreenSet -> fullScreenChanged
ClientGroup is no longer instantiable. This was an error in the previous API version. In order to use the ClientGroup just access the Client's clientGroup property. If the value is null this means the Client is undecorated and a ClientGroup cannot be used.
Methods changed to Properties
WindowInfo is no longer provided. All relevant properties are merged into Toplevel or Client.
- isMinimized -> Client.minimized
- windowRole -> Toplevel.windowRole
- windowClassClass -> Toplevel.resourceClass
- windowClassName -> Toplevel.resourceName
- visibleName: best match Client.caption
- state: use better properties on Toplevel and Client
Content is available under Creative Commons License SA 4.0
unless otherwise noted.