Re: modify gkt_widget_real_can_activate_accel to fix nautilus desktop?



Jimmy Do <crispyleaves gmail com> writes:

> Hi everyone,
>
> I'm trying to fix this bug in Nautilus:
> http://bugzilla.gnome.org/show_bug.cgi?id=135399
>
> I think I've tracked the problem down to this function in gtkwidget.c:
> static gboolean
> gtk_widget_real_can_activate_accel (GtkWidget *widget,
>                                     guint      signal_id)
> {
>   /* widgets must be onscreen for accels to take effect */
>   return GTK_WIDGET_IS_SENSITIVE (widget) && GTK_WIDGET_DRAWABLE
> (widget) && gdk_window_is_viewable (widget->window);
> }
>
> In the case of invoking an accelerator on the desktop, the 'widget'
> argument will contain the desktop's hidden GtkMenuBar.
>
> The function returns FALSE when someone tries to use an accelerator
> such as ctrl-L on the desktop. I've found that if I comment out
> GTK_WIDGET_DRAWABLE(widget) && gdk_window_is_viewable(widget->window),
> then the function will correctly return TRUE and accelerators will
> work on the desktop. I'm guessing, however, that this change would
> probably be a big "no no" because it could break functionality in
> other programs?
>
> Any advice? Should I instead be focusing on making changes in nautilus
> rather than gtk?

In GIMP, we use the following signal connection to make the hidden
menu bar work:

g_signal_connect (menubar, "can-activate-accel",
                  G_CALLBACK (gtk_true),
                  NULL);

ciao,
--mitch



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]