Development/Tutorials/KWin/Scripting/API

From KDE TechBase
Revision as of 23:19, 14 December 2011 by Vmax0770 (talk | contribs) (→‎unfinished)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

workspace[singleton]

Events

workspace.currentDesktopChanged

  • Emitted when the user switches from a virtual desktop to another.
    • old_desk {integer}: The number of the virtual desktop the user switched from.


workspace.desktopPresenceChanged

  • Emitted whenever a client is moved across virtual desktops. The client's previous desktop is available through the old_desk parameter, whereas the current desktop can be fetched using moved_client.desktop
    • moved_client {client}: The client which was moved from desktop old_desk to the new one
    • old_desk {integer}: The previous desktop on which the client was present


workspace.clientAdded

  • Emitted whenever a new client is added to the workspace. This generally occurs when a new window is opened which includes dialog boxes, windows etc. However, it is NOT emitted for unmanaged clients like the Alt+Tab switcher.
    • added_client {client}: The client which was added.


workspace.clientManaging

  • Emitted whenever a client is being managed by the KWin subsystem. The difference between workspace.clientManaging and workspace.clientAdded is that clientManaging is emitted BEFORE clientAdded. Also, if KWin is restarted with a list of clients C, then the clientManaging event will be emitted for every client in C, but clientAdded will not.
    • managing_client {client}: The client which is being managed.


workspace.clientMinimized

  • Emitted whenever a client is minimized.
    • minimized_client {client}: The client which was minimized.


workspace.clientMaximizeSet

  • Emitted whenever a client is maximized in a particular orientation. The orientation i.e. the rectangular direction in which the client was specified to occupy the entire available space is specified by the two parameters horizontally and vertically. If both are true, the client was maximized fully i.e. asked to occupy the entire workspace are available.
    • maximized_client {client}: The client which was maximized (in a certain orientation).
    • horizontally {boolean}: (true) if the client was maximized horizontally, (false) otherwise.
   vertically {boolean}: (true) if the client was maximized vertically, (false) otherwise.

workspace.killWindowCalled

Emitted whenever the user requests a Kill Window [generally using the Ctrl+Esc combination]. The parameter killwindow_client is not completely safe and may return kill windows out of order of invocation. This is just a fancy function, avoid using. Instead, use workspace.clientAdded and filter for incoming Kill Windows.

   killwindow_client {client}: The client handle to the kill window that was called.

workspace.clientActivated

Emitted whenever a client is given focus or 'activated'.

   activated_client {client}: The client which was activated (or received focus).

workspace.clientFullScreenSet

Emitted whenever a client is set to full screen or unset. The fss_set parameter can be used to determine whether the client was set or unset.

   fss_set {boolean}: (true) if the client was switched to full screen mode, (false) if it was switched from full screen mode.
   fss_client {client}: The client which was set/unset to fullscreen.

workspace.clientUnminimized

Emitted whenever a client is Unminimized (or restored).

   unm_client {client}: The client which was unminimzed.