Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't select menu item in Motif based software (nedit, ddd, xmgrace) #141

Closed
dpeterc opened this issue May 1, 2021 · 13 comments
Closed
Assignees
Labels
bug Something isn't working fixinbound weston-upstream-bug same issue can be observed with original weston compositor running on other Linux native environment window-management Window management issue

Comments

@dpeterc
Copy link

dpeterc commented May 1, 2021

Environment

Windows build number: Microsoft Windows [Windows 10.0.21370.1]
Distribution version: OpenSuse 15.1
Distribution version: Ubuntu 20.4
Windows subsystem for Linux Update: 5.10.16
WSLg version: 1.0.17.1

Steps to reproduce

Install any Motif based software in the Linux, for example nedit, ddd, mgdiff, xmgrace, try to select an item from a menu with mouse, for example
File > Open...

Also, in standard Motif behavior, you can use keyboard arrows to select the menu entry, for example arrow down to select the desired entry, and [Enter] to confirm it.

Expected behavior

After selecting the menu item, the respective function should be called.
For example, on File > Open... File selection box should open and allow selecting of the file.

With keyboard navigation with arrows on the menus, you confirm the desired choice by [Enter] and the corresponding function is called.

Actual behavior

Nothing happens, as apparently there is some mouse pointer focus problem, and menu entry isn't called at all.
Menu just closes.
If application supports keyboard shortcuts, the functions are called correctly and they work.
So if you call Ctrl+O, the file selection dialog opens correctly.
The problem happens with all menu entries.

Keyboard navigation on menus only works left and right; you can navigate from the currently open menu to the one on the left or right, but you can not move down or confirm the choice with [Enter]

@dpeterc dpeterc added the bug Something isn't working label May 1, 2021
@hideyukn88
Copy link
Member

@dpeterc , thanks for reporting, I confirmed the issue locally.

There is similar problem is observed with steam (tracked by #6), in steam, the menu selection can be moved and confirm the choice by [enter] key from keyboard, but not by mouse click. But this issue is not exactly same since menu choice can't be confirmed by [enter] key.

But very high chance the root of issue could be common common, it looks the keyboard (for up & down selection) and mouse events are not delivered to the correct window.

@hideyukn88 hideyukn88 self-assigned this May 12, 2021
@dpeterc
Copy link
Author

dpeterc commented May 23, 2021

I have tested the bug again on WSLg 1.0.22, and it remains unsolved.

@hideyukn88
Copy link
Member

@dpeterc , thanks for checking again. This issue hasn't been addressed yet. Once it gets fixed, we will update here, thanks for trying WSLg!

@dpeterc
Copy link
Author

dpeterc commented May 24, 2021

Thanks, I was hoping it would be fixed with this correction:
"support window z order sync with client".

@hideyukn88 hideyukn88 added the weston-upstream-bug same issue can be observed with original weston compositor running on other Linux native environment label Sep 27, 2021
@dpeterc
Copy link
Author

dpeterc commented Nov 16, 2021

Since this bug now carries a label "weston-upstream-bug", could someone also add the link to where the bug was reported upstream?
I can't find it here:
https://gitlab.freedesktop.org/wayland/weston/-/issues

I have tried other Linux distributions in virtual machine with Wayland, and this bug does not happen. But I am not sure if all Wayland implementations actually use Weston or not.

@hideyukn88
Copy link
Member

@dpeterc, sorry for late response. This issue is caused by the if block at https://github.com/microsoft/weston-mirror/blob/2bc5043f1c01c358cc6f5eef45358cdf982ad5b2/xwayland/window-manager.c#L2609. By removing this if block, the menu selection works properly. We are working with upstream maintainer to understand the issue further. Thanks!

@dpeterc
Copy link
Author

dpeterc commented Jun 30, 2022

Thank you very much for the reply.
It appears that the "if" clause is there for a reason, I hope it is not a work around for some fundamental Wayland limitation.
/* Do not let X clients change the focus behind the compositor's

  • back. Reset the focus to the old one if it changed. */
    if (!wm->focus_window || focus->event != wm->focus_window->id)
    weston_wm_send_focus_window(wm, wm->focus_window);
    But popup menus do involve focus change, so this is essential for any Motif based program to work.
    It is also surprising why Motif programs work correctly on Wayland in virtual machine if running latest OpenSUSE 15.4 in VMware. Could it be that OpenSUSE is running Kwin_wayland compositor, and WSLG is running Weston?
    So this bug is specific to Weston?

@hideyukn88
Copy link
Member

@dpeterc, yes, this is an issue in Xwayland window manager implementation within weston project. Since WSLg is based on weston reference compositor, it inherits same issue, thanks!

@dpeterc
Copy link
Author

dpeterc commented Jul 1, 2022

@hideyukn88 looking at the list of Wayland compositors on Gentoo web site
https://wiki.gentoo.org/wiki/Wayland_Desktop_Landscape
it says that Weston is a just a reference implementation, not for general use, and that other compositors like Kwin, Wayfire, Mutter provide more features and are more stable.
I assume that it is not possible to change compositor in WSLG, we have to use Weston that you provide, since it is well integrated with the rest of the project.
So I would suggest that you make the change by commenting the "if" clause that you indicated, or provide an option to enable such behavior. It is common for Linux distributions to apply private security patches or bug fixes for any component.
If WSLG is tightly coupled with Weston, then it needs to be patched in order to fix bugs. And of course, report it upstream, which you already did.

@hideyukn88
Copy link
Member

This is now tracked by https://gitlab.freedesktop.org/wayland/weston/-/issues/636 at upstream.

@dpeterc
Copy link
Author

dpeterc commented Jul 5, 2022

Thank you very much for posting the weston bug track regarding this problem.
I just wish to add that the problem occurs on all Motif based programs with pop-up menus, not just nedit. I chose nedit as an example because it is available on most Linux distributions, and it is easy to test.
There is also new version of nedit, called xnedit, which supports antialiased fonts and UTF8. It also suffers from this bug.
https://sourceforge.net/projects/xnedit/
Then we have on old, but still popular Motif based debugger, DDD, which also exhibits the bug.
https://www.gnu.org/software/ddd/
There is other Motif software, more in the scientific field, which is still developed and used.
https://pymolwiki.org/index.php/PyMOLProbity
https://xephem.github.io/XEphem/Site/xephem.html
https://www.baudline.com/

@hideyukn88
Copy link
Member

The fix is submitted at upstream, https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/956.

@hideyukn88
Copy link
Member

Fixed in WSLg 1.0.41

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixinbound weston-upstream-bug same issue can be observed with original weston compositor running on other Linux native environment window-management Window management issue
Projects
None yet
Development

No branches or pull requests

2 participants