hyprwm / Hyprland

Hyprland is an independent, highly customizable, dynamic tiling Wayland compositor that doesn't sacrifice on its looks.
https://hyprland.org
BSD 3-Clause "New" or "Revised" License
21.44k stars 897 forks source link

dragging interactive widgets no longer working in some applications #4186

Closed UltraBlackLinux closed 9 months ago

UltraBlackLinux commented 10 months ago

Hyprland Version

0.33.1.r48.9ca0c7d8

Bug or Regression?

Regression

Description

After maybe one or two weeks I decided to update hyprland again, and since then, I am no longer able to drag sliders or knobs in Bitwig Studio

How to reproduce

  1. Download bitwig-studio (has a free demo mode)
  2. Drag the volume slider on a track or drag knobs to turn them
  3. They move the slightest bit, as if the clicks were registered as single mouse clicks

Crash reports, logs, images, videos

hyprland.log

vaxerski commented 10 months ago

git bisect please

UltraBlackLinux commented 10 months ago

Two problems:

  1. I've never done this before, but I guess the git docs can somewhat help
  2. I'm using the AUR package (hyprland-git) to install hyprland, and I have no idea how to do bisecting in there

Edit: Well that's still like 10 pages of commits so I guess that won't help Edit 2: Arch wiki to the rescue, will report back soon

UltraBlackLinux commented 10 months ago

I cannot compile the bisect result since the part of the build script that does something in tmpwlr tries to copy a nonexistant library file to the packaging directory, I did however notice something: The commit I just mentioned is actually not from the second most recent version I had installed. That was in fact https://github.com/hyprwm/Hyprland/commit/11d1c504 and since that commit actually has something to do with focus I'd actually say the issue was introduced around about there. To clarify: The commit that I linked to works, but the newest commit doesn't

vaxerski commented 10 months ago

is there anything besides bitwig that I can test this on

UltraBlackLinux commented 10 months ago

I'm sorry but bitwig is everything that I encountered this on... I assume that similarly working applications have the same problem.

What sets the bitwig widgets apart is that they grab the mouse when you use them. I think there's some weird kind of focus issue where it instantly ungrabs or focuses some invisible popup where it shouldn't

UltraBlackLinux commented 10 months ago

I just noticed that it in fact is a focus problem. The moment it should grab the mouse the focus shortly moves to an invisible window before returning back to the application, and thus ungrabbing the mouse. It's not related to follow_mouse - I just tried toggling that, but no change.

Edit: Something I've also noticed that might be related as well is that, again without follow_mouse enabled, I cannot select the topmost toolbar in the steam client. the moment I try to hover over the popup it apparently changes focus and immediately closes that popup.

UltraBlackLinux commented 9 months ago

I found something at last: This weird selection issue seems to completely de-select the window as a whole for just a split second.

I ran this script: while true; do hyprctl activewindow | grep initial; sleep 0.01; done and after trying to drag a widget it showed no window class and no window title, so it's not an issue with a popup or something like that. It's straight up losing focus out of the blue...

vaxerski commented 9 months ago

sounds like xwayland shenanigans

UltraBlackLinux commented 9 months ago

it is related to hyprland though, since it was working with a previous build.

Bitwig is indeed running on xwayland, you are correct at that.

UltraBlackLinux commented 9 months ago

I asked the Bitwig community and I was told that Wayland support is not going to be a thing anytime soon since wayland does not support embedding windows, which is apparently required for audio plugins to work properly

UltraBlackLinux commented 9 months ago

is there anything besides bitwig that I can test this on

can I ask why you're so hesitant to install bitwig? If it's not because you have better things to do, then the only problem I'm seeing is that the package is like 300 megs big, but you can find bitwig in the aur and chaotic aur. It has a trial (which is infinite I believe) that doesn't require an account or anything like that, so it's pretty easy to test it

UltraBlackLinux commented 9 months ago

I just found out that the aur just uses git for their makefiles, so I was able to use an older revision, manually git bisected the commits, and this is the bad commit: https://github.com/hyprwm/Hyprland/commit/ba2af6f86d26fbf4b51aa37bf901e0118f46bbe3

Please add a toggle for that or something like that ;) Sorry for the hassle, this really wasn't too difficult

The problem seems to stem from the fact that once the cursor is grabbed, the focus is entirely removed from the window for the duration of the drag, which grabs the cursor. It's promptly ungrabbed, which refocuses on the bitwig window

vaxerski commented 9 months ago

right. Probably needs a check for active grabs. I'll whip up a patch later, currently in italy in a bus

remind me in 2 days if I forget please

UltraBlackLinux commented 9 months ago

@vaxerski Ding Ding

UltraBlackLinux commented 9 months ago

did you even get the notification? or are you already working on it? You're usually extremely fast when it comes to fixing bugs or adding features, so excuse me for asking ;)

vaxerski commented 9 months ago

I have shit real life stuff going on and I just forgot. Sec

vaxerski commented 9 months ago

patch.txt try this

UltraBlackLinux commented 9 months ago

Edit: Ignore what I said, your patch working perfectly, thank you so much!

UltraBlackLinux commented 9 months ago

could you merge that?

vaxerski commented 9 months ago

I could