TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Improving cursor rendering on Wayland

163 pointsby moonleayabout 1 year ago

22 comments

thayneabout 1 year ago
Some suggestions for improving adoption of this:<p>1. Don&#x27;t have a dependency on hyprlang. Other projects will probably be averse to that. Use a more common configuration language, using a common library.<p>2. Have a shim layer so that hyprcursor cursors can be used by applications that use the XCursor API (maybe have a drop in replacement library for libxcursor that delegates to hyprcursor).<p>3. Have a specification so other implementations can use the cursor format as well, in case other compositors&#x2F;clients don&#x27;t like your implementation for some reason.
评论 #39721333 未加载
评论 #39717677 未加载
magistr4teabout 1 year ago
really not a fan of using the hyprland format for configuration. If this is supposed to be widely adapted, untying it from hyprland is necessary.
saurikabout 1 year ago
The article essentially says--whether this is a good idea or not--that GTK is the one hold-out, which I wasn&#x27;t really expecting as a punchline; why is GTK not implementing this?
评论 #39714258 未加载
评论 #39715018 未加载
评论 #39717497 未加载
评论 #39716746 未加载
koterpillarabout 1 year ago
How are cursors stored and drawn on let&#x27;s say macOS? Honest question, comparing with X is easy but not exactly state of the art.
评论 #39714932 未加载
Spunkieabout 1 year ago
Is displaying a few hundred KB of data on the screen really enough of a &quot;problem&quot; that it warrants putting image libs and potentially other dependencies in the middle of something as basic as cursor rendering?
评论 #39721268 未加载
Findecanorabout 1 year ago
Instead of SVG, I wonder if not the ideal format would be Haiku&#x27;s Vector Icon Format (HVIF) [1][2]. It has binary files that are <i>much</i> smaller and it too supports multiple levels of detail for different sizes.<p>I heard somewhere that Haiku would use it for its own cursors, but my google searches for getting that verified have not been fruitful.<p>[1]: <a href="https:&#x2F;&#x2F;www.haiku-os.org&#x2F;news&#x2F;2006-11-06_icon_facts&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.haiku-os.org&#x2F;news&#x2F;2006-11-06_icon_facts&#x2F;</a><p>[2]: <a href="https:&#x2F;&#x2F;www.haiku-os.org&#x2F;articles&#x2F;2006-11-13_why_haiku_vector_icons_are_so_small&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.haiku-os.org&#x2F;articles&#x2F;2006-11-13_why_haiku_vecto...</a>
Eduardabout 1 year ago
I want a color-inverting cursor for Wayland. MS windows has it for 30 years.
评论 #39721562 未加载
open592about 1 year ago
Surprised that Wayland would go the route of entirely deferring to the client for cursor rendering instead of providing a default implementation and exposing an api which client can use to assume control.
评论 #39720773 未加载
评论 #39721040 未加载
评论 #39720488 未加载
mouse_about 1 year ago
&quot;Well lol just draw a png haha<p>Well, no, it&#x27;s not that simple.<p>Rasters are annoying. Raster means an image is stored with pixels, for example a png, or an mp4. The problem with rasters is that when you resize them, the computer has to take a wild guess at what it should look like.&quot;<p>The problem with any display this software is going to run on is that it is also made with pixels. GTK foundation tried this approach for years, putting all their eggs into this basket, and recently having a reckoning and admitting this approach has not been working. Pixels are here to stay.
评论 #39714534 未加载
评论 #39720809 未加载
aquovaabout 1 year ago
I&#x27;ve been experimenting with using Hyprland (a Wayland WM) on my laptop, and ironically Qt apps have been the ones that misbehave the most. Everything seems happy to use my preferred icon theme, but when hovering over a Qt app, the sizing greatly changes. I&#x27;ve mostly just gotten used to it (plus I never really got their overall theming correct) but I might have to try this out and see if it fixes my issues.
评论 #39715074 未加载
layer8about 1 year ago
Since the Xcursor format is extensible, why not just define new chunk types for PNG and SVG? Such an approach could provide two-way compatibility.
sp1ritabout 1 year ago
The thing I like about the Xcursor image format is that it so extremely simple[0]. Every semi-competent developer should be able to implement a parser&#x2F;writer for the format in under an hour.<p>But encoding the images with PNG does make sense, given the wide availability of libpng and the potential file size savings. I don&#x27;t know how the feel about SVG support. One the one hand using vector graphics for cursors seems like a great idea but SVG is a <i>very</i> complex format, with the only real parser available being librsvg, which massively increases toolchain complexity. Too bad PostScript doesn&#x27;t support transparency.<p>[0]:<a href="https:&#x2F;&#x2F;www.x.org&#x2F;releases&#x2F;X11R7.7&#x2F;doc&#x2F;man&#x2F;man3&#x2F;Xcursor.3.xhtml" rel="nofollow">https:&#x2F;&#x2F;www.x.org&#x2F;releases&#x2F;X11R7.7&#x2F;doc&#x2F;man&#x2F;man3&#x2F;Xcursor.3.xh...</a>
评论 #39720760 未加载
jiehongabout 1 year ago
What is this config.hl file format?<p>At first, I thought it’s hlc [0], but I couldn’t find confirmation in the git repo either.<p>[0]: <a href="https:&#x2F;&#x2F;www.linode.com&#x2F;docs&#x2F;guides&#x2F;introduction-to-hcl&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.linode.com&#x2F;docs&#x2F;guides&#x2F;introduction-to-hcl&#x2F;</a>
评论 #39716432 未加载
评论 #39714448 未加载
account42about 1 year ago
&gt; In the beginning of wayland, and in the core design spec, it&#x27;s the client&#x27;s job to draw the cursor. I mean, it kind of makes sense, as some apps might want to draw a custom cursor (e.g. games)<p>Wait what. That&#x27;s even more insane than client-side decorations.
评论 #39716381 未加载
评论 #39716758 未加载
评论 #39715090 未加载
redder23about 1 year ago
Makes total sense to make cursors SVG, kind of crazy that nobody has done this b4 and that it&#x27;s that outdated. Then yet again, handling SVG takes a lot more than some uncompressed images. So my question is how many resources, ram ... does it actually take to make some 200kb SVG as a cursor compared to some old uncompressed picture that might be bigger, but it&#x27;s simply put on the screen 1:1. I guess it COULD be just about the unit process but if it&#x27;s full SVG support than cursors can now be animated and be calculating all kinds of shit inside the SVG.
评论 #39721393 未加载
BearOsoabout 1 year ago
Xcursor doesn&#x27;t predate PNG. Heck, it came alongside a tool, xcursorgen, that could be used to process pngs and generate the binary cursor files. Xcursor appeared somewhere around 2002-2003 as an extension of Xrender. Before that X had monochrome cursors.<p>There are some legacy X specifics in the theme format that would necessitate something more modern. IIRC, Xrender used a hash of hard-coded X pixmaps to find the cursor files to match. That&#x27;s why some of the filenames are a long string of hex digits. The rest are predefined X cursor names.
arisudesuabout 1 year ago
Why are all these problems? Wasn&#x27;t this solved already years ago in another software, I mean, Xorg? Why do we need to revisit the problem again?
评论 #39718660 未加载
评论 #39718926 未加载
zokierabout 1 year ago
&gt; A max 96x96 Bibata cursor, a single cursor, is about 2MB.<p>Umm this does not pass smell test.. 96x96x4=36864 bytes of raw pixel data. How does that become 2MB?!
评论 #39717271 未加载
评论 #39719449 未加载
matheusmoreiraabout 1 year ago
&gt; instead of being a caveman and making symlinks all over the place<p>And what&#x27;s wrong with that?
planedeabout 1 year ago
Uh, if gtk apps draw the cursor client side, what happens if such an app freezes?
评论 #39718914 未加载
评论 #39715804 未加载
Vilianabout 1 year ago
xorg and it&#x27;s problems is so funny
评论 #39714365 未加载
评论 #39715065 未加载
评论 #39714335 未加载
TZubiriabout 1 year ago
1968: Mother of all demos presents mouse<p>1980: Personal Computers with mouse become popular, apple Lisa, Microsoft Windows 1<p>2000: Touch devices with stylus are popular<p>2007: Apple releases Iphone with finger touch<p>2015: Conversational interfaces like Alexa, Siri start becoming available.<p>2022: ChatGPT presents a huge tech improvement in conversational interfaces.<p>2024: &quot;Actually let&#x27;s rebuild this technology from the 80s from the bottom up. That&#x27;s what we need&quot;<p>I do not regret moving away from open source&#x2F;free software.