fosstodon.org is one of the many independent Mastodon servers you can use to participate in the fediverse.
Fosstodon is an invite only Mastodon instance that is open to those who are interested in technology; particularly free & open source software. If you wish to join, contact us for an invite.

Administered by:

Server stats:

10K
active users

#xlib

0 posts0 participants0 posts today
Felix Palmen :freebsd: :c64:<p><span class="h-card" translate="no"><a href="https://transfem.social/@puppygirlhornypost" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>puppygirlhornypost</span></a></span> <span class="h-card" translate="no"><a href="https://mastodon.bsd.cafe/@stefano" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>stefano</span></a></span> <a href="https://mastodon.bsd.cafe/tags/Xlib" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Xlib</span></a> should be deprecated indeed for various design flaws, so I use <a href="https://mastodon.bsd.cafe/tags/xcb" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>xcb</span></a>, 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 ;)</p>
Felix Palmen :freebsd: :c64:<p><span class="h-card" translate="no"><a href="https://infosec.exchange/@nuintari" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>nuintari</span></a></span> Depends on where you come from 😉 You'll certainly need C knowledge (at least if you want to use <a href="https://mastodon.bsd.cafe/tags/xcb" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>xcb</span></a> directly) and a good understanding of how to design <a href="https://mastodon.bsd.cafe/tags/OOP" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>OOP</span></a> and implement it with C (at least IMHO, OOP is the only sane way for modelling a GUI).</p><p>For me, the biggest issue so far was the severe "under-documentation" of <a href="https://mastodon.bsd.cafe/tags/xcb" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>xcb</span></a>. I could solve puzzles using a combination of</p><p>- checking <a href="https://mastodon.bsd.cafe/tags/Xlib" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Xlib</span></a> documentation<br>- reading xcb header files and actual source code<br>- reading some other code using xcb (window managers, also Qt's xcb backend)</p>
Felix Palmen :freebsd: :c64:<p>I got sidetracked working on <a href="https://mastodon.bsd.cafe/tags/XResources" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>XResources</span></a> support ... it all started from the wish that a child <a href="https://mastodon.bsd.cafe/tags/widget" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>widget</span></a> should used its container's font when it doesn't have its own font configured (will be helpful e.g. for tooltips...)</p><p>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 <a href="https://mastodon.bsd.cafe/tags/X11" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>X11</span></a> application very flexibly!</p><p>Last thing I added was support for more formats to specify colors, plus querying the X server for named colors 😎.</p><p><a href="https://mastodon.bsd.cafe/tags/TIL" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>TIL</span></a>: <a href="https://mastodon.bsd.cafe/tags/XLib" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>XLib</span></a> 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 <a href="https://mastodon.bsd.cafe/tags/xcb" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>xcb</span></a>), and I won't implement *this* myself, <a href="https://mastodon.bsd.cafe/tags/RGB" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>RGB</span></a> and <a href="https://mastodon.bsd.cafe/tags/RGBA" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>RGBA</span></a> (together with "well-known" X11 color names) should really be all you ever need 🤪</p><p><a href="https://github.com/Zirias/xmoji/blob/e342bd7612b9ce953849e2e8b374591d61c22d5b/src/bin/xmoji/colorset.c#L224" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">github.com/Zirias/xmoji/blob/e</span><span class="invisible">342bd7612b9ce953849e2e8b374591d61c22d5b/src/bin/xmoji/colorset.c#L224</span></a></p>
Felix Palmen :freebsd: :c64:<p><span class="h-card" translate="no"><a href="https://bsd.network/@thomasadam" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>thomasadam</span></a></span> Adventures in <a href="https://mastodon.bsd.cafe/tags/X11" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>X11</span></a> <a href="https://mastodon.bsd.cafe/tags/programming" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>programming</span></a> using <a href="https://mastodon.bsd.cafe/tags/xcb" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>xcb</span></a> ... I think I discovered some strange (and, undocumented?) behavior in <a href="https://mastodon.bsd.cafe/tags/Xorg" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Xorg</span></a>.</p><p>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.</p><p>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 ... 🤯</p><p>Solution: Only set the window "visble" after the first Expose event is received...</p><p>I guess it would be impossible to trigger this with <a href="https://mastodon.bsd.cafe/tags/Xlib" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Xlib</span></a> because its API makes you wait for the response to every request... 😉</p>
app4soft<p>🖌️ <a href="https://fosstodon.org/tags/AzPainter" class="mention hashtag" rel="tag">#<span>AzPainter</span></a> Resources: Brushes, Textures, Themes &amp; UI Layouts (<a href="https://fosstodon.org/tags/GIMP" class="mention hashtag" rel="tag">#<span>GIMP</span></a>- and <a href="https://fosstodon.org/tags/Krita" class="mention hashtag" rel="tag">#<span>Krita</span></a>-like) by &#39;pistachio&#39; — <a href="https://gitlab.com/pistachio-gitlab/AzPainter-Resources" target="_blank" rel="nofollow noopener noreferrer" translate="no"><span class="invisible">https://</span><span class="ellipsis">gitlab.com/pistachio-gitlab/Az</span><span class="invisible">Painter-Resources</span></a><br />💡 AzPainter is a <a href="https://fosstodon.org/tags/painting" class="mention hashtag" rel="tag">#<span>painting</span></a> app &amp; raster image editor, supporting <a href="https://fosstodon.org/tags/PSD" class="mention hashtag" rel="tag">#<span>PSD</span></a> format, layers (including text layers) with layer effects.<br />App, written in C with a GUI based on an own widget set (&quot;mlk&quot;) for <a href="https://fosstodon.org/tags/Xlib" class="mention hashtag" rel="tag">#<span>Xlib</span></a>-<a href="https://fosstodon.org/tags/libX11" class="mention hashtag" rel="tag">#<span>libX11</span></a>-<a href="https://fosstodon.org/tags/X11" class="mention hashtag" rel="tag">#<span>X11</span></a>, is available for Unix-like OS (<a href="https://fosstodon.org/tags/Linux" class="mention hashtag" rel="tag">#<span>Linux</span></a>, <a href="https://fosstodon.org/tags/FreeBSD" class="mention hashtag" rel="tag">#<span>FreeBSD</span></a>, etc.) and ported to <a href="https://fosstodon.org/tags/Haiku" class="mention hashtag" rel="tag">#<span>Haiku</span></a>-<a href="https://fosstodon.org/tags/HaikuOS" class="mention hashtag" rel="tag">#<span>HaikuOS</span></a> (via <a href="https://fosstodon.org/tags/Xlibe" class="mention hashtag" rel="tag">#<span>Xlibe</span></a>), <a href="https://fosstodon.org/tags/Mac" class="mention hashtag" rel="tag">#<span>Mac</span></a>-<a href="https://fosstodon.org/tags/macOS" class="mention hashtag" rel="tag">#<span>macOS</span></a> (via <a href="https://fosstodon.org/tags/XQuartz" class="mention hashtag" rel="tag">#<span>XQuartz</span></a>) &amp; <a href="https://fosstodon.org/tags/Android" class="mention hashtag" rel="tag">#<span>Android</span></a> (via <a href="https://fosstodon.org/tags/Termux" class="mention hashtag" rel="tag">#<span>Termux</span></a>).</p>
Thomas Cherryhomes<p>I needed an extremely simple battery meter for my minimal <a href="https://oldbytes.space/tags/arch" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>arch</span></a> <a href="https://oldbytes.space/tags/linux" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>linux</span></a> <a href="https://oldbytes.space/tags/X11" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>X11</span></a> environment on my Thinkpad T61, so I wrote one in raw <a href="https://oldbytes.space/tags/Xlib" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Xlib</span></a>. Code here: <a href="https://github.com/tschak909/battery-meter" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">github.com/tschak909/battery-m</span><span class="invisible">eter</span></a></p>
Thomas Cherryhomes<p>I needed a battery meter, so I wrote one in plain <a href="https://oldbytes.space/tags/X11" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>X11</span></a> using only <a href="https://oldbytes.space/tags/xlib" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>xlib</span></a>. program size? 17.2 kilobytes. <a href="https://oldbytes.space/tags/linux" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>linux</span></a> program release on <a href="https://oldbytes.space/tags/github" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>github</span></a> soon. just want to clean it up a bit.</p>
unclechu<p>Recently I released my old <a href="https://mastodon.social/tags/utility" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>utility</span></a> I personally was using for last few years called “place-cursor-at” written in <a href="https://mastodon.social/tags/Haskell" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Haskell</span></a> (built on top of <a href="https://mastodon.social/tags/X11" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>X11</span></a> <a href="https://mastodon.social/tags/Xlib" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Xlib</span></a>). 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.</p><p>It was released on <a href="https://mastodon.social/tags/Hackage" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Hackage</span></a> and <a href="https://mastodon.social/tags/Stackage" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Stackage</span></a>. And now it’s also available in <a href="https://mastodon.social/tags/Nix" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Nix</span></a> and <a href="https://mastodon.social/tags/NixOS" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>NixOS</span></a> 20.09. Give it a try:</p><p>nix-shell -p place-cursor-at --run place-cursor-at</p><p><a href="https://github.com/unclechu/place-cursor-at" rel="nofollow noopener noreferrer" target="_blank"><span class="invisible">https://</span><span class="ellipsis">github.com/unclechu/place-curs</span><span class="invisible">or-at</span></a></p>