Skip to content

Implement SNI tray icon - #837

Draft
Photon89 wants to merge 4 commits into
masterfrom
sni-tray
Draft

Implement SNI tray icon#837
Photon89 wants to merge 4 commits into
masterfrom
sni-tray

Conversation

@Photon89

@Photon89 Photon89 commented Aug 25, 2026

Copy link
Copy Markdown
Member

A tray icon implementation which should work on all DEs and differentiate between left and right mouse button just ass GtkStatusIcon does.

Not all menu entries are reimplemented so far, in particular the profile selector is missing.

Also, the icons are not as nicely set as in the original tray menu (no fallback icons provided.

Unfortunately, the the object $tray_menu, which is constructed by fct_red_tray_menu and contains all the tray menu items, couldn't be reused, the menu had to be reimplemented completely from scratch, because the tray icon and menu are now created by DBus which receives the menu structure as an array created by the new module Shutter::App:StatusNotifier.

@Photon89

Copy link
Copy Markdown
Member Author

Just tested in Cinnamon, the icon and the left click action work, but the context menu stays empty there...

@Photon89

Copy link
Copy Markdown
Member Author

I tested in KDE, Cinnamon and Gnome.

It works on all DEs, the only issue is that Gnome doesn't allow left click buttons and remaps it to the context menu, but there is nothing we can do about it, I fear.

Now we need to reimplement the profile submenu and maybe some other menu items. Currently it looks like this:

grafik

@DarthGandalf

Copy link
Copy Markdown
Member

ah, so instead of finding the library for it, just implemented the spec directly in perl. Yeah, not a bad option

@Photon89

Copy link
Copy Markdown
Member Author

I couldn't find any Perl library for it, according to AI there is none. Maybe we can release the module as standalone library if it suffices any basic quality standards, because it is unfortunately AI generated after lots of iterations and testing...

@DarthGandalf

DarthGandalf commented Aug 25, 2026

Copy link
Copy Markdown
Member

well, it doesn't need to be perl. As long as it's usable from perl, that's good enough. That's how previous used library (appindicator) worked, it wasn't perl. Or even XApp from the other PR

@Photon89

Copy link
Copy Markdown
Member Author

But there need to be some Perl bindings at least, as far as I understand, and I couldn't find anything... I hope, this solution is acceptable still. 😃

@DarthGandalf

Copy link
Copy Markdown
Member

But there need to be some Perl bindings at least

Of course. In the case of libappindicator, the bindings were coming from gobject introspection

I hope, this solution is acceptable still.

Please reread my message :(

Yeah, not a bad option

@Photon89

Photon89 commented Aug 25, 2026

Copy link
Copy Markdown
Member Author

Cool! If you find some time for reviewing, it is basically ready, just some menu entries are missing, most complex one being the profile submenu.

We also need to decide whether we want to implement (and disable) entries which only work in X11 to make the menu consistent with the GtkStatusIcon one.

@DarthGandalf

Copy link
Copy Markdown
Member

Well, we shouldn't regress existing feature

@Photon89

Copy link
Copy Markdown
Member Author

Do you mean the profile selection submenu? I will work on it. What I mean is something like the menu showing the list of all open windows, which most likely will never exist in Wayland, because of its restrictive policy.

@DarthGandalf

Copy link
Copy Markdown
Member

I mean we're not dropping support for X11, are we?

@DarthGandalf

Copy link
Copy Markdown
Member

If X11 was showing the list of windows in tray menu, I don't see why with SNI it should stop showing it

@Photon89

Copy link
Copy Markdown
Member Author

Of course not, but the SNI menu is only being used on Wayland, on X11 the good old GtkStatusIcon does the job, which still has all the items for all the features. the only question is, whether it is problematic if the two menus don't fully coincide because features which are missing on Wayland are not in the SNI tray menu which is used on Wayland.

@DarthGandalf

Copy link
Copy Markdown
Member

SNI works on X11 too. So we could leave it as the only option, removing other libraries like GtkStatusIcon.

Does GtkStatusIcon work on X11 Gnome or Cinnamon?

@Photon89

Copy link
Copy Markdown
Member Author

You are right, Gnome 48 for example still has an X11 session but doesn't support GtkStatusIcon. So yeah, switching to SNI completely would make much sense. So we need to rebuild the complete menu in SNI and get rid of the other two implementations. But I'm not sure, I'll have enough time to do this (most probably not) and I'd really like to make a release soon... Maybe we can adapt the choice of tray icon library in a way that old Gnome gets AppIndicators for the now?

@DarthGandalf

Copy link
Copy Markdown
Member

well, it is possible to use a combination of GtkStatusIcon and AyatanaAppIndicator for X11 like now, and this new perl code for wayland, but that's even messier than making new perl code support everything

@DarthGandalf

Copy link
Copy Markdown
Member

well, I haven't tested this yet. But I don't mind temporarily limiting the new SNI code to wayland

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants