Created attachment 221776 [details]
On some GUI applications menus will fail to open. On first attempt they may open, but after some number of successful attempts, eventually it will fail. This happens for on both www/chromium and editors/vscode. It happens both if the applications have been installed from ports, or via pkg. It happens on bare metal hardware and in a VMware Fusion VM.
Steps to reproduce:
1. Start from a stock 12.2-RELEASE installation.
2. Install chromium from ports or via pkg
3. Click on kebab ("more options") icon.
Here is a video recording of the bug in action. On the first open of chromium the menu does not open at all. On a subsequent attempt it opens the first time, but then later does not open.
This bug also occurs with Visual Studio Code, clicking on the menubar ("File, Edit, etc.") Hence, my filing this bug under a common library, x11-toolkits/gtk30. If the bug does not lie in x11-toolkits/gtk30 feel free to rename/reassign.
FreeBSD pepper 12.2-RELEASE FreeBSD 12.2-RELEASE r366954 GENERIC amd64
Tested other GUI applications, and the bug does not occur with Audacity or Firefox.
It has been suggested that twm may be the source of the bug, and maybe related to focus follow? https://old.reddit.com/r/freebsd/comments/l1pm1g/bug_where_menus_will_not_open_chromium_vs_code/gk0xyx1/
I also found https://community.oracle.com/tech/developers/discussion/3547864/rhel-6-4-using-twm-and-vnc-issue-with-mouse-clicks-in-java-fx-2-2-app which describes similar behavior.
I tried out ctwm and I cannot get the bug to occur. All menus open fine.
(In reply to anthony.elizondo+freebsd from comment #1)
I would recommend, that you test whether it works with a different window manager for you. If so, then it is a twm issue, if not, we can investigate further.
> I tried out ctwm and I cannot get the bug to occur. All menus open fine.
(In reply to anthony.elizondo+freebsd from comment #3)
You might be able to set an environment variable suggesting that you are running a desktop like gnome or kde, and see if it works then in twm, for example XDG_CURRENT_DESKTOP
In twm I tried setting XDG_CURRENT_DESKTOP to "kde" first, then tried "GNOME". Neither had any effect on either VSCode or Chromium.
I posted to https://old.reddit.com/r/freebsd/comments/l1pm1g/bug_where_menus_will_not_open_chromium_vs_code/ and confirmed others can reproduce.
(In reply to anthony.elizondo+freebsd from comment #6)
Have you tried the patch attached in redit?
A commit in branch main references this bug:
Author: Adriaan de Groot <adridg@FreeBSD.org>
AuthorDate: 2021-05-04 10:12:41 +0000
Commit: Adriaan de Groot <adridg@FreeBSD.org>
CommitDate: 2021-05-04 23:10:26 +0000
x11-wm/twm: generate synthetic WM hints when needed
This is based on a patch from Reddit -- the patch on Reddit is in
context-diff form and contains a bunch of cruft, so it's been
re-done (in add_window.c ; the util.c part is used unchanged).
Tested by running Chrome in previous twm -- no drop-downs at
all -- and in this lightly patched one, where it does behave.
Obtained from: Reddit
x11-wm/twm/Makefile | 1 +
x11-wm/twm/files/patch-src_add__window.c (new) | 12 +++++++
x11-wm/twm/files/patch-src_util.c (new) | 47 ++++++++++++++++++++++++++
x11-wm/twm/files/patch-src_util.h (new) | 11 ++++++
4 files changed, 71 insertions(+)
The Reddit patch had a bunch of duplication and the latter part (of the patch to add_window.c) seemed to be duplicate code with lots of unsure-comments, so I left it out. Testing with Chromium shows that the issue -- at least the one I could see in the video -- is resolved.