XdbeSwapBuffers(3)
π XdbeSwapBuffers β the manual, but make it make sense π
okay bestie, so you know how this whole page is from the X FUNCTIONS part of the X library? yeah. and the function itself is called XdbeSwapBuffers, and it lives in manpage section 3 (that's the "C library functions" section, iykyk). let's get into it π«Ά
β¨ NAME β¨
XdbeSwapBuffers β swaps front and back DBE buffers. that's it, that's the whole job. she flips them. iconic behavior honestly π
π SYNOPSIS π
#include <X11/extensions/Xdbe.h>
Status XdbeSwapBuffers(
Display *dpy,
XdbeSwapInfo *swap_info,
int num_windows)
three args, no notes. β¨
π¦ DESCRIPTION π¦
so what she DOES: this function swaps the front and back buffers for a whole list of windows. not just one. a list. she's a multitasker, she ate π₯
num_windowstells you how many windows are getting their buffers swapped β literally, it's the number of elements in theswap_infoarray. no more, no less.swap_infois the tea π΅ β it's the per-window info the function needs to actually do each swap.
and the XdbeSwapInfo structure? she has these two fields:
Window swap_window
XdbeSwapAction swap_action
swap_windowβ which window we're swapping buffers for.swap_actionβ which swap action to use for thatswap_window. (they're a matched pair, a duo, a little unit π«Ά)
now, swap_action is the interesting part, because it decides what happens to the new back buffer of the swap_window it's paired with β on top of making the old back buffer visible. the defined actions are:
XdbeUndefinedβ the contents of the new back buffer become undefined. sounds scary but it's actually the efficient one: it lets the implementation just yeet the buffer contents if it wants to. fastest glow-up available πβ¨XdbeBackgroundβ the unobscured region of the new back buffer gets tiled with the window background. this one lets devices use a fast clear capability during a swap, which is a slay.XdbeUntouchedβ the unobscured region of the new back buffer is left unmodified by the swap. she simply did not touch her.XdbeCopiedβ the unobscured region of the new back buffer becomes the contents of the old back buffer. copy-paste core π
πΈ ERRORS πΈ
she can throw hands (errors). here's the list, no skipping:
BadMatchβ you specified a window that isn't double-buffered, OR you specified the same window twice. rude. pick a lane bestie πBadWindowβ you specified a window that's just... invalid. doesn't exist. ghosted.BadValueβ you specified an invalid swap action. not a real one. made up. π
lowkey important: these are actual errors that get raised, not vibes. check your windows and your actions before you call her, fr fr.
π SEE ALSO π
go read these next, bestie, they're all part of the same friend group:
DBEXdbeAllocateBackBufferName()XdbeBeginIdiom()XdbeDeallocateBackBufferName()XdbeEndIdiom()XdbeFreeVisualInfo()XdbeGetBackBufferAttributes()XdbeGetVisualInfo()XdbeQueryExtension()
and that's the whole page π«Ά this came to you courtesy of X Version 11 and libXext 1.3.6, and yes, this is XdbeSwapBuffers(3) β section 3, exactly where she belongs. go swap some buffers, you've got this πβ¨πΈ
π¦ where this page comes from
- alpine 3.22: libxext-doc 1.3.6-r2 Β· MIT
- alpine 3.23: libxext-doc 1.3.6-r2 Β· MIT
- centos-stream 10: libXext-devel 1.3.6-3.el10 Β· MIT-open-group AND X11 AND HPND AND HPND-sell-variant AND SMLNJ AND MIT AND ISC AND HPND-doc AND HPND-doc-sell
- fedora 43: libXext-devel 1.3.6-4.fc43 Β· MIT-open-group AND X11 AND HPND AND HPND-sell-variant AND SMLNJ AND MIT AND ISC AND HPND-doc AND HPND-doc-sell
- fedora 43: libXext-devel 1.3.6-4.fc43 Β· MIT-open-group AND X11 AND HPND AND HPND-sell-variant AND SMLNJ AND MIT AND ISC AND HPND-doc AND HPND-doc-sell
- fedora 44: libXext-devel 1.3.6-5.fc44 Β· MIT-open-group AND X11 AND HPND AND HPND-sell-variant AND SMLNJ AND MIT AND ISC AND HPND-doc AND HPND-doc-sell
- fedora 44: libXext-devel 1.3.6-5.fc44 Β· MIT-open-group AND X11 AND HPND AND HPND-sell-variant AND SMLNJ AND MIT AND ISC AND HPND-doc AND HPND-doc-sell
- opensuse-leap 16.0: libXext-devel 1.3.6-160000.3.2 Β· MIT
- opensuse-leap 16.0: libXext-devel 1.3.6-160000.3.2 Β· MIT
- opensuse-leap 16.0: libXext-devel 1.3.6-160000.3.2 Β· MIT
- opensuse-leap 16.0: libXext-devel 1.3.6-160000.3.2 Β· MIT
- Copyright (c) 1995 Hewlett-Packard Company
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms