XINERAMA(3)
π XINERAMA(3) π
okay bestie, so this is the Xinerama library manual page, part of the X11 library functions family, and it's basically the β¨glow-upβ¨ API for the Xinerama extension to the X11 Protocol. sit with me, we're gonna get you fluent. π¦
β¨ NAME β¨
Xinerama β the API for the Xinerama extension to the X11 Protocol. that's it, that's the whole vibe. π
π SYNOPSIS π
first things first, you gotta pull in the header, no cap:
#include <X11/extensions/Xinerama.h>
then here come the four functions, and yes they're giving main character energy:
Bool XineramaQueryExtension (Display *dpy,
int *event_base_return, int *error_base_return);
Status XineramaQueryVersion (Display *dpy,
int *major_version_return,
int *minor_version_return);
Bool XineramaIsActive (Display *dpy);
XineramaScreenInfo * XineramaQueryScreens (Display *dpy,
int *number);
literally copy these exactly, don't freestyle the signatures, i'm begging π«Ά
πΈ ARGUMENTS πΈ
here's the cast of characters, everyone plays a role:
displayβ specifies the connection to the X server. it's your link to the whole situation. πevent_base_returnβ the spot where the assigned base event code gets returned. π₯error_base_returnβ the spot where the assigned base error code gets returned. π₯major_version_returnβ returns the major version that the server supports.minor_version_returnβ returns the minor version that the server supports.numberβ returns how many entries are in theXineramaScreenInfoarray you get back. count 'em, bestie. π’
π DESCRIPTION π
so Xinerama is a simple library β and like, genuinely simple, not "simple" in the way people describe a 400-line shell script β designed to interface the Xinerama Extension. its whole job? retrieving information about physical output devices that may be combined into a single logical X screen. yes queen, multiple monitors, one screen, we love to see it. π₯οΈπ₯οΈβ‘οΈπ₯οΈ
π FUNCTIONS π
π XineramaQueryExtension()
this one queries the X server to figure out whether the Xinerama Extension is even available. like a vibe check but for protocol extensions.
- if the extension is available: the return value is
True, andevent_base_returnanderror_base_returnget set to the base event number and base error number for the extension, respectively. slay. β - otherwise: the return value is
False, and the values ofevent_base_returnanderror_base_returnare undefined.
β οΈ bestie, pay attention to that last bit: undefined. do NOT go reading those out params when you got a False back. that's not a vibe, that's undefined behavior territory. π
π XineramaQueryVersion()
this one returns the version of the Xinerama extension that the X server has implemented. the version lands in major_version_return and minor_version_return.
here's the versioning tea β:
- the major version gets incremented for protocol incompatible changes β big changes, break-y changes.
- the minor version gets incremented for small, upwardly compatible changes β lil baby changes, everyone's fine.
and the return value?
- if the Xinerama library is compatible with the version the server returned, it returns nonzero.
- it returns zero if: the server doesn't support the
XINERAMAextension, or there was an error during communications with the server, or the server and library protocol versions are incompatible. π
π XineramaIsActive()
returns a Boolean operator used to determine if Xinerama is activated on the screen. that's it, that's the function. True for active, False for not active. short, sweet, iconic. β¨
π XineramaQueryScreens()
the big one. this returns info about each individual output device within the Xinerama Screen.
the integer that number points to gets updated to the number of output devices listed in the returned array of XineramaScreenInfo structures. so you hand it a pointer, it fills in the count. teamwork. π«Ά
and if Xinerama is not active? it returns NULL and sets number to 0. not a crash, just an empty party. π
π§ IMPORTANT: the pointer you get back should be released with XFree(3) when it's no longer needed. free your memory, bestie, it's the responsible thing to do. don't leak, it's not cute.
π NOTE π
the original API for interacting with the XINERAMA extension used function names beginning with XPanoramiX. that API is now deprecated β it's giving legacy, it's giving "we don't do that anymore" β and this API should be used instead in new software. so if you're writing something new, use this one. periodt. π
π and that's the whole page, bestie π
you made it to the end, i'm so proud of you, genuinely. this was libXinerama 1.1.5 out of the X Version 11 crew, and if you remember nothing else, remember: check the extension first, mind your undefined values, and always XFree(3) your pointers. mwah. ππ
X Version 11 Β· libXinerama 1.1.5 Β· XINERAMA(3) β byeeee πβ¨π¦
π¦ where this page comes from
- alpine 3.22: libxinerama-doc 1.1.5-r4 Β· MIT
- alpine 3.23: libxinerama-doc 1.1.5-r4 Β· MIT
- centos-stream 10: libXinerama-devel 1.1.5-8.el10 Β· MIT AND MIT-open-group AND X11
- fedora 43: libXinerama-devel 1.1.5-9.fc43 Β· MIT AND MIT-open-group AND X11
- fedora 43: libXinerama-devel 1.1.5-9.fc43 Β· MIT AND MIT-open-group AND X11
- fedora 44: libXinerama-devel 1.1.5-10.fc44 Β· MIT AND MIT-open-group AND X11
- fedora 44: libXinerama-devel 1.1.5-10.fc44 Β· MIT AND MIT-open-group AND X11
- opensuse-leap 16.0: libXinerama-devel 1.1.5-160000.3.2 Β· MIT
- opensuse-leap 16.0: libXinerama-devel 1.1.5-160000.3.2 Β· MIT
- opensuse-leap 16.0: libXinerama-devel 1.1.5-160000.3.2 Β· MIT
- opensuse-leap 16.0: libXinerama-devel 1.1.5-160000.3.2 Β· MIT
- Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms