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

The two screen calibration clicks return the same position in Wayland #8

Open
thelabcat opened this issue Jun 23, 2024 · 12 comments
Open
Labels
bug Something isn't working

Comments

@thelabcat
Copy link
Owner

Click opposite corners of the touch area.
(1156, 549)
(1156, 549)
touch offset (1156, 549) 
touch size (0, 0)
dconf: symbol lookup error: /lib64/libdconf.so.1: undefined symbol: g_once_init_leave_pointer
Exception in thread Thread-1:
Traceback (most recent call last):
  File "threading.py", line 1073, in _bootstrap_inner
  File "DS_FPS_mousefix.pyw", line 175, in run
  File "DS_FPS_mousefix.pyw", line 260, in abs_to_rel
ZeroDivisionError: division by zero
@thelabcat thelabcat added the bug Something isn't working label Jun 23, 2024
@thelabcat thelabcat changed the title abs_to_rel() encounters ZeroDivisionError in Wayland The two screen calibration clicks return the same position in Wayland Jun 26, 2024
@thelabcat
Copy link
Owner Author

Even by copy pasting the exact screen calibration code, I was unable to reproduce getting two clicks with the same position. I watched the program run in the console, and it's not because it's registering the same click twice (at least not directly). It waited for the second click to print the same coordinates again.

@thelabcat
Copy link
Owner Author

Confirming, neither this nor #7 affect the Windows version, even with the same old mouse, keyboard, and PyAutoGUI libraries.

@thelabcat
Copy link
Owner Author

Even by copy pasting the exact screen calibration code, I was unable to reproduce getting two clicks with the same position.

I was later able to reproduce by making the IDLE window lose focus, that is, clicking an area outside it. Note, if I clicked outside it and then clicked inside, the mouse position was reported correctly.

@thelabcat
Copy link
Owner Author

Using PyAutoGUI's Mouse Info app, I discovered that position stops reporting as updated when the mouse is not over IDLE or the Mouse Info window. Thus, the mouse position getting system is restricted.

@thelabcat
Copy link
Owner Author

PyAutoGUI uses Xlib, so the mouse module must be having a separate issue?

@thelabcat
Copy link
Owner Author

See boppreh/mouse#142

@thelabcat
Copy link
Owner Author

PyAutoGUI uses Xlib, so the mouse module must be having a separate issue?

Oddly, the mouse module has the exact same behavior.

@thelabcat
Copy link
Owner Author

thelabcat commented Jul 1, 2024

I caused Wayland to grant input control to Python first, but this did not make the position reporting work correctly.

@thelabcat
Copy link
Owner Author

Oh, the mouse module might just use the device reading for buttons, but still use xlib position sensing, which relies on XWayland, which is probably limited to the creating window.

@thelabcat
Copy link
Owner Author

Test to do: Have the mouse fix window maximized behind the emulator window, and see if that lets position reporting work as the mouse cursor is over both of them.

@thelabcat
Copy link
Owner Author

Test to do: Have the mouse fix window maximized behind the emulator window, and see if that lets position reporting work as the mouse cursor is over both of them.

Did not work. However, I found out that OTHER windows from DIFFERENT processes that are also using XWayland let the system work. Maybe if I could somehow make MelonDS launch with XWayland?

@thelabcat
Copy link
Owner Author

TYJ, that does work! See this article for information on how to do it:

So, to force a non-flatpak application to run in Xwayland, simply type in the terminal (or modify the launcher):

env -u WAYLAND_DISPLAY

For flatpak applications, it's a bit different.

Download Flatseal from flathub, change permissions of your application or game in Flatseal to remove the "Wayland" socket. In my experience, in versions of KDE lower than 5.23, you might need to disable "fallback-x11" socket as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant