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
35 stars 2 forks source link

Handle mouse buttons accordind to the spec #27

Closed kurnevsky closed 2 years ago

kurnevsky commented 2 years ago

Resolves #14

According to the spec left mouse button should send activate, middle - secondary activate, right - show menu.

There is one drawback though - there are items that should always show menu. This is what we have now but won't have anymore after this PR. It's defined via ItemIsMenu property. But it's currently not supported in status-notifier-item. @IvanMalison is xml there manually written or it's provided somewhere? Could you update it and make a release?

Also I noticed that there is ContextMenu method. @IvanMalison why it's not used and instead menu is created manually?

colonelpanic8 commented 2 years ago

It's defined via ItemIsMenu property. But it's currently not supported in status-notifier-item. @IvanMalison is xml there manually written or it's provided somewhere? Could you update it and make a release?

I think I just grabbed that xml from somewhere random. I don't think I was able to find the canonical xml anywhere, so its quite possible that it is missing something. I will try to fix and make a release soon, but you should also feel free to do so. Should just be a one line change right?

Also I noticed that there is ContextMenu method. @IvanMalison why it's not used and instead menu is created manually?

Hmmm I have no idea whether ContextMenu would work. I'll add that to the xml ASAP so we can try it out.

kurnevsky commented 2 years ago

Should just be a one line change right?

Yes, I just didn't know if it existed somewhere so we can just sync it. So far I only noticed missing ContextMenu method and ItemIsMenu property, but there might be more missing items.

Hmmm I have no idea whether ContextMenu would work. I'll add that to the xml ASAP so we can try it out.

I'm asking because I don't know if it's possible that icon has no menu but can handle this action. Probably handling menu manually will have consistent theme which is better, but not sure how it works in case of this action.