jjk-jacky / statusnotifier

Library to use KDE's StatusNotifierItem via GObject
Other
25 stars 8 forks source link

Add dbusmenu support via libdbusmenu #12

Closed vovochka404 closed 7 years ago

vovochka404 commented 9 years ago

New, clean pull request, related to #8

jjk-jacky commented 9 years ago

Okay, I pushed a new branch dbusmenu on top of next, with a few changes, please try it and let me know if this works for you.

Mainly, I tweaked the configure.ac because (a) for dbusmenu support we need to link against GTK (to use GtkWidget-s), so it becomes an actual dependency of statusnotifier then; and (b) one can't link against both versions of GTK, so we can only use dbusmenu-gtk3 (since we already use GDK3).

vovochka404 commented 9 years ago

I think that there are 3 ways: (a) get rid of gtk dependency at all (and force users to use dbusmenuitem's directly). But this is inconvenient, since users will have to use dbusmenu-gtk to parse theirs current GtkWidget based menus or construct new ones directly with MenuItem (from dbusmenu-glib). Or (b) to provide to versions of lb, 1 for gtk2 and 1 for gtk3 (as already done for libdbusmenu-gtk, libappindicator). And at last (c) keep it as it is (only for gtk3) if there is no real need in gtk2

jjk-jacky commented 9 years ago

Yes, if GTK2 support is really wanted, I think the best would be to make the entire statusnotifier library be compatible with GTK2, adding a configure option to select which GTK version to compile against. That would include using libdbusmenu-gtk instead of libdbusmenu-gtk3 when dbusmenu support is enabled.

But that's only if GTK2 support is really needed, I don't intend to work on that myself.

vovochka404 commented 9 years ago

Your current code is compatible with, at least, latest gtk2. The only thing is needed to be tweaked - is configure.ac

May be i'll look at it later.

vovochka404 commented 9 years ago

So, what's your plans about this branch?

jjk-jacky commented 9 years ago

I assume you did try it, making sure it still works for you as intended?

If you're happy with it I do intend to merge it, but with the recent heat wave over here I have to admit I still haven't worked in setting up a VM w/ KDE to give it a quick try, which I'd like to do before merging it.

vovochka404 commented 9 years ago

In fact - building is exactly that part - that is not interesting for me. Especially when we are talking about autotools :) But the code is working, i'm already using it in my project.

vovochka404 commented 9 years ago

Strange, but looks like i'm a little bit lying to you I've faced such crash related to libdbusmenu:

Segmentation Fault
load gui plugin
backtrace() returned 13 addresses
/usr/bin/deadbeef() [0x403eb0]
/lib64/libc.so.6(+0x35200) [0x7fe5ddb57200]
/usr/lib64/libdbusmenu-glib.so.4(dbusmenu_menuitem_get_id+0x13) [0x7fe5d2009073]
/usr/lib64/libdbusmenu-glib.so.4(+0xdd25) [0x7fe5d200ed25]
/usr/lib64/libglib-2.0.so.0(g_main_context_dispatch+0x135) [0x7fe5db4728e5]
/usr/lib64/libglib-2.0.so.0(+0x4bc48) [0x7fe5db472c48]
/usr/lib64/libglib-2.0.so.0(g_main_loop_run+0x6a) [0x7fe5db472f0a]
/usr/lib64/libgtk-3.so.0(gtk_main+0x85) [0x7fe5dd171b05]
/usr/lib64/deadbeef/ddb_gui_GTK3.so(gtkui_thread+0x77b) [0x7fe5dd8add5b]
/usr/lib64/deadbeef/ddb_gui_GTK3.so(+0x2ff99) [0x7fe5dd8adf99]
/usr/bin/deadbeef() [0x403b0b]
/lib64/libc.so.6(__libc_start_main+0xf5) [0x7fe5ddb43b05]
/usr/bin/deadbeef() [0x403db5]

Currently have no idea what to do with it :( It's quite rare (2 in more than a week), so i don't know how reproduce :(