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

Unintentional mouse dragging #376

Closed
j-hui opened this issue Jan 20, 2020 · 17 comments
Closed

Unintentional mouse dragging #376

j-hui opened this issue Jan 20, 2020 · 17 comments
Labels
performance Sloooooow.

Comments

@j-hui
Copy link

j-hui commented Jan 20, 2020

Quite often as I'm browsing webpages, I'll notice that when I click something, the mouse up event doesn't appear to register, and the click will fail to register. And even though I don't have the mouse button held down, as I move the cursor around, it'll appear as if I'm dragging the cursor with the button held (so I end up highlighting a bunch of text, etc.).

I've managed to isolate the issue to Yabai: it only appears when I have the yabai service turned on, and disappears as soon as I turn it off. I'm not sure how else to measure the event when it occurs, or reproduce it reliably – though it does happen quite often when Yabai is on.

I installed Yabai simply using brew install yabai, and haven't turned off SIP (I'd prefer to keep it on for security reasons). I'm on macOS 10.14.6 (though preparing to upgrade to Catalina soon).

@koekeishiya koekeishiya added help wanted Community help appreciated question Request for information or help, not an issue labels Jan 22, 2020
@noperator
Copy link

noperator commented Jan 24, 2020

Glad to see I'm not the only one…I experience this all the time! When I click between Firefox tabs, for instance, the click often won't "release" and I'll end up inadvertently dragging the tab across the screen and creating a new browser window. Here are the mouse-related lines from my .yabairc:

yabai -m config focus_follows_mouse          off
yabai -m config mouse_follows_focus          off
yabai -m config mouse_modifier               fn
yabai -m config mouse_action1                move
yabai -m config mouse_action2                resize

You can view my full config here. I was running version 2.1.3 until today—just updated to 2.2.2. I'll report back if I continue to experience this issue.

@j-hui
Copy link
Author

j-hui commented Jan 25, 2020

for reference, my mouse settings were the same as @noperator --- this is the default setting. recently, i commented out mouse_modifer and mouse_action2 --- not sure if that fixed it or not, will report back if I experience more problems.

@j-hui
Copy link
Author

j-hui commented Jan 25, 2020

Update: it happened again, even with the following settings:

yabai -m config mouse_follows_focus          off
yabai -m config focus_follows_mouse          off
# yabai -m config mouse_modifier               fn
yabai -m config mouse_action1                move
# yabai -m config mouse_action2                resize

@friederbluemle
Copy link

I also noticed this behavior.. It would be great if this could be fixed.
I'll play around a bit with the config and see if it makes any difference.

@friederbluemle
Copy link

friederbluemle commented Jan 25, 2020

I don't think it really matters, but my config looks like this

yabai -m config mouse_modifier               alt
yabai -m config mouse_action1                move
yabai -m config mouse_action2                resize

The only difference is the mouse_modifier key - alt is the "Option" key on a Mac, or Super key on a standard keyboard. I use this key to move and resize windows (and perform other WM related actions) on Linux. It's really nice to have parity behavior on macOS.

EDIT:
I'm on macOS 10.15.2 Catalina, with SIP (partially) disabled.

@koekeishiya
Copy link
Owner

I'm unable to reproduce this issue (tested with Chrome in particular).

@koekeishiya koekeishiya added bug Something isn't working obscure Weird behaviour that is difficult to debug and removed question Request for information or help, not an issue labels Jan 26, 2020
@noperator
Copy link

I still regularly experience this issue. It tends to happen when my CPU is heavily utilized—e.g., during a Teams/Slack video call. I notice other symptoms at the same time, like mouse clicks not registering at all, or windows not snapping into position (or even not being recognized by yabai, so they're effectively treated as floating windows).

@qaisjp
Copy link

qaisjp commented Jan 31, 2020

Just installed yabai yesterday for the first time and I've been getting this too.

yabai -m config mouse_follows_focus          off
yabai -m config focus_follows_mouse          autofocus
yabai -m config window_placement             second_child

yabai -m config mouse_modifier               fn
yabai -m config mouse_action1                move
yabai -m config mouse_action2                resize

Full config

I still regularly experience this issue. It tends to happen when my CPU is heavily utilized

Could be. I had two things running at 100% cpu utilisation. (And I have no idea why... one of them was zsh with something about skhd in the "Open Files and Ports" window, but killing it didn't kill skhd itself. Probably unrelated.)

@j-hui
Copy link
Author

j-hui commented Feb 1, 2020

@noperator +1 for heavy CPU usage. I observe this most often when interacting with Google Chrome, especially when creating spikes in CPU usage by opening tabs in the background.

I tried putting my OS under load with stress with various configurations but was unable to reproduce the dragging issue with the text in my terminal emulator (kitty) – I had another window with htop open to ensure that CPU load was indeed being brought to 100% on all logical cores. That being said, my laptop actually remained fairly responsive despite being under heavy stress, which to me raises questions about what the hell Chrome is doing more than anything else.

@j-hui
Copy link
Author

j-hui commented Feb 1, 2020

@koekeishiya the problem seems to be exasperated by my poor habit of having too many tabs open, often with graphics-heavy content.

koekeishiya added a commit that referenced this issue Feb 8, 2020
@koekeishiya
Copy link
Owner

koekeishiya commented Feb 8, 2020

Made some change on master regarding mouse tracking, but I don't think it will matter.
I think this problem is outside of my control - it appears that either macOS or the application in question drop events under heavy load when a third party tool has subscribed to event notifications.

yabai is not doing anything questionable here - it is simply subscribing to mouse-events using the Quartz Event Services API: https://developer.apple.com/documentation/coregraphics/quartz_event_services?language=objc

Edit: Changes are a part of v2.2.3 as well, but yeah, don't really think they matter.

@rockyzhang24
Copy link

rockyzhang24 commented Feb 15, 2020

Same here! My yabai is the latest (2.3.0). I am experiencing this issue when I deal with the tabs in Google Chrome. I tried to open a new tab by pressing "+" button, and then quickly move the mouse pointer to the "x" button of its previous tab to close that previous tab. I could see that the reaction was very sluggish. For example, the button became shaded even when I moved the mouse pointer out of the button; And also, the tab was closed seconds later after I clicked the "x" button.

This issue happens on handling the tabs no matter how many tabs I have created.

My macOS is 10.15.3. Thanks!

Edit: @koekeishiya Is it possible to fix this? Thank you.

@dnakov
Copy link

dnakov commented Apr 14, 2020

I was having the same issues described here, sometimes even clicking on a link on a webpage would not register and I'd be left with it dragging.

As I'm not using any of the mouse-related yabai features, I ended up just returning EVENT_SUCCESS from all the mouse EVENT_CALLBACKs in event.c and haven't had that issue happen since. Overall, clicking on things seems more responsive now.

@koekeishiya
Copy link
Owner

Should be resolved on master. Please verify.

@koekeishiya koekeishiya added addressed on master; not released Fixed upstream, but not yet released and removed help wanted Community help appreciated labels Apr 14, 2020
@koekeishiya koekeishiya added performance Sloooooow. and removed bug Something isn't working obscure Weird behaviour that is difficult to debug labels Apr 14, 2020
@noperator
Copy link

Just installed yabai from HEAD and noticed an immediate difference. I can't tell you how much of a relief it is not to be unintentionally dragging windows all over my screen. Thanks @dnakov @koekeishiya!

@maricn
Copy link

maricn commented Feb 4, 2023

i'm having all of the described issues on the latest version of yabai.. maybe important to mention that i'm on mpb with m1 pro (apple silicon)..

should i open a new issue and/or provide some debug info?

tnx!

@azinsharaf
Copy link

As a yabai user (HEAD version) i can confirm it should work in mbp m1 (Ventura 13.2 at this time) It is my daily driver. Have you used the installation instruction? It is possible you've missed a step? At the beginning when i installed it i had many issues with it but was able to fix them one by one. I would suggest to submit a new issue since this one is for the old version.
Also maybe a fresh reinstall can help. Hope all work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Sloooooow.
Projects
None yet
Development

No branches or pull requests

9 participants