[hafqa] [hafqa] [Bug 2278] GtkUIManager managed accelerators don't work for Hardware keys

From: bugzilla-daemon at lists.maemo.org bugzilla-daemon at lists.maemo.org
Date: Thu Nov 15 10:56:40 EET 2007
https://bugs.maemo.org/show_bug.cgi?id=2278





------- Comment #1 from mike_morrison at alumni.uvic.ca  2007-11-15 10:56 GMT+3 -------
For anyone interested, here is a workaround until the bug is fixed:

In your program's init method add this:

    GtkSettings* settings = gtk_settings_get_default();

    g_object_set(settings, "gtk-enable-accels", TRUE, NULL);

    g_signal_connect (G_OBJECT(settings), "notify::gtk-enable-accels",
        G_CALLBACK (notify_gtk_enable_accels_changed), NULL);

Then add the callback function:

    static void
    notify_gtk_enable_accels_changed (GObject *gobject, 
        GParamSpec *arg1, gpointer user_data)
    {
        gboolean value = FALSE;
        g_object_get(gobject, arg1->name, &value, NULL);
        if (FALSE == value)
        {
            g_object_set(gobject, arg1->name, TRUE, NULL);
        }
    }

In testing, it appears that property gets "stuck" in the true state after the
initial call to g_object_set (another bug?). So the callback may not be
necessary but I've put it in to be safe.

Note: this work around does not seem to enable the accelerator labels in the
menus so I've entered another ticket (bug #2281).


-- 
Configure bugmail: https://bugs.maemo.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.

More information about the hafqa mailing list