Skip to content

Wayland: Position a window absolutely on the screen #1397

@ewancg

Description

@ewancg

I am wondering if there's a way to position a window absolutely on the screen when eww is running under Wayland.

(defwindow overlay [screen]
      :id "overlay"
      :monitor screen
      :geometry (geometry :x "0px"
                          :y "0px"
                          :width "100%"
                          :height "100%"
                          :anchor "bottom center")
      :namespace "overlay"
      :wm-ignore true
      :exclusive false
      :focusable false
      (box)
    )

In my opinion, a window ignored by the WM/compositor or with the "overlay" namespace should have its x and y parameters refer to the absolute screen dimensions, not just what's remaining after other bars & non-window layers are accounted for. In that example, the anchor parameter should not have an effect on the placement of the window, yet if it's set to "top center", it'll begin at the bottom of my Waybar instance (on the "top" layer, even though I specified overlay). If I set it to "center", the overlay will overlap the bar by 50% of the bar's height. Setting the anchor to "bottom center" does what's desired, but it feels like a hack (I do not want absolute placement of a window to be dependent on whether there's another layer occupying the bottom of the screen). Is there a way to get this behavior reliably without messing with the anchor? There could be something about the existing options that I'm misunderstanding.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions