-
Notifications
You must be signed in to change notification settings - Fork 20
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
Cursor wraps to the center of the window on certain contextual menus and tooltips #113
Comments
So that I am able to reproduce your issues...are you running those applications in Wayland or X mode? I run Krita and many other Qt apps in Wayland mode and I don't have any issues. These are most of the environment variables in my
Like you mention, there is also the option |
Hi, thanks for the fast reply. I can link you my config, though most of the variables are managed with Nix, so they won't appear in hyprland.conf |
So I understand you are running the Wayland backend for Qt instead of XWayland? Just to double check, with one of the problematic applications open, paste the result of It would be good if you could provide a simple procedure where I can verify the issue. For example, I also have Krita installed on my system, so that would be a valid app for me to test. Tell me something you do there that shows the issue. Or if you have a simple program that shows it very clearly and I can install it too, that would be also useful. |
Yes, I agree, that is why I would like to have a simple case I can reproduce. Matplotlib would also work if you can provide an example. |
import matplotlib.pyplot as plt
plt.plot()
plt.show() In the new window try to hover any of the buttons in the toolbar below. And yes, that does seem to be running xwayland:
|
OK, so it's definitely related to XWayland, because using my backend for matplotlib I don't have that problem, and I see I am running on pure Wayland. I use
|
OK, changing my backend to
|
For matplotlib specifically, I had to install |
Of course, I am not trying to bury the bug. I just wanted to know if it is related to XWayland. There are lots of special cases in Hyprland for that backend. I try to stay away from running any apps that only work under X, and that is why I hadn't seen the problem. I will investigate. I probably forgot something they added specially for XWayland. |
So I retested in multiple setups and I'm absolutely unable to run QT apps with wayland on my machine, and I don't know why. It's frustrating. But glad to know it's only a problem with XWayland, I'll find a way to stop this nonesense with QT when I have more time on my hands |
So I know what is happening. X creates a window for tooltips, so when the tooltip disappears, the window is closed. At window closing, there is a change of focus to the new active window, and that includes a cursor warp. I will try to better understand what the implications of disabling cursor warping when closing windows are, but in reality, there is an option for that already: |
I have done some testing. If I remove cursor warping when closing a window, the cursor will stay where it is. So when I close a window, the new focused window will be the one after it, as expected, but the cursor may be over another window, so as soon as I move the mouse, focus changes to the window where the cursor is pointing. That may create unwanted scrolling and unpredictable behavior as soon as one touches the mouse. I think we discussed this when dealing with the previous bugs. I don't like that. Hyprland doesn't need to warp the cursor because it actually focuses on the window that stays open at the position of the cursor. So I could offer an option to do what Hyprland does: Don't warp the cursor in specific cases like closing windows. That would fix this issue the same way that using Hyprland's own Also, these "tricks" of opening windows like they have to do with X applications will end up disappearing. Let me know what you think or if you have a better idea. |
That sounds nice to me. Can you detect if the window is floating? If so, that may be interesting. When closing a tiling window, most users probably still want the cursor to warp, but a floating window not so much. But in general this is a bit of a weird case... |
Yes, but those tooltip windows are not floating, they are tiled. I get a onWindowRemovedTiling() call when they close. Otherwise, we wouldn't have this problem, because when removing floating windows I don't warp the cursor. It will be relatively transparent, because there will be focus on the window under the cursor instead of the one after the closed one, so the weird animation will happen at close if it has to, instead of when moving the mouse. |
OK, so there was a way to detect those windows without breaking any behavior, so I ended up fixing it and not adding any new options. Fixed in 7385ab8 Let me know if you still encounter any problems. |
Sorry for the late reply, for me that works quite nicely. Matplotlib with the TkAgg backend still has some problems (see video attached), but that's probably an edge-case in the library, not your problem, since it only happens on the border of the button. Notice the flashing border as hyprland switches focus (but the mouse doesn't warp). Video_2025-01-22_10-12-30.mp4 |
I see it, but it also happens using the Dwindle layout in my testing. So it is just XWayland creates a window for the tooltip and changes focus back and forth. I think it is unrelated to the plugin. |
Btw, I'd be careful with that. Had to debug for quite some time yesterday to figure out why some of my games weren't starting anymore. Turns out Unity bundles such an old version of SDL that the wayland backend fails to initialize, so the games crash later on. Unfortunately, SDL doesn't allow a backup driver like QT and GTK |
Yes, thanks. I tried to go hardcore Wayland and then backtrack if things don't work. Fortunately, I don't game much, because Wayland and gaming still have some rough edges. Even Wine 10, which supports a Wayland backend doesn't turn it on by default. I will make a note about this one, thank you. |
When accessing a contextual menu (in Sonobus for example) or when a small tooltip spawns in QT applications (like Krita), the cursor wraps to the center of the window, often rendering the tooltip and/or contextual menu impossible to use.
This only occurs with hyprscroller and not base Hyprland, which indicates me it's a problem with the plugin. You can mitigate the issue by setting
cursor::no_wrap = true
but I don't think it's a sustainable solution.Hyprland version: v0.46.2
Hyprscroller version: e250f38
The text was updated successfully, but these errors were encountered: