Opened 5 months ago

Closed 5 months ago

Last modified 6 weeks ago

#18807 closed defect (invalid)

wxMenu on touch screens

Reported by: djwdg Owned by:
Priority: normal Milestone:
Component: wxGTK Version: dev-latest
Keywords: touch screen menu Cc: djwdg@…
Blocked By: Blocking:
Patch: no


Ref: wxwidget forum entry by the same name
This is with wxWidgets 3.1.4 on a Dell Venue II Pro 7140 with ubuntu 20.04. Touch seems to work for everything that needs a left mouse click except menu items. The touch hilites the menu item but does nothing else. Double-touching doesn't do anything. Long-touching doesn't do anything. For what it's worth, if a keyboard is attached, hitting ENTER activates the hilited menu item. Both the "minimal" and the "menu" samples exhibited this behavior. Again, for what it's worth, with a usb mouse, all things work as expected. With other apps (e.g. firefox), touch selects menu items without issue. Thanks for your consideration.

wxwidgets version: 3.1.4 (latest in git as of around 20200702)
libgtk-3-0 3.24.20-0ubuntu1
wx-config --selected-config: gtk3-unicode-3.1

results from doing things with the "menu" sample

--touched the File menu header--
A menu has been highlighted (id=-2001).
A menu has been opened.
-- touched Show Dialog, turning the background gray --
A menu has been closed.
A popup menu has been highlighted (id=-1).
A menu has been highlighted (id=101)
-- touching Show Dialog again did nothing --
-- touched Exit, turning its background gray and Dialog's white --
A popup menu has been highlighted (id=-1).
A menu has been highlighted (id=5006).

Change History (8)

comment:1 Changed 5 months ago by vadz

  • Component changed from GUI-all to wxGTK

Firefox doesn't use GTK so, just to be sure, could you please confirm if this works in the other GTK applications (basically anything that is part of Gnome would do)?

Unfortunately I don't really see anything obviously wrong in our code and I can't test this myself, so the best hope of fixing this would be to try debugging it further. E.g. I'd start with checking if our menuitem_activate() (see src/gtk/menu.cpp) is being called at all?

comment:2 Changed 5 months ago by djwdg

  • Cc djwdg@… added

After a quick perusal, things that work are Mines, Sudoku, Disk Analysis, and basically any program with a black top bar and with options selected by the button with three horizontal lines. Things that have the same issue as what I saw are lebreoffice and klondike.

Did some breakpointing with the debug code on the menu sample. menuitem_activate() gets called 3 times before the gui shows up. It gets called two more times if the Menubar header is touched or clicked. It does not get called again with any touch action. If, to pick a case, a mouse clicks File->Exit, it gets called after the pulldown disappears.

comment:3 Changed 5 months ago by vadz

I'm pretty sure we should be getting the "activate" signal when the item is, well, activated, so if we're not getting it, we must be doing something to disable it, but I have no idea what...

I thought that it could have something to do with the gestures support (see all the code inside #ifdef wxGTK_HAS_GESTURES_SUPPORT in src/gtk/window.cpp), but it shouldn't be executed at all unless EnableTouchEvents() is called -- and it isn't, in the menu sample.

If I were debugging this myself, I'd start with a simple GTK sample (e.g. something like the one at -- amazingly, there doesn't seem to be a GTK 3 version) and try to find the source of the difference in behaviour between it and wx sample. This is not something particularly quick or simple to do, of course, but I just don't know how else to tackle this bug, sorry.

comment:4 Changed 5 months ago by djwdg

  • Cc djwdg@… removed

I was trying to find a gtk testcase as well. I looked at the simplemenu.c example in which is also gtk2. I tried building it with gtk3, having changed gtk_vbox_new to gtk_box_new to get rid of a compile warning. The menu pulldown failed in the same way I observed with the wxWidgets samples. I'm guessing that this is the proper recoding for gtk3. I also tried the example you mentioned from with the same results. Building against gtk3 (with depreciated warnings), the pull-down failed in the same way.

I also tried building both against gtk2. Surprise of surprises, it worked for both. At least, the pull-down menu worked. gtk2 had other issues with the Venue.

So unless you tell me otherwise, i will assume this is a gtk issue and will work with them. Thanks to you and your compatriots for the time you've spent on this. Let me know if I'm supposed to disposition the ticket as resolved.

comment:5 Changed 5 months ago by vadz

  • Resolution set to invalid
  • Status changed from new to closed

I agree that this does look like a GTK issue and in this case there is not much we can do here, sorry. Good luck dealing with GTK people and, if possible, please update this ticket (even though I'll close it) if you have any more information, e.g. links to GTK bug or, ideally, to a GTK commit with the fix. TIA!

comment:6 Changed 5 months ago by djwdg

  • Cc djwdg@… added

I stumbled across a gtk ticket that's been open a few years and just now appears resolved and may be a fix for this.

comment:7 Changed 6 weeks ago by mgrouch

  • Cc mgrushinskiy@… added

I've added a bug report to rasbperry pi OS too.
It's not fixed there

Last edited 6 weeks ago by mgrouch (previous) (diff)

comment:8 Changed 6 weeks ago by mgrouch

  • Cc mgrushinskiy@… removed
Note: See TracTickets for help on using tickets.