pharo-project / pharo

Pharo is a dynamic reflective pure object-oriented language supporting live programming inspired by Smalltalk.
http://pharo.org
Other
1.21k stars 355 forks source link

[Linux] Strange Event effect when clicking in resized window (Pharo not working on latest Ubuntu Wayland, only X11) #14459

Open astares opened 1 year ago

astares commented 1 year ago

On a latest Ubuntu 23.04 (used in virtual box) I install Pharo 11 use ZeroConf:

curl https://get.pharo.org/ | bash

If I click in the regular rectangle that is opened by the Pharo window the clicking is normally received and I can use the Pharo tools.

BUT: If I resize the Pharo window from its default size to be larger and then left click somewhere into the new area Pharo does not receive the event - instead this event is given to the window behind (which is then brought in front).

If I right click into such an area I get the context menu of the window behind (an Ubuntu window) and not the Pharo world menu

image

Looks like I can only click and use Pharo within the rectangle of the original windows size - although the window fills more space. Very strange.

astares commented 1 year ago

Have the same effect with an older Pharo (Pharo 8). When starting ANY Pharo on LATEST UBUNTU using

./pharoi-ui Pharo.image

one can use Pharo tools as long as the window is not resized.

But if one makes the window larger one can not click into the new area.

Looks like this is a general issue on any new Ubuntu, I used ubuntu-23.04-desktop-amd64.iso from https://ubuntu.com/download/desktop

astares commented 1 year ago

OK - found the issue:

On latest UBUNTU when you do

echo $XDG_SESSION_TYPE

you get Wayland - which seem to cause the trouble.

If you log out current session and click your username in login screen. Then click the bottom right gear button and select “Ubuntu on Xorg“ instead of "Ubuntu". Finally, type password to login.

See https://ubuntuhandbook.org/index.php/2022/05/chrome-double-click-ubuntu-2204/

image

If you now check

echo $XDG_SESSION_TYPE

you get X11 and Pharo works.

I think Pharo is still following X11 and not using the new Wayland window management.

Workaround Chrome / Chromium Double-click Maximize Not Working in Ubuntu 22.04 | UbuntuHandbook
astares commented 1 year ago

So a more recent Ubuntu now defaults to Wayland instead of X11. Wayland is a replacement for the X11 window system protocol and architecture with the aim to be easier to develop, extend, and maintain. Pharo is not supporting Wayland yet correctly. As described above one can switch Ubuntu back to use X11 and then Pharo works fine.

In the mid-term I think Pharo requires adoption to support Wayland.

astares commented 1 year ago

@estebanlm told me there is a new OBS updated for Ubuntu 23.04 in "stable"

Package: https://download.opensuse.org/repositories/devel:/languages:/pharo:/stable/xUbuntu_23.04/

Instructions on: https://software.opensuse.org//download.html?project=devel%3Alanguages%3Apharo%3Astable&package=pharo-ui

I will check this briefly, hopefully this week.

/repositories/devel:/languages:/pharo:/stable/xUbuntu_23.04 - openSUSE Download
astares commented 1 year ago

Same effect, unfortunately not working when in "Wayland" mode.

Here is a video to demonstrate the strange effect:

Screencast from 2023-09-04 18-17-12.webm

Unfortunately the video does not show the mouse cursor, but here are the steps one can see:

Its also strange that I can not grab any side of the Pharo window (and resize with the cursor changing). I can only double click to make the window bigger.

mdiin commented 11 months ago

Chiming in here, as I actually had Pharo working flawlessly on Wayland with Fedora Kinoite up until a couple of days ago. I am not certain what part of the system update did it, but now the Pharo graphics only draw after the mouse moves into the area where the UI widget should be active. Switching to an X11 session the widgets draw as they should.