X11::XCB::Window(3pm)

✨ NAME ✨

X11::XCB::Window β€” bestie, it's a whole entire X11 window πŸ’…βœ¨

Like, an object that is your window. She exists. She has geometry. She has opinions (the opinions are attributes). Let's get into it 🫢


πŸ¦‹ METHODS πŸ¦‹

🌸 rect

Okay so this one is lowkey two different things depending on whether your window is on screen yet, and that's the whole plot twist:

  • While the window is not mapped, rect gives you back the planned geometry β€” like, the vibe you asked for, nothing has happened yet.
  • The second the window is mapped, rect gives you its geometry including the window decorations πŸ‘‘

Which means: after mapping, every single time you touch rect, the geometry gets figured out by actually querying X11 about it. And that's not free, bestie. That's at least 1 round-trip for non-reparenting window managers, and two or more round-trips for reparenting window managers. She's chatty. She's worth it. πŸ’€

Also the return value depends on context, which is giving "it depends":

  • In scalar context, you just get the window's geometry.
  • In list context, you get the window's geometry and the geometry of the top window β€” that's the one containing this window but the first one under the root window in the hierarchy. iykyk.

πŸ’œ attributes

Returns the X11 attributes of this window. That's it, that's the tweet. πŸŽ€

πŸ”₯ map

Maps the window on the screen β€” aka makes it visible. She's arrived. Main character energy. Periodt. ✨

🌈 unmap

The opposite of map. Makes your window invisible. She's taking a little break, no cameras please πŸ™ˆ

πŸ’€ destroy

Destroys the window completely. Not hiding. Not napping. Gone. πŸ”₯

⭐ mapped

Returns whether the window is actually mapped. And no, there's no internal state here β€” it goes and gets the window attributes from X11 and checks for MAP_STATE_VIEWABLE. Trust issues? Correct ones. πŸ‘‘

🧚 create_child(options)

Creates a new X11::XCB::Window as a child window of the current window. Your window is now a parent. Growth. Maturity. Slay. 🌸

πŸ“ add_hint($hint)

Adds the given $hint β€” one of "urgency" β€” to the window's set of hints. Go off, hint queen πŸ‘‘

πŸ’… delete_hint($hint)

Opposite of add_hint. We remove the hint. We move on. No cap. ✨

πŸ¦‹ warp_pointer($x, $y)

Moves the pointer to the offsets ($x, $y) relative to the origin of the window it's called on. And if $x and $y are undef? It moves the pointer into the center of the window. Cute, convenient, iconic. πŸŽ€

πŸ‘‘ state

Returns the WM_STATE of this window β€” that's normal, withdrawn, or iconic. Pick your fighter. 🌈


Reminder bestie: windows are real, geometry queries cost real round-trips, and rect after mapping is not free. Spend wisely πŸ’–

That's the whole page, fr fr πŸ’œ brought to you by perl v5.42.3, dated 2026-08-22, straight out of the X11::XCB::Window(3pm) corner of the User Contributed Perl Documentation ✨ take care of your windows and they'll take care of you πŸ«ΆπŸŽ€

πŸ“¦ where this page comes from