XRaiseWindow(3)
π XRaiseWindow(3) β the Xlib window-stacking glow-up π
okay bestie, so this is a page from the XLIB FUNCTIONS manual, and it's literally all about who gets to be in front β the window stacking order drama π. Six functions, one whole vibe: raise, lower, circulate, restack. Keep up, it's giving main character energy.
β¨ NAME β¨
XRaiseWindow, XLowerWindow, XCirculateSubwindows, XCirculateSubwindowsUp, XCirculateSubwindowsDown, XRestackWindows β all of these change window stacking order. That's it. That's the whole assignment π
π¦ SYNTAX π¦
int XRaiseWindow(Display *display, Window w);
int XLowerWindow(Display *display, Window w);
int XCirculateSubwindows(Display *display, Window w, int direction);
int XCirculateSubwindowsUp(Display *display, Window w);
int XCirculateSubwindowsDown(Display *display, Window w);
int XRestackWindows(Display *display, Window windows[], int nwindows);
look at all those little ints, so consistent, we stan a predictable return type π«Ά
πΈ ARGUMENTS πΈ
directionβ the direction (up or down) you want to circulate the window in. You can passRaiseLowestorLowerHighest. pick your fighter β¨displayβ the connection to the X server. your whole link to the mothership πnwindowsβ how many windows are getting restacked.wβ the window. the one. the main character πwindowsβ an array containing the windows to be restacked. it's an ensemble cast, not a solo π
π₯ DESCRIPTION π₯
So, XRaiseWindow β it raises the specified window to the top of the stack so that no sibling window obscures it. And the manual has this iconic analogy: if the windows are regarded as overlapping sheets of paper stacked on a desk, then raising a window is analogous to moving the sheet to the top of the stack but leaving its x and y location on the desk constant. cute, right? πβ¨
Raising a mapped window may generate Expose events for the window and any mapped subwindows that were formerly obscured. Heads up, bestie β those events are coming whether you're ready or not π
And now the bouncer clause: if the override-redirect attribute of the window is False and some other client has selected SubstructureRedirectMask on the parent, the X server generates a ConfigureRequest event, and no processing is performed. Otherwise, the window is raised. iykyk πͺ
XRaiseWindow can generate a BadWindow error.
XLowerWindow is the exact opposite energy π₯ β it lowers the specified window to the bottom of the stack so that it does not obscure any sibling windows. Same paper-on-desk analogy: if the windows are regarded as overlapping sheets of paper stacked on a desk, then lowering a window is analogous to moving the sheet to the bottom of the stack but leaving its x and y location on the desk constant.
Lowering a mapped window will generate Expose events on any windows it formerly obscured. not "may". will. no cap π
Same bouncer clause, lowercase edition: if the override-redirect attribute of the window is False and some other client has selected SubstructureRedirectMask on the parent, the X server generates a ConfigureRequest event, and no processing is performed. Otherwise, the window is lowered to the bottom of the stack.
XLowerWindow can generate a BadWindow error.
XCirculateSubwindows β this one circulates children of the specified window in the specified direction. Here's the tea π΅:
- If you specify
RaiseLowest,XCirculateSubwindowsraises the lowest mapped child (if any) that is occluded by another child to the top of the stack. - If you specify
LowerHighest,XCirculateSubwindowslowers the highest mapped child (if any) that occludes another child to the bottom of the stack.
Exposure processing is then performed on formerly obscured windows. Then: if some other client has selected SubstructureRedirectMask on the window, the X server generates a CirculateRequest event, and no further processing is performed. And if a child is actually restacked, the X server generates a CirculateNotify event. so many events, so little time β
XCirculateSubwindows can generate BadValue and BadWindow errors.
XCirculateSubwindowsUp raises the lowest mapped child of the specified window that is partially or completely occluded by another child. Completely unobscured children are not affected β they already slayed, they don't need help π
This is a convenience function equivalent to XCirculateSubwindows with RaiseLowest specified. short and sweet, we love a shortcut π
XCirculateSubwindowsUp can generate a BadWindow error.
XCirculateSubwindowsDown lowers the highest mapped child of the specified window that partially or completely occludes another child. Completely unobscured children are not affected β again, untouched, unbothered, moisturized π§
This is a convenience function equivalent to XCirculateSubwindows with LowerHighest specified.
XCirculateSubwindowsDown can generate a BadWindow error.
XRestackWindows restacks the windows in the order specified, from top to bottom. Read carefully bestie, this part is a whole paragraph of β¨ nuance β¨:
- The stacking order of the first window in the
windowsarray is unaffected. - The other windows in the array are stacked underneath the first window, in the order of the array.
- The stacking order of the other windows is not affected.
β οΈ For each window in the window array that is not a sibling of the first window, a BadMatch error results. fr fr, check your siblings first.
And the bouncer clause again, plural this time: if the override-redirect attribute of a window is False and some other client has selected SubstructureRedirectMask on the parent, the X server generates ConfigureRequest events for each window whose override-redirect flag is not set, and no further processing is performed. Otherwise, the windows will be restacked in top-to-bottom order. π
XRestackWindows can generate BadWindow error.
π DIAGNOSTICS π
BadValueβ Some numeric value falls outside the range of values accepted by the request. Unless a specific range is specified for an argument, the full range defined by the argument's type is accepted. Any argument defined as a set of alternatives can generate this error. so basically, if you colour outside the lines ποΈBadWindowβ A value for aWindowargument does not name a definedWindow. you just made that window up, bestie π
π SEE ALSO π
go read these next, they're all connected, it's a whole cinematic universe π
XChangeWindowAttributes(3)XConfigureWindow(3)XCreateWindow(3)XDestroyWindow(3)XMapWindow(3)XUnmapWindow(3)Xlib - C Language X Interface
π«Ά the sign-off π«Ά
and that's the whole page, bestie!! this is X Version 11, libX11 1.8.14, and it's the XRaiseWindow(3) page β go forth and stack responsibly. periodt πβ¨ππ¦
ngl if you got all the way down here you're genuinely so good at Unix, ily, now go raise some windows π
π¦ where this page comes from
- alpine 3.24: libx11-doc 1.8.14-r0 Β· X11
- arch rolling: libx11 1.8.14-1 Β· MIT AND X11
- nixos 26.05: libx11 1.8.14
- nixpkgs unstable: libx11 1.8.14
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms