taffybar / gtk-sni-tray

A StatusNotifierHost widget written using the gtk+3 bindings for haskell provided by gi-gtk.
BSD 3-Clause "New" or "Revised" License
36 stars 2 forks source link

Support Activate and SecondaryActivate #14

Closed ARR8 closed 3 years ago

ARR8 commented 6 years ago

Clicking on icons seems to always show the right-click menu, and there is no way to trigger the left-click action. For some programs, this means an extra click to "show" or "open," but some programs do not have the left-click functionality in the right-click menu.

colonelpanic8 commented 6 years ago

Yes, the Host implementation is, as you have noticed, not technically complete, although the reality is that very few things properly implement the activate or secondaryACtivate methods here

https://www.freedesktop.org/wiki/Specifications/StatusNotifierItem/StatusNotifierItem/

This is generally one of the downsides of SNI as compared to XEMBED. There is a bit less flexibility WRT input.

colonelpanic8 commented 3 years ago

@ARR8 @kurnevsky @nomeata You all expressed interest in this feature -- Do you have examples of sni apps that provide this functionality? @kurnevsky has implemented this in the latest version, but I haven't found any examples that I can use for testing.

kurnevsky commented 3 years ago

@IvanMalison For activate: qbittorrent, qtox, telegram-desktop, deadbeef use it for window showing/hiding. For secondary activate: deadbeef with https://github.com/vovochka404/deadbeef-statusnotifier-plugin uses it for play/pause toggle. Derivation: https://github.com/NixOS/nixpkgs/pull/130534 pidgin with https://github.com/philipl/pidgin-indicator uses it to show/hide its roster. Derivation: https://github.com/kurnevsky/nixfiles/blob/master/modules/pidgin-indicator.nix

colonelpanic8 commented 3 years ago

@kurnevsky I'm going to do a release of gtk-sni-tray soon (probably today). I've merged https://github.com/taffybar/status-notifier-item/pull/8 . Were there some associated changes you wanted to make here that needed that PR?

kurnevsky commented 3 years ago

Were there some associated changes you wanted to make here that needed that PR?

Yes. I haven't tested it yet, but should be enough (itemIsMenu is available there and it defines the behavior of left button).

colonelpanic8 commented 3 years ago

Does it? I don't see the code that does that.

kurnevsky commented 3 years ago

I mean specs say it defines :) We should implement it in gtk-sni-tray with the help of itemIsMenu.