Funny, I maintain xfdesktop (the Xfce component that draws the desktop background and icons), and this past summer I just did a major refactor/rewrite of how xfdesktop saves and restores icon positions as well.
Fortunately I didn't have as much trouble in the "reading code is the hardest part" dimension, as I was largely redoing code I myself wrote around 20 years ago (though others had changed it a bit in the meantime).
It's fun to see a lot of the same problems I had when modeling how all of this should work. Xfce 4.20 (probably end of next month) will have all of my changes for this, but of course I expect I've broken some things as well and will have to add in a bunch of little hacks and workarounds. It's a truly weird, complex problem, even though at first look it feels like it should be simple.
> Fortunately I didn't have as much trouble in the "reading code is the hardest part" dimension, as I was largely redoing code I myself wrote around 20 years ago
Sometimes, when I'm reviewing code I did just some weeks ago, I'm completely lost.
Updating some code years ago, I asked who wrote this abomination?
(Checks source history)
Crap, I did
Thank you and everyone else who works on XFCE for your sanity-preserving work.
>It's a truly weird, complex problem, even though at first look it feels like it should be simple.
Unfortunately, almost everything is.
Thanks for XFCE guys.
Love XFCE, everything about it.
You know how wired earbuds always, always get tangled when you place them in a drawer or your pocket or something for few seconds?
Do not wind them around your hand, this creates a curling force that makes them tangle. It’s a fundamental symmetry effect in action, with which you turn a straight line into a knot. Try the same with a flexible ruler tape and you’ll see how much it twists, unless you counter-twist every loop.
Instead just gather the wire into a flat compressed /\/\…/\ form and put it there. The worst thing that will happen now is one accidental semi-knot that is trivial to shake away.
Now I wonder how that applies to code, maybe we’re onto something here.
> unless you counter-twist every loop.
That's the whole trick: don't wind, twist.
Observe: take a short cable (or a piece of thread), hold it straight at each end with two fingers by the wire; at one end, roll the cable along its main axis between the two fingers; a loop forms, purely through created stress.
Now, with a longer cable you just accumulate such loops by iterating over the length; stress can be relieved by accompanying the cable while twisting: there should never be any resistance felt.
If done correctly the folded cable should be able to lay flat on a table and not move a millimetre. Note that there's a "natural" radius that is best respected.
One could stack a bunch of those in a box and they basically won't mix unless massively shaken, but to make sure one can tie a single point of the loop to eliminate lateral slack.
Source: folded a cumulated thousands of kilometres of usb/ethernet/XLR/6.35" cables over the years, packed together in bags or boxes.
While this works, it’s mostly useful for storing naturally curled wires/hoses. The downside is it becomes twisted again by pulling straight.
The “accordion” method actually counteracts knotting because it forms a sort of an amorphous spring that is unstable outwards rather than inwards (careless winding) or just being stable (twisting). I find it more useful as it never twists and tends to decay into a straight wire by itself. But ymmw, cause it tends to be all over the place in your pocket/drawer/etc. also doesn’t work for hoses cause they deteriorate at sharp folds.
The moral is just know your methods and where they apply and if that suits you the best.
You can also wind it while twisting the remaining of the cable on the opposite direction.
On a short cable like a headphone string, this is just a matter of holding the cable up so the plug can rotate freely. Then you can do anything, you won't accumulate stress. (On a longer cable that means putting temporary stress on the non-wound part of the cable. If it's too long, you need to remove it from time to time.)
Anyway, I've just printed a ton of cable-winders, for all sizes and calipers, and never thought about it again.
Gaffers, sailors, and kite flyers will teach you the “over under” method, discussed here: https://news.ycombinator.com/item?id=21581553
Huh, so I have it half right when I quarter-twist the cable so it naturally forms the next loop of the bundle. I just had the "under" part missing.
That is a great tip: "hold the loop in left hand, cable in right, both palms up, then bring thumbs together to create the 'under' loop"
Roll it up, just like you would roll back toilet paper on its roll, or sewing thread. Then you can roll them around your hand with no tangling issues.
Just like you would with a garden hose, or a rope on a sailing boat. Tangled ropes is a potential problem there so no one would flail your hands about and hope for the best. Instead you roll neatly.
Is this why over-under coiling is so effective at preventing tangles?
Title made me remember this other example of desktop icons being hard: https://randomascii.wordpress.com/2021/02/16/arranging-invis...
From the legendary Bruce Dawson, master of the Windows Performance Toolkit. Too bad he stopped working at Google and stopped blogging. I hope he finds the peace he is looking for.
Read it and enjoyed it. For ref it was discussed previously at https://news.ycombinator.com/item?id=26152335
Hopefully the new code discussed in OP isnt quadratic.
Although I also enjoyed reading the article you linked to, I found the following quote from it somewhat condescending:
> Symbol servers are good. If you are on Windows then make sure you are using symbol servers. If you are not on Windows – I’m very sorry (and by that I mean that it is a shame that debugging and profiling – especially of issues on other users’ machines – is so much harder for you).
It seems that the author believes that only Windows has good debugging symbol support, which isn't true at all. In fact, several Linux distributions provide debugging symbols for most of their packages, and from my own experience I know that in particular Arch Linux and Void Linux are quite easy to set up to use them. I'm not even getting started on the availability of source code.
Void Linux in particular is very convenient for debugging issues on different architectures, because its package build system inherently supports cross-compiling for multiple architectures from the same package definition with minimal extra configuration, including generating debugging symbols. Naturally these symbols are packaged separately from the binary packages that reference them, so there is no need to install binary packages for an incompatible architecture just to get at the debugging symbols.
Author here:
Linux has made progress in this area, but I think that Windows is still better. Maybe I'm wrong (I haven't used Linux in a while) but I think when Linux developers say that they have excellent support for debug symbols this just means that they don't realize how good it is on Windows.
I can load a crash dump or ETW profiling trace that has come from a customer using any version of Windows and load it up on my machine and the debug symbols just appear. Windows 11? Windows 10? Windows 7? Some random patch level? It doesn't matter - they just show up. When I worked on Chrome I had that symbol server configured as well, so any combination of old Chrome version and Windows version would just work. It's really magical.
In addition, Chrome source code would automatically show up as I explored the crash dump. That's source indexing which is separate but related, and also magical.
If some Linux variants work this well, then that is great. Last time I tried I found there were many different steps and debug packages to install just to get all of the symbols for my local Linux install, and handling other Linux installs was more complicated.
This is all I do to make it work on Windows:
```set _NT_SYMBOL_PATH=srvc:\Symbolshttps://msdl.microsoft.com/download/symbols;SRV*c:\symbols*h...```
> Linux has made progress in this area, but I think that Windows is still better.
This might be one of these cases in which Windows had to become better. On Linux, you always could recompile everything yourself enabling debug symbols, but that's not an option on Windows.
That works when you debug on your machine. Now you get a crash dump from a customer - hove fun replicating their stack exactly.
But you still need to install those debug symbols yourself, and need to know which exact versions you need, don't you?
A better rebuttal to "symbol servers make debugging on Windows more convenient, because they allow you to open a debug trace from someone else's computer and immediately have symbols available that match the versions installed on their system" would be "here's how to configure your debugger on Linux so it automatically downloads the correct symbols as well."
Edit: I guess the answer is DEBUGINFOD_URLS https://sourceware.org/elfutils/Debuginfod.html
Fedora does it automatically. Run gdb on any binary installed through rpm, and it'll pull down all the debug symbols. Same thing with the problem reporter (gnome-abrt), after a crash, it'll automatically pull down debug symbols if you are going to send a crash dump.
Indeed, the process is seamless once you set DEBUGINFOD_URLS (it uses the BUILDID embedded in executable). Many tools now support it, like gdb, valgrind, delve, etc.
Is there a Linux alternatives to symbol servers? I'm always kind of annoyed when I need to deal with debugging native code running on LTS Ubuntu servers from my Manjaro+non-LTS Ubuntu box, because the libraries (including glibc) are all different versions compared to the server the code was running on.
Microsoft's symbol servers allow cross-OS-version symbols with ease. The easiest solution I've seen on Linux involves downloading a full copy of the foreign distro and hope the exact library versions on the server are still available in the repos.
The Void Linux tooling sounds interesting for sure, but by your description I think it doesn't solve the same problem?
That's a classic. It's incredible that it's taken Microsoft literal decades to fix that issue. The old recommendation was to hide desktop icons but even that doesn't fully solve it. Garbage collecting them into another directory on the desktop was the fix.
> It may not sound like much, but this was a lot of work. I spent days just thinking about this problem, trying to understand what is happening now and how to improve it.
I find these kinds of problems the most fun and the most educational! I tried building a grid layout system from scratch in SwiftUI, and it was similarly tricky to map out:
- what the "ideal" behavior one expects is,
- what edge cases exist,
- how to handle the edge cases,
- maintaining ideal behavior while handling edge cases.
(It was tricky b/c SwiftUI lays out its children, then its parent -- so the parent needs to ask its children for its view size, and iterate and set rows/columns that way.)
Maybe because the problem seem simple, it is that much more fun to dig into. Some good ol' time with a whiteboard.
I think desktop(and phone) icons are a fundamentally flawed ui design in the first place. something about having your stuff semi randomly spewed across two dimensions makes me feel we are not using our computers correctly. I think we should be doing better than emulating the bucket of legos user interface model.
Give me a one dimensional list, or table I can sort, search and actually find things in.
No, I am not much fun at parties, why do you ask?
Spatial memory is a very useful and important part of navigation. One thing I (and probably we all) miss is an ability to create nameless folders. Well, we sort of can, with “New folder (24)” and “dklstnrigwh”.
I’d like to use spatial sorting more and in regular folders, but that’s very fragile and second-thought in most UIs. Also they provide no visual cues, so I can’t leave my file in the left black drawer with a flower sticker on it.
Yes I know about Bob and how it failed. But it works for me in e.g. Fallout games where I can use multiple boxes in different rooms to sort my loot. I just know that my plasma rifle is in the metal box near the bed and cells are in the dresser.
The ability to find things without creating, remembering and searching the names or containers feels good.
> I’d like to use spatial sorting more and in regular folders, but that’s very fragile and second-thought in most UIs.
I've heard that the "spatial Finder" from the old Mac OS worked like that: from what I understood from reading a couple of classic Ars Technica articles about it, there was a direct one-to-one correspondence between each folder and the window which represented it on the screen, and each of these windows always preserved its size and position. Quoting from https://arstechnica.com/gadgets/2003/04/finder/
"[...] There was no such thing as a "Finder window" that "displayed the contents of a folder." Double-clicking a folder opened it. The resulting window was the folder. When scrolling, moving, or resizing that window, there was no doubt about which folder was being affected. And the stability of the interface was such that there was no doubt about what that folder would look like the next time it was opened."
> Spatial memory is a very useful and important part of navigation.
Oh yes! And so under appreciated. Things that have their place is absolutely crucial. Imagine if your menu bar sorted based on how often you used “edit” vs “file”. Or why not have the keys on the keyboard change based on frequency? I’d argue we should leverage spatial- and muscle memory much more in UX and design.
Yes, and memory palaces work this way. People remember 20-50 items (or cards) at once by simply placing them at a familiar location. “A racoon sits near a red vase at the entry with his legs crossed and a rhino spilled half the bath on the floor”.
It’s strange that UX overlooks space so badly and uses same-{shape,color,font} elements everywhere. I guess it’s due to that Bob meme, what else.
There’s “Raskin”, but it also isn’t perfect in this regard.
Agreed, my desktop will always just be my wallpaper and nothing else. I don't want any icons there.
I thought you were about to pitch 3 dimensional space. Like iPhone app pages but instead of a few pages left to right, it’s a 3d cube? Sounds useless and no different but also very exciting
I always found the 'sea of icons' a bit weird. There is some server management software that I used to have micromanagers specify, not that they would ever use it. I always begged for stock Ubuntu with a command line but they insisted on the 'sea of icons', making it impossible to find things quickly.
I can understand the desktop metaphor but just because it is intuitive to aged boomers that liked Steve Jobs does not make it right. But these people did not get the advantages of the history file or how command line meant that you could repeat common tasks with an exclamation mark + number.
Another thing that gets me with icons is when people over complicate them. An icon has to be simple, if it is not simple then it is not an icon.
To be fair to the author, I actually think desktop icons is a problem that no desktop manager has ever solved, and I think the reason is because it's not solvable in a user friendly way. The problem is that desktop icon arrangement can mean different things to different users: some people are just arranging their icons in a one dimensional list that's wrapped, while others are arranging theirs in clusters (top left is for system, top right is for documents, bottom left is for personal/games etc), while yet others are arranging theirs in columns and so on - how these are supposed to change on resolution change is different per each use case. When I switched to dwm on desktop I felt freed from a problem I had literally just always had.
If you let the user arrange their icons in the preferred shape, for each screen resolution they use, and save that, the problem is solved. As the article describes.
The bug described in the article was the icons being moved around without user input, and then their wrong/unwanted location saved as "user preferred icon arrangement". Which sounds like an obvious bug in hindsight.
> If you let the user arrange their icons in the preferred shape, for each screen resolution they use, and save that, the problem is solved.
Users normally place their icons using a given, single resolution, so that would only give you one initial saved icon position. You need some heuristic when the user first changes resolution with that icon present on the desktop.
Yes, and any heuristic is fine, because it's a once-in-a-lifetime* rearrangement. In other words, this situation is not part of the problem.
*lifetime of that computer
My screen realestate changes several times a day. My work daily driver is a laptop that has a built in screen of a particular resolution. In the office it plugs into a dock with one monitor that has a different resolution than the built-in display. When I take it home and plug it into a dock it has two external monitors of different resolutions.
Icons need arrangements in each combination of monitors, resolutions, and scaling. So that when I'm sitting at my desk in the office I have a consistent experience of icon location. When I'm at home and have different screen layout, I can have a different icon layout suited to that screen layout and everytime I plug the dock in at home I should get the same arrangement that I had yesterday. If there's a new icon that has never been placed in a particular desk setup, drop it anywhere.
> My screen realestate changes several times a day.
Does it change often enough that an absurd like 20s update-time would impact you?
Anyway, the article has plenty of reasons to save more than 1 resolution as "user-defined positions". But not a lot of them, probably 2*n^2 for n monitors is more than enough.
Maybe it's just nostalgia, but I felt an amazing sense of happiness with the icons in Windows 3.1 and macOS 8. I loved them all! I'd say that everything up to Windows 95 and macOS 9.2 was great. But then, with macOS X and later versions of Windows and Linux, things went so high-res that I didn't like it. That's just my personal opinion, not a fact.
I’d like both icons and windows from the other display to be collected into a picture-in-picture window at the bottom right. Which you then can click to enter and manage it yourself, rather everything being dumped over my main display every time I accidentally turn it off or something.
Tango did it perfectly fine. Insta-spottable, with outlines. Also, the Tango color-scheme it's almost the generic color scheme for terminals to avoid the infamous dark blue/black clashing.
Just wondering, what does this have to do with the article, which is about code that positions desktop icons on the screen (in KDE)?
> Reading code is the hardest part
Does anyone have experience using an LLM to extract documentation from code?
Or are LLMs bad at it because we have too few good examples? :)
On the contrary: they're bad at it because our examples are too good. There is information in documentation (requirements, rationales, performance characteristics, safety concerns) that cannot be deduced from the code. The language model anticipates that such information would be present, so it writes it anyway – despite having no idea what it should say.
If you're lucky, you get something bland and verbose, but not incorrect. If you're unlucky, you get something dangerously wrong that a later reader assumes is true / important, since "otherwise, why would they have put it in the documentation?".
This is part of why I refuse to work on codebases which LLMs have mucked about with. Even the most basic things cannot be relied upon. (Note: refusal can be overridden by suitable application of financial compensation.)
The funniest thing (to me) is not that the author doesn't like desktop icons, but that the problem had been largely solved many times for many decades...
“Largely solved [aside from the edge cases I don't care about]”
All of the edge cases were self-inflicted. They could have picked a different UX that would have had a much smaller set of edge cases to care about.
I agree with you on this, but also understand the OPs reasoning for searching out a better solution. it takes both homesteaders and pioneers.
At the cost of the things that the UX enables, no thank you. If I want gnome, I know where to find it.
Windows 95
Windows 95 had a fixed icon size with no previews, a restricted set of possible panels, and was released in an era when monitor cables were held on to the graphics cards with thumbscrews.
It could also be argued that Windows 95 marked the start of this complexity, at least in PC land. Prior to that, there was very little communication between the OS and the hardware regarding configuration. When it did happen (e.g. monitor resolution, speed of a serial port, etc.), it was directed by the operating system rather than by the hardware.
OS/2 did it first on PC land.
What's the point you're trying to make?
Probably that Windows 95 didn't really cover a lot of the challenges of desktop icons in modern computing systems as it was greatly limited at the time.
I chipped my tooth on one just last wednesday
When I read the title, in my mind I immediately completed it with "...and not worth the effort"
Happy to read that PS
The post gets weird very fast:
> That's fair. Why show desktop icons on a screen that is non-existent?
But can you arrange by p**s?
first remove from your whole page the border solid 5px black
No icons in my desktop (window manager, fluxbox). It's the UI I'm used since... too many years to count.
Custom keys to launch the most used apps.
Alt+F2 to launch less used apps.
And... the big star... one of my reasons for stay in fluxbox for so many years, the custom menu (right click anywhere in the root background, left click in the corner of the toolbar, or custom key to launch the menu).
Custom menu that can make includes, oh yeah, can be updated via cron/systemd-timer/scripts, etc so you can have a hierarchical menu to all your machines, by project, by datacenter, by service, IPMI, ssh, remote desktop... always up to date (i.e. from ansible-inventory). Or you can have your browser boomarks in the menu (with the same folder hierarchy). Or you can implement your own RSS in the menu via cron. Anything you can imagine.
For me, hierarchy > 2D positioning, and "desktop" != root folder for any "data".
Last step of my weird, non mainstream setup, is the all my data is not in my home, but it's in /data/myuser (in a partition separated from the OS), in folders like backup, docs, downloads, media, src, vms which are linked to my home. All dot files that I care are under my custom config management system (sh script + git), and all the data is in /data (+backups). Why I mention this? it's on topic... some apps try hard to use the "desktop" directory. So I have this bit just for them:
$ grep DESKTOP .config/user-dirs.dirs
XDG_DESKTOP_DIR="$HOME/docs/desktop"
Because why the hell a browser need to mkdir ~/Desktop or ~/Downloads for nothing.My app launching shortcuts/menu are very well organized and optimized. My data is in /data. I live without the "desktop is everything/anything/chaos-thing" seen in many people machines, and I'm happy.
When I've used other's OSs with a desktop full of icons, I dislike specially not being able to make the exact placement because of auto alignment.
If I used desktop+icons, would like something like diagramming apps: "Let me place things exactly where I want, but, let me align groups of selected items, horizontally and vertically, via context menu/shortcut when selected".
Just wanted to pop in as a fellow Fluxbox user that I have essentially the same setup.
All the apps that I launch multiple times per day have their own global shortcut keys. And then for everything else I have a setup where pressing the Windows logo key brings up a "start" menu right where the mouse pointer is. From this menu I can then launch the other apps that I use infrequently. Super convenient.
But really the best part of Fluxbox is that never changes. I think I've run the setup for about 20 years by now with only occasional minor tweaks.
As an old grumpy developer things not changing without my consent is the best possible feature. I have absolutely zero interest to learn new shiny things just because someone wanted to shove them down my throat!
What happened to kbuildsycoca6? It's not updating icon cache anymore.