Skip to content

Class pinnacle.window.WindowHandle

A window handle.

This is a handle to an application window that allows manipulation of the window.

If the window is destroyed, the handle will become invalid and may not do what you want it to.

You can retrieve window handles through the various get functions in the Window module.

Fields

id

id: integer

Functions

method close

function pinnacle.window.WindowHandle:close()

Sends a close request to this window.

method set_geometry

function pinnacle.window.WindowHandle:set_geometry(geo: { x: integer, y: integer, width: integer, height: integer })

Sets this window's location and/or size.

The coordinate system has the following axes:

       ^ -y
       |
 -x <--+--> +x
       |
       v +y

Tiled windows will not reflect these changes. This method only applies to this window's floating geometry.

Example

lua
local focused = Window.get_focused()
if focused then
    focused:set_floating(true)                     -- `set_geometry` only applies to floating geometry.

    focused:set_geometry({ x = 50, y = 300 })      -- Move this window to (50, 300)
    focused:set_geometry({ y = 0, height = 1080 }) -- Move this window to y = 0 and make its height 1080 pixels
    focused:set_geometry({})                       -- Do nothing useful
end

Parameters

geo: { x: integer, y: integer, width: integer, height: integer } - The new location and/or size

method set_fullscreen

function pinnacle.window.WindowHandle:set_fullscreen(fullscreen: boolean)

Sets this window to fullscreen or not.

Parameters

fullscreen: boolean

method toggle_fullscreen

function pinnacle.window.WindowHandle:toggle_fullscreen()

Toggles this window to and from fullscreen.

method set_maximized

function pinnacle.window.WindowHandle:set_maximized(maximized: boolean)

Sets this window to maximized or not.

Parameters

maximized: boolean

method toggle_maximized

function pinnacle.window.WindowHandle:toggle_maximized()

Toggles this window to and from maximized.

method set_floating

function pinnacle.window.WindowHandle:set_floating(floating: boolean)

Sets this window to floating or not.

Parameters

floating: boolean

method toggle_floating

function pinnacle.window.WindowHandle:toggle_floating()

Toggles this window to and from floating.

method set_focused

function pinnacle.window.WindowHandle:set_focused(focused: boolean)

Focuses or unfocuses this window.

Parameters

focused: boolean

method toggle_focused

function pinnacle.window.WindowHandle:toggle_focused()

Toggles this window to and from focused.

method set_decoration_mode

function pinnacle.window.WindowHandle:set_decoration_mode(mode: "client_side" | "server_side")

Sets this window's decoration mode.

Parameters

mode: "client_side" | "server_side"

method move_to_tag

function pinnacle.window.WindowHandle:move_to_tag(tag: pinnacle.tag.TagHandle)

Moves this window to the specified tag.

This will remove all tags from this window and add the tag tag.

Parameters

tag: pinnacle.tag.TagHandle - The tag to move this window to

method set_tag

function pinnacle.window.WindowHandle:set_tag(tag: pinnacle.tag.TagHandle, set: boolean)

Adds or removes the given tag to or from this window.

Parameters

tag: pinnacle.tag.TagHandle - The tag to set or unset
set: boolean

method toggle_tag

function pinnacle.window.WindowHandle:toggle_tag(tag: pinnacle.tag.TagHandle)

Toggles the given tag on this window.

Parameters

tag: pinnacle.tag.TagHandle - The tag to toggle

method raise

function pinnacle.window.WindowHandle:raise()

Raises a window.

This will bring the window to the front.

method is_on_active_tag

function pinnacle.window.WindowHandle:is_on_active_tag()
    -> boolean

Returns whether or not this window is on an active tag.

Returns

  1. boolean

method loc

function pinnacle.window.WindowHandle:loc()
    -> { x: integer, y: integer }

Gets this window's location.

Returns

  1. { x: integer, y: integer }

method size

function pinnacle.window.WindowHandle:size()
    -> { width: integer, height: integer }

Gets this window's location.

Returns

  1. { width: integer, height: integer }

method app_id

function pinnacle.window.WindowHandle:app_id()
    -> string

Gets this window's class.

Returns

  1. string

method title

function pinnacle.window.WindowHandle:title()
    -> string

Gets this window's title.

Returns

  1. string

method focused

function pinnacle.window.WindowHandle:focused()
    -> boolean

Gets whether or not this window is focused.

Returns

  1. boolean

method floating

function pinnacle.window.WindowHandle:floating()
    -> boolean

Gets whether or not this window is floating.

Returns

  1. boolean

method tiled

function pinnacle.window.WindowHandle:tiled()
    -> boolean

Gets whether this window is tiled.

Returns

  1. boolean

method fullscreen

function pinnacle.window.WindowHandle:fullscreen()
    -> boolean

Gets whether this window is fullscreen.

Returns

  1. boolean

method maximized

function pinnacle.window.WindowHandle:maximized()
    -> boolean

Gets whether this window is maximized.

Returns

  1. boolean

method tags

function pinnacle.window.WindowHandle:tags()
    -> pinnacle.tag.TagHandle[]

Gets all tags on this window.

Returns

  1. pinnacle.tag.TagHandle[]