Aca programando y dandole matraca a la libreria grafica de bajo nivel XCB, dentro de un docker con Alpine Linux.
Es mas rapido, chiquito (no dependencias) y directo que la famosa SDL, pero al precio de escribir mas, es mas complejo por que expone el subsistema X sin pudor! , y lo peor , muy poca documentacion ! Y ni la IA te salva ! Cual es mi meta (ya perdida) ? escribir el backend de la libreria Nuklear solo en xcb, luego usar la como interfaz para otro proyecto mas loco tipo juego Cataclysm DDA o Space Station 13 (MMORPG)... Pero casi seguro va derecho al cementerio. Pero es la diversion (o locura?) de hacer que aparezca algo en pantalla y se mueva... terrible.... #xcb #graphics #x11 #xlib #linux #gui

Since the Thunderbird people just duped bug 1947722 (support for disabling hiding the Quick Filter bar on Esc keypresses) against bug 1922924 (disable Esc when filter settings are pinned), here's a little python-xlib hack for the ACTUALLY desired functionality by filtering events.

https://gist.github.com/ssokolow/74c8bda3dafc133e615e3152b815196f

Wayland users will have to force their Thunderbird to run as an X11 app via XWayland or Wayland's security model will prevent this from working.

#linux #bsd #x11 #xlib #python #thunderbird

Helper to keep the Thunderbird Quick Filter Bar from seeing Escape keypresses

Helper to keep the Thunderbird Quick Filter Bar from seeing Escape keypresses - thunderbird_esc_fix.py

Gist
@puppygirlhornypost @stefano #Xlib should be deprecated indeed for various design flaws, so I use #xcb, but on a conceptual level it's not that much of a difference, with "raw X11", I mean issuing X11 protocol requests and handling X11 protocol events ;)

@nuintari Depends on where you come from 😉 You'll certainly need C knowledge (at least if you want to use #xcb directly) and a good understanding of how to design #OOP and implement it with C (at least IMHO, OOP is the only sane way for modelling a GUI).

For me, the biggest issue so far was the severe "under-documentation" of #xcb. I could solve puzzles using a combination of

- checking #Xlib documentation
- reading xcb header files and actual source code
- reading some other code using xcb (window managers, also Qt's xcb backend)

I got sidetracked working on #XResources support ... it all started from the wish that a child #widget should used its container's font when it doesn't have its own font configured (will be helpful e.g. for tooltips...)

Now I also integrated command-line overrides for resources in my XRdb resource database implementation, which is very cool. Actually, this system slightly reminds of CSS ... I can configure the looks of my #X11 application very flexibly!

Last thing I added was support for more formats to specify colors, plus querying the X server for named colors 😎.

#TIL: #XLib has some "color management" code and can parse and convert color specifications in different color spaces. 🤯 Ok, I don't want to link XLib (only #xcb), and I won't implement *this* myself, #RGB and #RGBA (together with "well-known" X11 color names) should really be all you ever need 🤪

https://github.com/Zirias/xmoji/blob/e342bd7612b9ce953849e2e8b374591d61c22d5b/src/bin/xmoji/colorset.c#L224

xmoji/src/bin/xmoji/colorset.c at e342bd7612b9ce953849e2e8b374591d61c22d5b · Zirias/xmoji

Contribute to Zirias/xmoji development by creating an account on GitHub.

GitHub

@thomasadam Adventures in #X11 #programming using #xcb ... I think I discovered some strange (and, undocumented?) behavior in #Xorg.

Getting more seemingly(!) "stray" Expose events, I finally discovered what's happening. I already decoupled my drawing logic from handling Expose, and instead maintain information in a widget whether it's visible and invalidated (with invalidation triggered by whatever, e.g. an Expose event). Only after processing a batch of input from the X server, I check whether a widget is both visible and invalidated, and if yes, draw it. So far a common pattern to avoid excessive drawing.

Now, setting the "root" widget (the window) visible as soon as a MapNotify is received, this *could* lead to start drawing before receiving the first Expose. Drawing still works perfectly fine, but this somehow delays the Expose event until something else "happens" to the window (like moving it), then you suddenly receive this Expose ... 🤯

Solution: Only set the window "visble" after the first Expose event is received...

I guess it would be impossible to trigger this with #Xlib because its API makes you wait for the response to every request... 😉

Anyone know how on earth X11 programs generally handle -geometry option? Looking at xeyes there is nothing that parses/handles it .. :-( #x11 #xlib
🖌️ #AzPainter Resources: Brushes, Textures, Themes & UI Layouts (#GIMP- and #Krita-like) by 'pistachio' — https://gitlab.com/pistachio-gitlab/AzPainter-Resources
💡 AzPainter is a #painting app & raster image editor, supporting #PSD format, layers (including text layers) with layer effects.
App, written in C with a GUI based on an own widget set ("mlk") for #Xlib-#libX11-#X11, is available for Unix-like OS (#Linux, #FreeBSD, etc.) and ported to #Haiku-#HaikuOS (via #Xlibe), #Mac-#macOS (via #XQuartz) & #Android (via #Termux).
pistachio-gitlab / AzPainter-Resources · GitLab

GitLab.com

GitLab
I needed an extremely simple battery meter for my minimal #arch #linux #X11 environment on my Thinkpad T61, so I wrote one in raw #Xlib. Code here: https://github.com/tschak909/battery-meter
GitHub - tschak909/battery-meter: A Battery meter for X11 written in pure Xlib.

A Battery meter for X11 written in pure Xlib. Contribute to tschak909/battery-meter development by creating an account on GitHub.

GitHub
I needed a battery meter, so I wrote one in plain #X11 using only #xlib. program size? 17.2 kilobytes. #linux program release on #github soon. just want to clean it up a bit.