#Xlib

Stephan Sokolowssokolow@qoto.org
2025-06-22

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.

gist.github.com/ssokolow/74c8b

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

Felix Palmen :freebsd: :c64:zirias@bsd.cafe
2024-07-06

@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 ;)

Felix Palmen :freebsd: :c64:zirias@bsd.cafe
2024-06-28

@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)

Felix Palmen :freebsd: :c64:zirias@bsd.cafe
2024-06-13

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 πŸ€ͺ

github.com/Zirias/xmoji/blob/e

Felix Palmen :freebsd: :c64:zirias@bsd.cafe
2024-05-23

@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... πŸ˜‰

Alfred M. Szmidtamszmidt
2023-09-18

Anyone know how on earth X11 programs generally handle -geometry option? Looking at xeyes there is nothing that parses/handles it .. :-(

2023-08-24

πŸ–ŒοΈ #AzPainter Resources: Brushes, Textures, Themes & UI Layouts (#GIMP- and #Krita-like) by 'pistachio' β€” gitlab.com/pistachio-gitlab/Az
πŸ’‘ 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).

AzPainter BrushesGIMP-like UI layoutKrita-like UI layout
Thomas Cherryhomestschak@oldbytes.space
2023-08-05

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: github.com/tschak909/battery-m

Thomas Cherryhomestschak@oldbytes.space
2023-08-05

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.

unclechuunclechu
2021-04-17

Recently I released my old I personally was using for last few years called β€œplace-cursor-at” written in (built on top of ). It helps to move your mouse cursor around your screens to specific approximate positions. Generally it helps to use the keyboard more and less the mouse.

It was released on and . And now it’s also available in and 20.09. Give it a try:

nix-shell -p place-cursor-at --run place-cursor-at

github.com/unclechu/place-curs

Client Info

Server: https://mastodon.social
Version: 2025.04
Repository: https://github.com/cyevgeniy/lmst