-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for Activate method of SNI #71
base: master
Are you sure you want to change the base?
Conversation
Hm, this breaks left click for programs which don't connect to the WDYT? |
We wrote #4 (comment). We've forked libayatana-appindicator and #17 into Betterbird: We'd fork this PR too with no hesitation, but it's not clear how to use it. What we need is to register a callback which will be called upon activation. How can this be done? We have provision here already: Somehow register a "listener" for "activate-event". How would that be done? Could you provide a few lines of sample code. Thanks in advance! |
my $tray_libappindicator = AppIndicator::Indicator->new("Shutter", "shutter-panel", 'application-status');
$tray_libappindicator->set_menu($tray_menu);
$tray_libappindicator->set_status('active');
$tray_libappindicator->signal_connect(
'activate-event' => sub {
...
},
$tray_libappindicator
) ; |
Interesting, thanks. Our code is in C: So which see function would be use for |
See |
After applying your changes, we added this to our test program:
Sadly the A bit of debugging showed that What are we missing? |
Which DE? I was testing it on KDE |
I was afraid you were asking that. Mint/Xfce. We already know that libayatana-appindicator gives different results on different destops 😢. Attached the test program. We added your patch manually, so the formatting is off (like in the original). Maybe we made a mistake applying your changes. |
Your code works for me |
Thanks for testing. I'd say that your code works for you 😉. We've just added a few lines to the test program after applying your changes to libayatana-appindicator. KDE is known to have the best "system tray" support, so it's not a surprise that it works there but not on Xfce. As we wrote Any chance to investigate what's going on other desktops and to make it work there too? Gnome doesn't even support the tooltips, so that's not worth supporting. |
yep! |
OK thanks, and getting it to work on other desktops? |
If other desktops refuse to send the activate signal, there's not much we can do? |
Maybe they send something else? |
@@ -221,13 +227,17 @@ struct _AppIndicatorClass { | |||
void (*unfallback) (AppIndicator * indicator, | |||
GtkStatusIcon * status_icon); | |||
|
|||
void (* activate_event) (AppIndicator * indicator, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest to move this up after scroll_event
.
* @arg1: X | ||
* @arg2: Y | ||
* | ||
* Signaled when the #AppIndicator receives a scroll event. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copy/paste error in the comment: you mean "activate".
OK, just for reference, we've added this to Betterbird, we have some people who want to try it on KDE: |
We did a survey of which desktops work and which don't. So working are KDE and Gnome with extension "AppIndicator and KStatusNotifierItem Support". On Gnome the activation appears to be a double-click. Not working: Cinnamon, Mate, Xfce. |
Hi, I'm the maintainer of xfce4-panel. I stumble here because I may use libayatana-appindicator in Xfce to use status notifiers instead of GtkStatusIcon for Wayland support. And I would need Activate to be supported :) This PR isn't enough to make this signal work on Xfce because libayatana-appindicator also lacks support for the ItemIsMenu property. It's set to TRUE by default in xfce4-panel, because historically it's not supported in libappindicator: https://gitlab.xfce.org/xfce/xfce4-panel/-/blob/2c2ce90d52bbcea7381250101edfd16db19a3ae0/plugins/systray/sn-item.c#L284 By adding this patch to the PR, it works correctly (sorry, apparently it doesn't want to attach the patch directly, so I had to make an archive...): Maybe it's the same problem with the other DEs? |
Thanks for the patch, you can add it as text file. I'll add it to Betterbird and see how it goes, I was using Xfce before having to try all those other desktops. So it would be great to get it going there, too. Currently afk, I'd let you know mid next week. |
@DarthGandalf Is this fixed by applying the patch above and setting |
@Tamaranch I can't apply it. Do you have some other patches applied before this? I'm using 0.5.92 as the base
|
Yes, I committed on your branch. |
Can you send the whole src/app-indicator.c ? |
Yes, sorry, I somehow was testing my patch on top of 0.5.92 directly, without all changes which happened since that, and those changes conflicted with your patch. Adding |
Well it probably depends on the implementation, but setting |
Apparently |
I can't find where the source of KDE's systray is, to understand what exactly it does |
We added @Tamaranch'es patch to our source and in the test program a click now activates: |
They do - I'm on MATE, and any other tray application does handle left-clicks (and I use a lot of them). Including my own PyQt5 programs. So MATE definitely does send something - the question is, how to others catch it. (I can do some testing - I'm very much after getting it to work on MATE, and I'm good with testing, but I'm not familiar at all with C and GTK...) |
I got Betterbird to restore from tray on MATE: Betterbird/thunderbird-patches#111 |
Should the fallback GtkStatusIcon also emit that activate event? eg: static void
status_icon_activate (GtkStatusIcon * icon, gpointer data)
{
+ AppIndicator *app = APP_INDICATOR(data);
+ g_signal_emit(app, signals[ACTIVATE_EVENT], 0, 0, 0);
+
GtkMenu * menu = app_indicator_get_menu(APP_INDICATOR(data));
if (menu == NULL)
return; (x,y coords are 0, since I don't think the native GTK activate event provides those). This allows Betterbird's tray icon to work with older systrays like trayer. |
Is this PR currently available? |
Thanks for this patches! I was able to make I had to apply the patch from this PR but also the patch from @Tamaranch because I'm a XFCE user and without this last patch it was not emitting the signal It would be nice to have this two patches merged |
I guess this has stalled? Would be great to adjust this PR so it works on all DEs |
@DarthGandalf Are you still available for fine-polishing this PR? |
@tari01 Could you take a look at the above? |
You can find the rebased patches here: |
Likely I will be in a couple months, unlikely before that. |
Any chance you're able to look at this now? |
Considering that #82 has appeared, probably it doesn't make sense anymore to do this in the previous codebase. Another concern is back compatibility with old clients of this library, which don't expect a separate Activate signal - at least my patch by itself was breaking those, and I couldn't make the item-is-menu to work back then. Maybe that patch actually solves it though, I'd need to test it again. |
No description provided.