* '''print(QVariant ... values)''': Prints all provided values to kDebug and as a D-Bus signal

+

* ''QVariant'' '''readConfig(QString key, QVariant defaultValue = QVariant())''': Reads the config value for key in the Script's configuration with the optional default value. If not providing a default value and no value stored in the configuration an undefined value is returned.

+

* ''bool'' '''registerScreenEdge(ElectricBorder border, QScriptValue callback)''': Registers the callback for the screen edge. When the mouse gets pushed against the given edge the callback will be invoked.

+

* ''bool'' '''registerShortcut(QString title, QString text, QString keySequence, QScriptValue callback)''': Registers keySequence as a global shortcut. When the shortcut is invoked the callback will be called. Title and text are used to name the shortcut and make it available to the global shortcut configuration module.

+

* ''bool'' '''assert(bool value, QString message = QString())''': Aborts the execution of the script if value does not evaluate to true. If message is provided an error is thrown with the given message, if not provided an error with default message is thrown.

+

* ''bool'' '''assertTrue(bool value, QString message = QString())''': Aborts the execution of the script if value does not evaluate to true. If message is provided an error is thrown with the given message, if not provided an error with default message is thrown.

+

* ''bool'' '''assertFalse(bool value, QString message = QString())''': Aborts the execution of the script if value does not evaluate to false. If message is provided an error is thrown with the given message, if not provided an error with default message is thrown.

+

* ''bool'' '''assertEquals(QVariant expected, QVariant actual, QString message = QString())''': Aborts the execution of the script if the actual value is not equal to the expected value. If message is provided an error is thrown with the given message, if not provided an error with default message is thrown.

+

* ''bool'' '''assertNull(QVariant value, QString message = QString())''': Aborts the execution of the script if value is not null. If message is provided an error is thrown with the given message, if not provided an error with default message is thrown.

+

* ''bool'' '''assertNotNull(QVariant value, QString message = QString())''': Aborts the execution of the script if value is null. If message is provided an error is thrown with the given message, if not provided an error with default message is thrown.

+

* '''callDBus(QString service, QString path, QString interface, QString method, QVariant arg..., QScriptValue callback = QScriptValue())''': Call a D-Bus method at (service, path, interface and method). A variable number of arguments can be added to the method call. The D-Bus call is always performed in an async way invoking the callback provided as the last (optional) argument. The reply values of the D-Bus method call are passed to the callback.

+

* '''registerUserActionsMenu(QScriptValue callback)''': Registers the passed in callback to be invoked whenever the User actions menu (Alt+F3 or right click on window decoration) is about to be shown. The callback is invoked with a reference to the Client for which the menu is shown. The callback can return either a single menu entry to be added to the menu or an own sub menu with multiple entries. The object for a menu entry should be {title: "My Menu entry", checkable: true, checked: false, triggered: function (action) { // callback with triggered QAction}}, for a menu it should be {title: "My menu", items: [{...}, {...}, ...] /*list with entries as described*/}

+

+

+

== KWin::WorkspaceWrapper ==

+

+

=== Enums ===

+

+

==== ClientAreaOption ====

+

+

* '''PlacementArea''': window movement snapping area? ignore struts

+

* '''MovementArea''':

+

* '''MaximizeArea''':

+

* '''MaximizeFullArea''':

+

* '''FullScreenArea''':

+

* '''WorkArea''':

+

* '''FullArea''':

+

* '''ScreenArea''':

+

==== ElectricBorder ====

+

+

* '''ElectricTop''':

+

* '''ElectricTopRight''':

+

* '''ElectricRight''':

+

* '''ElectricBottomRight''':

+

* '''ElectricBottom''':

+

* '''ElectricBottomLeft''':

+

* '''ElectricLeft''':

+

* '''ElectricTopLeft''':

+

* '''ELECTRIC_COUNT''':

+

* '''ElectricNone''':

+

=== Read-only Properties ===

+

+

* ''QSize'' '''desktopGridSize'''

+

* ''int'' '''desktopGridWidth'''

+

* ''int'' '''desktopGridHeight'''

+

* ''int'' '''workspaceWidth'''

+

* ''int'' '''workspaceHeight'''

+

* ''QSize'' '''workspaceSize'''

+

* ''QSize'' '''displaySize''': The same of the display, that is all screens.

+

* ''int'' '''displayWidth''': The width of the display, that is width of all combined screens.

+

* ''int'' '''displayHeight''': The height of the display, that is height of all combined screens.

+

* ''int'' '''activeScreen'''

+

* ''int'' '''numScreens'''

+

* ''QString'' '''currentActivity'''

+

* ''QStringList'' '''activities'''

+

=== Read-write Properties ===

+

+

* ''int'' '''currentDesktop'''

+

* ''KWin::Client'' '''activeClient'''

+

* ''int'' '''desktops''': The number of desktops currently used. Minimum number of desktops is 1, maximum 20.

* '''numberDesktopsChanged(int oldNumberOfDesktops)''': Signal emitted whenever the number of desktops changed. To get the current number of desktops use the property desktops. oldNumberOfDesktops The previous number of desktops.

+

* '''clientDemandsAttentionChanged(KWin::Client *client, bool set)''': The demands attention state for Client c changed to set. c The Client for which demands attention changed set New value of demands attention

+

* '''numberScreensChanged(int count)''': Signal emitted when the number of screens changes. count The new number of screens

+

* '''screenResized(int screen)''': This signal is emitted when the size of screen changes. Don't forget to fetch an updated client area.

* ''QRect'' '''clientArea(ClientAreaOption option, int screen, int desktop) const ''': Returns the geometry a Client can use with the specified option. This method should be preferred over other methods providing screen sizes as the various options take constraints such as struts set on panels into account. This method is also multi screen aware, but there are also options to get full areas. option The type of area which should be considered screen The screen for which the area should be considered desktop The desktop for which the area should be considered, in general there should not be a difference The specified screen geometry

+

* ''QRect'' '''clientArea(ClientAreaOption option, const QPoint &point, int desktop) const ''': Overloaded method for convenience. option The type of area which should be considered point The coordinates which have to be included in the area desktop The desktop for which the area should be considered, in general there should not be a difference The specified screen geometry

+

* ''QRect'' '''clientArea(ClientAreaOption option, const KWin::Client *client) const ''': Overloaded method for convenience. client The Client for which the area should be retrieved The specified screen geometry

+

* ''QString'' '''desktopName(int desktop) const ''': Returns the name for the given desktop.

* ''bool'' '''glStrictBindingFollowsDriver''': Whether strict binding follows the driver or has been overwritten by a user defined config value. If true is set by the OpenGL Scene during initialization. If false glStrictBinding is set from a config value and not updated during scene initialization.

+

* ''bool'' '''glLegacy''': Whether legacy OpenGL should be used or OpenGL (ES) 2

+

=== Signals ===

+

+

* '''configChanged()'''

+

* '''focusPolicyChanged()'''

+

* '''nextFocusPrefersMouseChanged()'''

+

* '''clickRaiseChanged()'''

+

* '''autoRaiseChanged()'''

+

* '''autoRaiseIntervalChanged()'''

+

* '''delayFocusIntervalChanged()'''

+

* '''shadeHoverChanged()'''

+

* '''shadeHoverIntervalChanged()'''

+

* '''separateScreenFocusChanged()'''

+

* '''activeMouseScreenChanged()'''

+

* '''placementChanged()'''

+

* '''borderSnapZoneChanged()'''

+

* '''windowSnapZoneChanged()'''

+

* '''centerSnapZoneChanged()'''

+

* '''snapOnlyWhenOverlappingChanged()'''

+

* '''showDesktopIsMinimizeAllChanged()'''

+

* '''rollOverDesktopsChanged()'''

+

* '''focusStealingPreventionLevelChanged()'''

+

* '''legacyFullscreenSupportChanged()'''

+

* '''operationTitlebarDblClickChanged()'''

+

* '''commandActiveTitlebar1Changed()'''

+

* '''commandActiveTitlebar2Changed()'''

+

* '''commandActiveTitlebar3Changed()'''

+

* '''commandInactiveTitlebar1Changed()'''

+

* '''commandInactiveTitlebar2Changed()'''

+

* '''commandInactiveTitlebar3Changed()'''

+

* '''commandWindow1Changed()'''

+

* '''commandWindow2Changed()'''

+

* '''commandWindow3Changed()'''

+

* '''commandWindowWheelChanged()'''

+

* '''commandAll1Changed()'''

+

* '''commandAll2Changed()'''

+

* '''commandAll3Changed()'''

+

* '''keyCmdAllModKeyChanged()'''

+

* '''showGeometryTipChanged()'''

+

* '''electricBordersChanged()'''

+

* '''electricBorderDelayChanged()'''

+

* '''electricBorderCooldownChanged()'''

+

* '''electricBorderPushbackPixelsChanged()'''

+

* '''electricBorderMaximizeChanged()'''

+

* '''electricBorderTilingChanged()'''

+

* '''electricBorderCornerRatioChanged()'''

+

* '''borderlessMaximizedWindowsChanged()'''

+

* '''killPingTimeoutChanged()'''

+

* '''hideUtilityWindowsForInactiveChanged()'''

+

* '''inactiveTabsSkipTaskbarChanged()'''

+

* '''autogroupSimilarWindowsChanged()'''

+

* '''autogroupInForegroundChanged()'''

+

* '''compositingModeChanged()'''

+

* '''useCompositingChanged()'''

+

* '''compositingInitializedChanged()'''

+

* '''hiddenPreviewsChanged()'''

+

* '''unredirectFullscreenChanged()'''

+

* '''glSmoothScaleChanged()'''

+

* '''glVSyncChanged()'''

+

* '''xrenderSmoothScaleChanged()'''

+

* '''maxFpsIntervalChanged()'''

+

* '''refreshRateChanged()'''

+

* '''vBlankTimeChanged()'''

+

* '''glDirectChanged()'''

+

* '''glStrictBindingChanged()'''

+

* '''glStrictBindingFollowsDriverChanged()'''

+

* '''glLegacyChanged()'''

+

=== Functions ===

+

+

+

== KWin::Toplevel ==

== KWin::Toplevel ==

−

Toplevel is an abstract base class for all "Windows". You cannot use it directly, but everything available on Toplevel is available on Client, too.

+

+

'''Inherits:''' KDecorationDefines

=== Read-only Properties ===

=== Read-only Properties ===

+

* ''bool'' '''alpha'''

* ''bool'' '''alpha'''

* ''qulonglong'' '''frameId'''

* ''qulonglong'' '''frameId'''

* ''QRect'' '''geometry'''

* ''QRect'' '''geometry'''

+

* ''QRect'' '''visibleRect'''

* ''int'' '''height'''

* ''int'' '''height'''

* ''QPoint'' '''pos'''

* ''QPoint'' '''pos'''

Line 14:

Line 374:

* ''int'' '''y'''

* ''int'' '''y'''

* ''int'' '''desktop'''

* ''int'' '''desktop'''

+

* ''bool'' '''onAllDesktops''': Whether the window is on all desktops. That is desktop is -1.

* ''QRect'' '''rect'''

* ''QRect'' '''rect'''

* ''QPoint'' '''clientPos'''

* ''QPoint'' '''clientPos'''

Line 20:

Line 381:

* ''QByteArray'' '''resourceClass'''

* ''QByteArray'' '''resourceClass'''

* ''QByteArray'' '''windowRole'''

* ''QByteArray'' '''windowRole'''

−

* ''bool'' '''desktopWindow''': Returns whether the window is a desktop background window (the one with wallpaper). See _NET_WM_WINDOW_TYPE_DESKTOP at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html .

+

* ''bool'' '''desktopWindow''': Returns whether the window is a desktop background window (the one with wallpaper). See _NET_WM_WINDOW_TYPE_DESKTOP at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html .

−

* ''bool'' '''dock''': Returns whether the window is a dock (i.e. a panel). See _NET_WM_WINDOW_TYPE_DOCK at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html .

+

* ''bool'' '''dock''': Returns whether the window is a dock (i.e. a panel). See _NET_WM_WINDOW_TYPE_DOCK at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html .

* ''bool'' '''menu''': Returns whether the window is a torn-off menu. See _NET_WM_WINDOW_TYPE_MENU at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html .

+

* ''bool'' '''menu''': Returns whether the window is a torn-off menu. See _NET_WM_WINDOW_TYPE_MENU at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html .

−

* ''bool'' '''normalWindow''': Returns whether the window is a "normal" window, i.e. an application or any other window for which none of the specialized window types fit. See _NET_WM_WINDOW_TYPE_NORMAL at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html .

+

* ''bool'' '''normalWindow''': Returns whether the window is a "normal" window, i.e. an application or any other window for which none of the specialized window types fit. See _NET_WM_WINDOW_TYPE_NORMAL at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html .

−

* ''bool'' '''dialog''': Returns whether the window is a dialog window. See _NET_WM_WINDOW_TYPE_DIALOG at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html .

+

* ''bool'' '''dialog''': Returns whether the window is a dialog window. See _NET_WM_WINDOW_TYPE_DIALOG at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html .

−

* ''bool'' '''splash''': Returns whether the window is a splashscreen. Note that many (especially older) applications do not support marking their splash windows with this type. See _NET_WM_WINDOW_TYPE_SPLASH at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html .

+

* ''bool'' '''splash''': Returns whether the window is a splashscreen. Note that many (especially older) applications do not support marking their splash windows with this type. See _NET_WM_WINDOW_TYPE_SPLASH at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html .

−

* ''bool'' '''utility''':Returns whether the window is a utility window, such as a tool window. See _NET_WM_WINDOW_TYPE_UTILITY at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html .

+

* ''bool'' '''utility''': Returns whether the window is a utility window, such as a tool window. See _NET_WM_WINDOW_TYPE_UTILITY at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html .

−

* ''bool'' '''dropdownMenu''': Returns whether the window is a dropdown menu (i.e. a popup directly or indirectly open from the applications menubar). See _NET_WM_WINDOW_TYPE_DROPDOWN_MENU at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html .

+

* ''bool'' '''dropdownMenu''': Returns whether the window is a dropdown menu (i.e. a popup directly or indirectly open from the applications menubar). See _NET_WM_WINDOW_TYPE_DROPDOWN_MENU at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html .

−

* ''bool'' '''popupMenu''': Returns whether the window is a popup menu (that is not a torn-off or dropdown menu). See _NET_WM_WINDOW_TYPE_POPUP_MENU at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html .

+

* ''bool'' '''popupMenu''': Returns whether the window is a popup menu (that is not a torn-off or dropdown menu). See _NET_WM_WINDOW_TYPE_POPUP_MENU at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html .

−

* ''bool'' '''tooltip''': Returns whether the window is a tooltip. See _NET_WM_WINDOW_TYPE_TOOLTIP at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html .

+

* ''bool'' '''tooltip''': Returns whether the window is a tooltip. See _NET_WM_WINDOW_TYPE_TOOLTIP at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html .

−

* ''bool'' '''notification''': Returns whether the window is a window with a notification. See _NET_WM_WINDOW_TYPE_NOTIFICATION at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html .

+

* ''bool'' '''notification''': Returns whether the window is a window with a notification. See _NET_WM_WINDOW_TYPE_NOTIFICATION at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html .

−

* ''bool'' '''comboBox''': Returns whether the window is a combobox popup. See _NET_WM_WINDOW_TYPE_COMBO at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html .

+

* ''bool'' '''comboBox''': Returns whether the window is a combobox popup. See _NET_WM_WINDOW_TYPE_COMBO at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html .

−

* ''bool'' '''dndIcon''': Returns whether the window is a Drag&amp;Drop icon. See _NET_WM_WINDOW_TYPE_DND at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html .

+

* ''bool'' '''dndIcon''': Returns whether the window is a Drag&Drop icon. See _NET_WM_WINDOW_TYPE_DND at http://standards.freedesktop.org/wm-spec/wm-spec-latest.html .

* ''bool'' '''managed''': Whether this Toplevel is managed by KWin (it has control over its placement and other aspects, as opposed to override-redirect windows that are entirely handled by the application).

+

* ''bool'' '''deleted''': Whether this Toplevel represents an already deleted window and only kept for the compositor for animations.

* '''shapedChanged()''': Signal emitted when the window's shape state changed. That is if it did not have a shape and received one or if the shape was withdrawn. Think of Chromium enabling/disabling KWin's decoration.

+

* '''needsRepaint()''': Emitted whenever the state changes in a way, that the Compositor should schedule a repaint of the scene.

+

=== Functions ===

+

+

* '''addRepaint(const QRect &r)'''

+

* '''addRepaint(const QRegion &r)'''

+

* '''addRepaint(int x, int y, int w, int h)'''

+

* '''addLayerRepaint(const QRect &r)'''

+

* '''addLayerRepaint(const QRegion &r)'''

+

* '''addLayerRepaint(int x, int y, int w, int h)'''

+

* '''addRepaintFull()'''

+

== KWin::Client ==

== KWin::Client ==

The Client class encapsulates a window decoration frame.

The Client class encapsulates a window decoration frame.

'''Inherits:''' KWin::Toplevel

'''Inherits:''' KWin::Toplevel

+

=== Enums ===

+

+

==== Sizemode ====

+

+

* '''SizemodeAny''':

+

* '''SizemodeFixedW''':

+

* '''SizemodeFixedH''':

+

* '''SizemodeMax''':

+

==== CoordinateMode ====

+

+

* '''DecorationRelative''':

+

* '''WindowRelative''':

=== Read-only Properties ===

=== Read-only Properties ===

Line 74:

Line 464:

* ''bool'' '''wantsInput''': Whether the Client can accept keyboard focus. The value is evaluated each time the getter is called. Because of that no changed signal is provided.

* ''bool'' '''wantsInput''': Whether the Client can accept keyboard focus. The value is evaluated each time the getter is called. Because of that no changed signal is provided.

* ''int'' '''desktop''': The desktop this Client is on. If the Client is on all desktops the property has value -1.Returns the virtual desktop within the workspace() the client window is located in, 0 if it isn't located on any special desktop (not mapped yet), or NET::OnAllDesktops. Do not use desktop() directly, use isOnDesktop() instead.

* ''int'' '''desktop''': The desktop this Client is on. If the Client is on all desktops the property has value -1.Returns the virtual desktop within the workspace() the client window is located in, 0 if it isn't located on any special desktop (not mapped yet), or NET::OnAllDesktops. Do not use desktop() directly, use isOnDesktop() instead.

+

* ''bool'' '''onAllDesktops''': Whether the Client is on all desktops. That is desktop is -1.

* ''bool'' '''fullScreen''': Whether this Client is fullScreen. A Client might either be fullScreen due to the _NET_WM property or through a legacy support hack. The fullScreen state can only be changed if the Client does not use the legacy hack. To be sure whether the state changed, connect to the notify signal.

* ''bool'' '''fullScreen''': Whether this Client is fullScreen. A Client might either be fullScreen due to the _NET_WM property or through a legacy support hack. The fullScreen state can only be changed if the Client does not use the legacy hack. To be sure whether the state changed, connect to the notify signal.

* ''QRect'' '''geometry''': The geometry of this Client. Be aware that depending on resize mode the geometryChanged signal might be emitted at each resize step or only at the end of the resize operation.

* ''QRect'' '''geometry''': The geometry of this Client. Be aware that depending on resize mode the geometryChanged signal might be emitted at each resize step or only at the end of the resize operation.

Line 85:

Line 479:

* ''bool'' '''shade''': Whether the Client is shaded.

* ''bool'' '''shade''': Whether the Client is shaded.

* ''bool'' '''skipSwitcher''': Whether the Client should be excluded from window switching effects.

* ''bool'' '''skipSwitcher''': Whether the Client should be excluded from window switching effects.

+

* ''bool'' '''skipTaskbar''': Indicates that the window should not be included on a taskbar.

+

* ''bool'' '''skipPager''': Indicates that the window should not be included on a Pager.

+

* ''bool'' '''noBorder''': Whether the window has a decoration or not. This property is not allowed to be set by applications themselves. The decision whether a window has a border or not belongs to the window manager. If this property gets abused by application developers, it will be removed again.

+

* ''bool'' '''demandsAttention''': Whether window state _NET_WM_STATE_DEMANDS_ATTENTION is set. This state indicates that some action in or with the window happened. For example, it may be set by the Window Manager if the window requested activation but the Window Manager refused it, or the application may set it if it finished some work. This state may be set by both the Client and the Window Manager. It should be unset by the Window Manager when it decides the window got the required attention (usually, that it got activated).

+

* ''bool'' '''blocksCompositing''': A client can block compositing. That is while the Client is alive and the state is set, Compositing is suspended and is resumed when there are no Clients blocking compositing any more.This is actually set by a window property, unfortunately not used by the target application group. For convenience it's exported as a property to the scripts.Use with care!

* '''clientGroupChanged()''': Emitted whenever the Client's ClientGroup changed. That is whenever the Client is moved to another group, but not when a Client gets added or removed to the Client's ClientGroup.

+

* '''skipTaskbarChanged()'''

−

+

* '''skipPagerChanged()'''

−

=== Functions ===

+

* '''tabGroupChanged()''': Emitted whenever the Client's TabGroup changed. That is whenever the Client is moved to another group, but not when a Client gets added or removed to the Client's ClientGroup.

−

* '''closeWindow()''': Closes the window by either sending a delete_window message or using XKill.

* '''add(KWin::Client *c, int before=-1, bool becomeVisible=false)''': Adds c to the group before before in the list. If becomeVisible is true then the added client will become also the visible client.

+

* '''closeWindow()''': Closes the window by either sending a delete_window message or using XKill.

−

* '''remove(int index, const QRect &amp;newGeom=QRect(), bool toNullGroup=false)''': Remove the client at index index from the group. If newGeom is set then the client will move and resize to the specified geometry, otherwise it will stay where the group is located. If toNullGroup is not true then the client will be added to a new group of its own.

+

* ''bool'' '''tabBefore(Client *other, bool activate)'''

−

* '''remove(KWin::Client *c, const QRect &amp;newGeom=QRect(), bool toNullGroup=false)''': Remove c from the group. If newGeom is set then the client will move and resize to the specified geometry, otherwise it will stay where the group is located. If toNullGroup is not true then the client will be added to a new group of its own.

+

* ''bool'' '''tabBehind(Client *other, bool activate)'''

−

* '''removeAll()''': Remove all clients from this group. Results in all clients except the first being moved to a group of their own.

+

* '''syncTabGroupFor(QString property, bool fromThisClient=false)''': Syncs the dynamic property fromThisClient or the to all members of the tabGroup() (if there is one) eg. if you call: client->setProperty("kwin_tiling_floats", true); client->syncTabGroupFor("kwin_tiling_floats", true) all clients in this tabGroup will have ::property("kwin_tiling_floats").toBool() == true WARNING: non dynamic properties are ignored - you're not supposed to alter/update such explicitly

−

* '''closeAll()''': Close all clients in this group.

+

* ''bool'' '''untab(const QRect &toGeometry=QRect())'''

−

* '''move(int index, int before)''': Move the client at index index to the position before the client at index before in the list.

+

−

* '''move(KWin::Client *c, KWin::Client *before)''': Move c to the position before before in the list.

Functions

print(QVariant ... values): Prints all provided values to kDebug and as a D-Bus signal

QVariantreadConfig(QString key, QVariant defaultValue = QVariant()): Reads the config value for key in the Script's configuration with the optional default value. If not providing a default value and no value stored in the configuration an undefined value is returned.

boolregisterScreenEdge(ElectricBorder border, QScriptValue callback): Registers the callback for the screen edge. When the mouse gets pushed against the given edge the callback will be invoked.

boolregisterShortcut(QString title, QString text, QString keySequence, QScriptValue callback): Registers keySequence as a global shortcut. When the shortcut is invoked the callback will be called. Title and text are used to name the shortcut and make it available to the global shortcut configuration module.

boolassert(bool value, QString message = QString()): Aborts the execution of the script if value does not evaluate to true. If message is provided an error is thrown with the given message, if not provided an error with default message is thrown.

boolassertTrue(bool value, QString message = QString()): Aborts the execution of the script if value does not evaluate to true. If message is provided an error is thrown with the given message, if not provided an error with default message is thrown.

boolassertFalse(bool value, QString message = QString()): Aborts the execution of the script if value does not evaluate to false. If message is provided an error is thrown with the given message, if not provided an error with default message is thrown.

boolassertEquals(QVariant expected, QVariant actual, QString message = QString()): Aborts the execution of the script if the actual value is not equal to the expected value. If message is provided an error is thrown with the given message, if not provided an error with default message is thrown.

boolassertNull(QVariant value, QString message = QString()): Aborts the execution of the script if value is not null. If message is provided an error is thrown with the given message, if not provided an error with default message is thrown.

boolassertNotNull(QVariant value, QString message = QString()): Aborts the execution of the script if value is null. If message is provided an error is thrown with the given message, if not provided an error with default message is thrown.

callDBus(QString service, QString path, QString interface, QString method, QVariant arg..., QScriptValue callback = QScriptValue()): Call a D-Bus method at (service, path, interface and method). A variable number of arguments can be added to the method call. The D-Bus call is always performed in an async way invoking the callback provided as the last (optional) argument. The reply values of the D-Bus method call are passed to the callback.

registerUserActionsMenu(QScriptValue callback): Registers the passed in callback to be invoked whenever the User actions menu (Alt+F3 or right click on window decoration) is about to be shown. The callback is invoked with a reference to the Client for which the menu is shown. The callback can return either a single menu entry to be added to the menu or an own sub menu with multiple entries. The object for a menu entry should be {title: "My Menu entry", checkable: true, checked: false, triggered: function (action) { // callback with triggered QAction}}, for a menu it should be {title: "My menu", items: [{...}, {...}, ...] /*list with entries as described*/}

KWin::WorkspaceWrapper

Enums

ClientAreaOption

PlacementArea: window movement snapping area? ignore struts

MovementArea:

MaximizeArea:

MaximizeFullArea:

FullScreenArea:

WorkArea:

FullArea:

ScreenArea:

ElectricBorder

ElectricTop:

ElectricTopRight:

ElectricRight:

ElectricBottomRight:

ElectricBottom:

ElectricBottomLeft:

ElectricLeft:

ElectricTopLeft:

ELECTRIC_COUNT:

ElectricNone:

Read-only Properties

QSizedesktopGridSize

intdesktopGridWidth

intdesktopGridHeight

intworkspaceWidth

intworkspaceHeight

QSizeworkspaceSize

QSizedisplaySize: The same of the display, that is all screens.

intdisplayWidth: The width of the display, that is width of all combined screens.

intdisplayHeight: The height of the display, that is height of all combined screens.

intactiveScreen

intnumScreens

QStringcurrentActivity

QStringListactivities

Read-write Properties

intcurrentDesktop

KWin::ClientactiveClient

intdesktops: The number of desktops currently used. Minimum number of desktops is 1, maximum 20.

Signals

desktopPresenceChanged(KWin::Client *client, int desktop)

currentDesktopChanged(int desktop, KWin::Client *client)

clientAdded(KWin::Client *client)

clientRemoved(KWin::Client *client)

clientManaging(KWin::Client *client)

clientMinimized(KWin::Client *client)

clientUnminimized(KWin::Client *client)

clientRestored(KWin::Client *client)

clientMaximizeSet(KWin::Client *client, bool h, bool v)

killWindowCalled(KWin::Client *client)

clientActivated(KWin::Client *client)

clientFullScreenSet(KWin::Client *client, bool fullScreen, bool user)

clientSetKeepAbove(KWin::Client *client, bool keepAbove)

numberDesktopsChanged(int oldNumberOfDesktops): Signal emitted whenever the number of desktops changed. To get the current number of desktops use the property desktops. oldNumberOfDesktops The previous number of desktops.

clientDemandsAttentionChanged(KWin::Client *client, bool set): The demands attention state for Client c changed to set. c The Client for which demands attention changed set New value of demands attention

numberScreensChanged(int count): Signal emitted when the number of screens changes. count The new number of screens

screenResized(int screen): This signal is emitted when the size of screen changes. Don't forget to fetch an updated client area.

currentActivityChanged(const QString &id): Signal emitted whenever the current activity changed. id id of the new activity

QRectclientArea(ClientAreaOption option, int screen, int desktop) const : Returns the geometry a Client can use with the specified option. This method should be preferred over other methods providing screen sizes as the various options take constraints such as struts set on panels into account. This method is also multi screen aware, but there are also options to get full areas. option The type of area which should be considered screen The screen for which the area should be considered desktop The desktop for which the area should be considered, in general there should not be a difference The specified screen geometry

QRectclientArea(ClientAreaOption option, const QPoint &point, int desktop) const : Overloaded method for convenience. option The type of area which should be considered point The coordinates which have to be included in the area desktop The desktop for which the area should be considered, in general there should not be a difference The specified screen geometry

QRectclientArea(ClientAreaOption option, const KWin::Client *client) const : Overloaded method for convenience. client The Client for which the area should be retrieved The specified screen geometry

QStringdesktopName(int desktop) const : Returns the name for the given desktop.

QStringsupportInformation() const : Provides support information about the currently running KWin instance.

KWin::Client *getClient(qulonglong windowId): Finds the Client with the given windowId. windowId The window Id of the Client The found Client or null

KWin::Options

Inherits: KDecorationOptions

Enums

FocusPolicy

ClickToFocus:

FocusFollowsMouse:

FocusUnderMouse:

FocusStrictlyUnderMouse:

MouseCommand

MouseRaise:

MouseLower:

MouseOperationsMenu:

MouseToggleRaiseAndLower:

MouseActivateAndRaise:

MouseActivateAndLower:

MouseActivate:

MouseActivateRaiseAndPassClick:

MouseActivateAndPassClick:

MouseMove:

MouseUnrestrictedMove:

MouseActivateRaiseAndMove:

MouseActivateRaiseAndUnrestrictedMove:

MouseResize:

MouseUnrestrictedResize:

MouseShade:

MouseSetShade:

MouseUnsetShade:

MouseMaximize:

MouseRestore:

MouseMinimize:

MouseNextDesktop:

MousePreviousDesktop:

MouseAbove:

MouseBelow:

MouseOpacityMore:

MouseOpacityLess:

MouseClose:

MousePreviousTab:

MouseNextTab:

MouseDragTab:

MouseNothing:

MouseWheelCommand

MouseWheelRaiseLower:

MouseWheelShadeUnshade:

MouseWheelMaximizeRestore:

MouseWheelAboveBelow:

MouseWheelPreviousNextDesktop:

MouseWheelChangeOpacity:

MouseWheelChangeCurrentTab:

MouseWheelNothing:

@16

ElectricDisabled:

ElectricMoveOnly:

ElectricAlways:

Read-only Properties

boolfocusPolicyIsReasonable

boolelectricBorders: Whether electric borders are enabled. With electric borders you can change desktop by moving the mouse pointer towards the edge of the screen

Read-write Properties

FocusPolicyfocusPolicy

boolnextFocusPrefersMouse

boolclickRaise: Whether clicking on a window raises it in FocusFollowsMouse mode or not.

boolglStrictBindingFollowsDriver: Whether strict binding follows the driver or has been overwritten by a user defined config value. If true is set by the OpenGL Scene during initialization. If false glStrictBinding is set from a config value and not updated during scene initialization.

boolglLegacy: Whether legacy OpenGL should be used or OpenGL (ES) 2

Signals

configChanged()

focusPolicyChanged()

nextFocusPrefersMouseChanged()

clickRaiseChanged()

autoRaiseChanged()

autoRaiseIntervalChanged()

delayFocusIntervalChanged()

shadeHoverChanged()

shadeHoverIntervalChanged()

separateScreenFocusChanged()

activeMouseScreenChanged()

placementChanged()

borderSnapZoneChanged()

windowSnapZoneChanged()

centerSnapZoneChanged()

snapOnlyWhenOverlappingChanged()

showDesktopIsMinimizeAllChanged()

rollOverDesktopsChanged()

focusStealingPreventionLevelChanged()

legacyFullscreenSupportChanged()

operationTitlebarDblClickChanged()

commandActiveTitlebar1Changed()

commandActiveTitlebar2Changed()

commandActiveTitlebar3Changed()

commandInactiveTitlebar1Changed()

commandInactiveTitlebar2Changed()

commandInactiveTitlebar3Changed()

commandWindow1Changed()

commandWindow2Changed()

commandWindow3Changed()

commandWindowWheelChanged()

commandAll1Changed()

commandAll2Changed()

commandAll3Changed()

keyCmdAllModKeyChanged()

showGeometryTipChanged()

electricBordersChanged()

electricBorderDelayChanged()

electricBorderCooldownChanged()

electricBorderPushbackPixelsChanged()

electricBorderMaximizeChanged()

electricBorderTilingChanged()

electricBorderCornerRatioChanged()

borderlessMaximizedWindowsChanged()

killPingTimeoutChanged()

hideUtilityWindowsForInactiveChanged()

inactiveTabsSkipTaskbarChanged()

autogroupSimilarWindowsChanged()

autogroupInForegroundChanged()

compositingModeChanged()

useCompositingChanged()

compositingInitializedChanged()

hiddenPreviewsChanged()

unredirectFullscreenChanged()

glSmoothScaleChanged()

glVSyncChanged()

xrenderSmoothScaleChanged()

maxFpsIntervalChanged()

refreshRateChanged()

vBlankTimeChanged()

glDirectChanged()

glStrictBindingChanged()

glStrictBindingFollowsDriverChanged()

glLegacyChanged()

Functions

KWin::Toplevel

Inherits: KDecorationDefines

Read-only Properties

boolalpha

qulonglongframeId

QRectgeometry

QRectvisibleRect

intheight

QPointpos

intscreen

QSizesize

intwidth

qulonglongwindowId

intx

inty

intdesktop

boolonAllDesktops: Whether the window is on all desktops. That is desktop is -1.

boolmanaged: Whether this Toplevel is managed by KWin (it has control over its placement and other aspects, as opposed to override-redirect windows that are entirely handled by the application).

booldeleted: Whether this Toplevel represents an already deleted window and only kept for the compositor for animations.

boolshaped: Whether the window has an own shape

Read-write Properties

qrealopacity

Signals

opacityChanged(KWin::Toplevel *toplevel, qreal oldOpacity)

damaged(KWin::Toplevel *toplevel, const QRect &damage)

propertyNotify(KWin::Toplevel *toplevel, long a)

geometryChanged()

geometryShapeChanged(KWin::Toplevel *toplevel, const QRect &old)

paddingChanged(KWin::Toplevel *toplevel, const QRect &old)

windowClosed(KWin::Toplevel *toplevel, KWin::Deleted *deleted)

windowShown(KWin::Toplevel *toplevel)

shapedChanged(): Signal emitted when the window's shape state changed. That is if it did not have a shape and received one or if the shape was withdrawn. Think of Chromium enabling/disabling KWin's decoration.

needsRepaint(): Emitted whenever the state changes in a way, that the Compositor should schedule a repaint of the scene.

KWin::Client

Enums

Sizemode

CoordinateMode

DecorationRelative:

WindowRelative:

Read-only Properties

boolactive: Whether this Client is active or not. Use Workspace::activateClient() to activate a Client. Workspace::activateClient

QStringcaption: The Caption of the Client. Read from WM_NAME property together with a suffix for hostname and shortcut. To read only the caption as provided by WM_NAME, use the getter with an additional false value.

boolcloseable: Whether the window can be closed by the user. The value is evaluated each time the getter is called. Because of that no changed signal is provided.

boolfullScreenable: Whether the Client can be set to fullScreen. The property is evaluated each time it is invoked. Because of that there is no notify signal.

boolmaximizable: Whether the Client can be maximized both horizontally and vertically. The property is evaluated each time it is invoked. Because of that there is no notify signal.

boolminimizable: Whether the Client can be minimized. The property is evaluated each time it is invoked. Because of that there is no notify signal.

boolmodal: Whether the Client represents a modal window.

boolmoveable: Whether the Client is moveable. Even if it is not moveable, it might be possible to move it to another screen. The property is evaluated each time it is invoked. Because of that there is no notify signal. moveableAcrossScreens

boolmoveableAcrossScreens: Whether the Client can be moved to another screen. The property is evaluated each time it is invoked. Because of that there is no notify signal. moveable

boolprovidesContextHelp: Whether the Client provides context help. Mostly needed by decorations to decide whether to show the help button or not.Returns whether the window provides context help or not. If it does, you should show a help menu item or a help button like '?' and call contextHelp() if this is invoked.contextHelp()

boolresizeable: Whether the Client can be resized. The property is evaluated each time it is invoked. Because of that there is no notify signal.

boolshadeable: Whether the Client can be shaded. The property is evaluated each time it is invoked. Because of that there is no notify signal.

booltransient: Whether the Client is a transient Window to another Window. transientFor

KWin::ClienttransientFor: The Client to which this Client is a transient if any.

QSizebasicUnit: By how much the window wishes to grow/shrink at least. Usually QSize(1,1). MAY BE DISOBEYED BY THE WM! It's only for information, do NOT rely on it at all. The value is evaluated each time the getter is called. Because of that no changed signal is provided.

boolmove: Whether the Client is currently being moved by the user. Notify signal is emitted when the Client starts or ends move/resize mode.

boolresize: Whether the Client is currently being resized by the user. Notify signal is emitted when the Client starts or ends move/resize mode.

boolspecialWindow: Returns whether the window is any of special windows types (desktop, dock, splash, ...), i.e. window types that usually don't have a window frame and the user does not use window management (moving, raising,...) on them. The value is evaluated each time the getter is called. Because of that no changed signal is provided.

boolwantsInput: Whether the Client can accept keyboard focus. The value is evaluated each time the getter is called. Because of that no changed signal is provided.

QPixmapicon

KWin::TabGrouptabGroup: The "Window Tabs" Group this Client belongs to.

boolisCurrentTab: Whether this Client is the currently visible Client in its Client Group (Window Tabs). For change connect to the visibleChanged signal on the Client's Group.

QSizeminSize: Minimum size as specified in WM_NORMAL_HINTS

QSizemaxSize: Maximum size as specified in WM_NORMAL_HINTS

Read-write Properties

intdesktop: The desktop this Client is on. If the Client is on all desktops the property has value -1.Returns the virtual desktop within the workspace() the client window is located in, 0 if it isn't located on any special desktop (not mapped yet), or NET::OnAllDesktops. Do not use desktop() directly, use isOnDesktop() instead.

boolonAllDesktops: Whether the Client is on all desktops. That is desktop is -1.

boolfullScreen: Whether this Client is fullScreen. A Client might either be fullScreen due to the _NET_WM property or through a legacy support hack. The fullScreen state can only be changed if the Client does not use the legacy hack. To be sure whether the state changed, connect to the notify signal.

QRectgeometry: The geometry of this Client. Be aware that depending on resize mode the geometryChanged signal might be emitted at each resize step or only at the end of the resize operation.

boolkeepAbove: Whether the Client is set to be kept above other windows.

boolkeepBelow: Whether the Client is set to be kept below other windows.

boolminimized: Whether the Client is minimized.

boolshade: Whether the Client is shaded.

boolskipSwitcher: Whether the Client should be excluded from window switching effects.

boolskipTaskbar: Indicates that the window should not be included on a taskbar.

boolskipPager: Indicates that the window should not be included on a Pager.

boolnoBorder: Whether the window has a decoration or not. This property is not allowed to be set by applications themselves. The decision whether a window has a border or not belongs to the window manager. If this property gets abused by application developers, it will be removed again.

booldemandsAttention: Whether window state _NET_WM_STATE_DEMANDS_ATTENTION is set. This state indicates that some action in or with the window happened. For example, it may be set by the Window Manager if the window requested activation but the Window Manager refused it, or the application may set it if it finished some work. This state may be set by both the Client and the Window Manager. It should be unset by the Window Manager when it decides the window got the required attention (usually, that it got activated).

boolblocksCompositing: A client can block compositing. That is while the Client is alive and the state is set, Compositing is suspended and is resumed when there are no Clients blocking compositing any more.This is actually set by a window property, unfortunately not used by the target application group. For convenience it's exported as a property to the scripts.Use with care!

Functions

closeWindow(): Closes the window by either sending a delete_window message or using XKill.

booltabBefore(Client *other, bool activate)

booltabBehind(Client *other, bool activate)

syncTabGroupFor(QString property, bool fromThisClient=false): Syncs the dynamic property fromThisClient or the to all members of the tabGroup() (if there is one) eg. if you call: client->setProperty("kwin_tiling_floats", true); client->syncTabGroupFor("kwin_tiling_floats", true) all clients in this tabGroup will have ::property("kwin_tiling_floats").toBool() == true WARNING: non dynamic properties are ignored - you're not supposed to alter/update such explicitly