GNOME Bugzilla – Bug 784188
gdk_wayland_window_set_dbus_properties_libgtk can only be called one time.
Last modified: 2018-01-02 21:30:45 UTC
Introduced here: https://bugzilla.gnome.org/show_bug.cgi?id=746435 I want to intercept the window realized and then set other different dbus properties for my gkt windows using the gdk backend, but impl->application.was_set, prevent me to set my configuration. As a side effect, gdk_wayland_window_set_dbus_properties_libgtk_only, only can be called one time, as other calls will not apply. This prevent unity-gtk-module to have a way to set the dbus menu under wayland.
the function is called _libgtk_only for a reason: you are not supposed to call it, since you are not libgtk
I think this probably needs a wider conversion about what you are trying to achieve, and why a module would try to set a menu.
bugzilla is not the best place for that.
True, where is the place to talk about it? Just i want to achieve the same behaviour of unity-gtk-module into a Wayland session. Now that unity die, several global menus that used this functionalists will have not support under wayland. unity-gtk-module is also a package of Fedora and Arch without support for wayland. https://admin.fedoraproject.org/pkgdb/package/rpms/unity-gtk-module/ https://aur.archlinux.org/packages/appmenu-gtk-module-git/ Thanks.
I don't want to spam gtk more with more things. In short, I changed the way of how unity-gtk-module is working to be adapted of what i think Gtk apparently is waiting for. So, i'm using now: gtk_application_set_menubar instead of try to publish by myself the menu over Dbus. This have the inconvenient of only can be used from a GtkApplicationWindow and not from a GtkWindow, but well something is better than nothing. As a result, the menu bar is exported on DBus propertly, but several gnome application are observing the Gtk.Setting of gtk-shell-shows-menubar and i can not be able to set it. I'm trying to set gtk-shell-shows-menubar from org.gnome.settings-daemon.plugins.xsettings in the overrides value of it. I try to set Gtk/ShellShowsMenubar to the value 1, but after that, i can not see any effect when i execute: g_object_get (settings, "gtk-shell-shows-menubar", &shell_shows_menubar, NULL); The value of shell_shows_menubar variable is always FALSE, not matter what i can try. Also, i try to set it directly in the gtk module, resulting in a Core dump of the whole app. So, in this code, the last line will ending in a core dump: gtk_widget_shell_shows_menubar (GtkWidget *widget) { g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE); GtkSettings *settings = gtk_settings_get_default (); g_return_val_if_fail (GTK_IS_SETTINGS (settings), FALSE); GParamSpec *pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (settings), "gtk-shell-shows-menubar"); g_return_val_if_fail (G_IS_PARAM_SPEC (pspec), FALSE); g_return_val_if_fail (pspec->value_type == G_TYPE_BOOLEAN, FALSE); g_object_set (settings, "gtk-shell-shows-menubar", TRUE); } Also the same if i use: gtk_widget_get_settings (widget); instead of: gtk_settings_get_default (); So, then how Gtk.Settings this is working on Wayland? Probably relate with: https://bugzilla.gnome.org/show_bug.cgi?id=790201 Apparently the property gtk-shell-shows-menubar exist, but can not be set. lsb_release -a LSB Version: core-9.20160110ubuntu0.2-amd64:core-9.20160110ubuntu0.2-noarch:printing-9.20160110ubuntu0.2-amd64:printing-9.20160110ubuntu0.2-noarch:security-9.20160110ubuntu0.2-amd64:security-9.20160110ubuntu0.2-noarch Distributor ID: Ubuntu Description: Ubuntu 16.04.3 LTS Release: 16.04 Codename: xenial dpkg -l libgtk2.0-0 libgtk-3-0 ii libgtk-3-0:amd 3.20.8-1ubun amd64 GTK+ graphical user interface lib ii libgtk2.0-0:am 2.24.30-4ubu amd64 GTK+ graphical user interface lib Thanks any way.