[PATCH] Gtk::MenuItem::set_accel_path()

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] Gtk::MenuItem::set_accel_path()

Christian Schoenebeck
Hi,

I just investigated a bug in gtkmm3 (which did not exist with gtkmm2 before)
which happens when using Gtk::MenuItem::set_accel_path() to assign a global
keyboard accelerator to a menu item. Since gtkmm3 the respective keyboard
accelerator action is still triggered, but the accelerator keys were no longer
displayed in the menu.

I first thought this to be a bug in Gtk(3), so I started the discussion about
this issue there:

        https://mail.gnome.org/archives/gtk-devel-list/2018-February/msg00025.html
        https://mail.gnome.org/archives/gtk-devel-list/2018-February/msg00027.html
        https://mail.gnome.org/archives/gtk-devel-list/2018-February/msg00028.html
        https://mail.gnome.org/archives/gtk-devel-list/2018-February/msg00029.html

But meanwhile it rather looks like a bug in gtkmm3 to me. Attached you find a
quick hack against gtkmm3 which resolved this bug for me. Like I mentioned in
the last post on the gtk list, I have no idea why that acceleration label was
created explicitly in the gtkmm "MenuItem" class there. Was it still there for
purpose or was it just some legacy code?

Note that (in gtk3 at least) a GtkAccelerationLabel is automatically always
created as child widget by GtkMenuItem even if no acceleration keys are used
at all for the menu item.

CU
Christian
_______________________________________________
gtkmm-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtkmm-list

gtkmm3-accel-path.patch (960 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Gtk::MenuItem::set_accel_path()

Kjell Ahlstedt-2
I have committed your patch to git's gtkmm-3-22 branch (gtkmm3) and
master branch (gtkmm4). Usually a bug report in Bugzilla is a better
place than gtkmm-list for attaching patches.

https://git.gnome.org/browse/gtkmm/commit/?h=gtkmm-3-22&id=e5c8c2df67d0d7ec255055984e8f07d0f0fa0862

https://git.gnome.org/browse/gtkmm/commit/?id=336eb15a408063a93a501ee80470f54159075cfb

Kjell

On 2018-02-08 21:26, Christian Schoenebeck wrote:

> Hi,
>
> I just investigated a bug in gtkmm3 (which did not exist with gtkmm2 before)
> which happens when using Gtk::MenuItem::set_accel_path() to assign a global
> keyboard accelerator to a menu item. Since gtkmm3 the respective keyboard
> accelerator action is still triggered, but the accelerator keys were no longer
> displayed in the menu.
>
> I first thought this to be a bug in Gtk(3), so I started the discussion about
> this issue there:
>
> https://mail.gnome.org/archives/gtk-devel-list/2018-February/msg00025.html
> https://mail.gnome.org/archives/gtk-devel-list/2018-February/msg00027.html
> https://mail.gnome.org/archives/gtk-devel-list/2018-February/msg00028.html
> https://mail.gnome.org/archives/gtk-devel-list/2018-February/msg00029.html
>
> But meanwhile it rather looks like a bug in gtkmm3 to me. Attached you find a
> quick hack against gtkmm3 which resolved this bug for me. Like I mentioned in
> the last post on the gtk list, I have no idea why that acceleration label was
> created explicitly in the gtkmm "MenuItem" class there. Was it still there for
> purpose or was it just some legacy code?
>
> Note that (in gtk3 at least) a GtkAccelerationLabel is automatically always
> created as child widget by GtkMenuItem even if no acceleration keys are used
> at all for the menu item.
>
> CU
> Christian
>

_______________________________________________
gtkmm-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtkmm-list