! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
problem with menu/submenu creation
Status:
RESOLVED: FIXED
Product:
Xfdesktop
Component:
General

Comments

Description Yves-Alexis Perez editbugs 2010-02-01 07:32:04 CET
Created attachment 2813 
Fix menu/submenu creation and show

Hey,

Grégoire Gentil (which uses Xfce on the Touch Book) spotted a bug in libxfcegui4 (and maybe xfdesktop) about menu creation. He recently sent a mail on xfce-dev (but got no answer), and, after investigation, managed to fix that (for 4.4), the patch is here:

According to http://library.gnome.org/devel/gtk-tutorial/stable/c1501.html there's no need to gtk_widget_show() the submenu after creating it, so it seems GTK+ gets confused in case it receives events one by one (like in the touchscreen).

It seems that the correct behavior would be to:

* submenu = gtk_menu_new();
* create and append the submenu items
* create the menuitem
* show the submenu items

I'm not exactly sure what that means precisely for libxfcegui4, but in any case the gtk_widget_show(submenu) shouldn't be called after gtk_menu_new().

Attached patch should fix it, and I'm not sure about libxfce4ui.
Comment 1 Yves-Alexis Perez editbugs 2010-02-01 07:34:46 CET
(In reply to comment #0)
> Created an attachment (id=2813) [details]
> Fix menu/submenu creation and show
> 
> Hey,
> 
> Grégoire Gentil (which uses Xfce on the Touch Book) spotted a bug in
> libxfcegui4 (and maybe xfdesktop) about menu creation. He recently sent a mail
> on xfce-dev (but got no answer), and, after investigation, managed to fix that
> (for 4.4), the patch is here:

Here: http://git.alwaysinnovating.com/cgit.cgi/ai.openembedded.dev/commit/?id=c191416f78baf6e1aaf99d14915d1e8bec455ac5

The problem lies more in xfdesktop than libxfcegui4 in the end as it seems.

> Attached patch should fix it, and I'm not sure about libxfce4ui.

As the patch is against xfdesktop, there might not be anything related to libxfce4ui
Comment 2 Nick Schermer editbugs 2010-02-01 09:54:54 CET
Is it confirmed this patch works? It is indeed true you never call gtk_widget_show for menu's so it looks right to me.
Comment 3 Yves-Alexis Perez editbugs 2010-02-01 10:09:47 CET
(In reply to comment #2)
> Is it confirmed this patch works? It is indeed true you never call
> gtk_widget_show for menu's so it looks right to me.

TBH, I didn't have a chance to test it yet, I just ported Grégoire's patch to 4.6 so it might be wise to test it first. I'll try to do that this evening, building on the Touch Book directly.
Comment 4 Nick Schermer editbugs 2010-11-27 10:00:28 CET
Fixed this in 84996fa.

Bug #6198

Reported by:
Yves-Alexis Perez
Reported on: 2010-02-01
Last modified on: 2010-11-27

People

Assignee:
Nick Schermer
CC List:
1 user

Version

Attachments

Fix menu/submenu creation and show (448 bytes, patch)
2010-02-01 07:32 CET , Yves-Alexis Perez
no flags

Additional information