Open versecafe opened 3 months ago
https://github.com/zed-industries/zed/pull/9919 (and the PR it follows-up) https://github.com/zed-industries/zed/pull/12067 established the API as
So far, only macOS code provides impls for the methods, but nominally the issue is implemented already — there's a unified way to set menu items and recently opened files. Other platforms are sure welcome to add those, and that sure happens eventually, so should we close the issue?
Unfortunately, I don't think it's possible to add desktop actions dynamically on linux, they are the equivalent of the dock menu but they work more like iOS when you long press an app on the homescreen, in that they are accessible even when Zed is closed. They are currently only used once with a constant value, so it should be simple to add it (for reference, this is vscode's desktop file with the same action), avoiding duplicating action definitions and having it work for arbitrary GPUI applications sounds complicated and depends on their build/packaging scripts...
For recent files, I found this ancient Recent File Storage Specification which sounds like it might be used by desktops, but then this Desktop Bookmark Specification seems to replace it. It could've sworn this was supported on gnome but apparently not, I'm still trying to decipher what spec is used, I found this gnome extension that uses Gtk.RecentManager which uses gio's recent://
, and on the KDE side I found this which and the backend code it's referring to.
Like on Linux, it is also pretty complicated on Windows. On macOS, dock menu acts like a button, on Windows, it is something like:
Command::new("Zed.exe").with_args("...")
It tries to open a new instance of the app, the only infomation is the args we pass.
found some docs for creating jumplist in windows https://learn.microsoft.com/en-us/samples/microsoft/windows-universal-samples/jumplist/ this is a sample provided by Microsoft to create a sample jump list for an app
Is this something similar to the set_dock_menu should I achieve in windows
Is this something similar to the set_dock_menu should I achieve in windows
As I mentioned before, this will open a new instance of the app, unlike on macOS where it behaves like a button.
If you don’t believe me, please give it a try.
@JunkuiZhang That could be handled by passing along a flag that tells GPUI to merge the instances a bit hacky but it's a way around windows having poor handling
Is this something similar to the set_dock_menu should I achieve in windows
As I mentioned before, this will open a new instance of the app, unlike on macOS where it behaves like a button.
If you don’t believe me, please give it a try.
https://github.com/zed-industries/zed/pull/15371 seems like you are already working on it
Yes, this approach is somewhat hacky, but Chrome handles it in a similar way.
so is this a part of this feature?
Check for existing issues
Describe the feature
Add support for
set_dock_menu
to Windows and Linux calledDock : MacOS
,Desktop Launcher Actions : Linux
,Taskbar Customization : Windows
Windows
Called User Tasks form a menu that supports
Linux ~
Writing to
.desktop
file allows custom actions within some linux desktop environmentsMore information at freedesktop.org # Table 2. Standard Keys
Key Goal
Avoid fragmenting implementations of this into a per OS custom system and falling into the same pit electron has when handling dock menus
If applicable, add mockups / screenshots to help present your vision of the feature
Linux Sample
Windows Sample