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

Background windows gets minimized when moving topmost window #1809

Closed
thiagomeireless opened this issue Jul 24, 2023 · 11 comments
Closed

Background windows gets minimized when moving topmost window #1809

thiagomeireless opened this issue Jul 24, 2023 · 11 comments
Labels
bug Something isn't working

Comments

@thiagomeireless
Copy link

thiagomeireless commented Jul 24, 2023

I am not sure if this is a bug or a feature (that I would love to disable), but what happens is:

  • I have an application open, e.g.: Firefox
  • I open another application in the same space, that is set to float and sticky, e.g.: Finder
  • I try to use the mouse_modifier + mouse_action1 (move) to move this float application and have 2 different outcomes depending if the application is focused or not:
    • If it's the currently focused window, I can move it as expected and nothing happens to the background applications
    • If it's NOT the currently focused window (e.g.: I clicked the background window), when I try to move it, all the background applications are minimized. <- this is what I want to fix/disable

Here's a video showing what happens:

Screen.Recording.2023-07-24.at.20.43.37.mp4
@koekeishiya
Copy link
Owner

koekeishiya commented Jul 25, 2023

I believe this is macOS system behaviour that interferes. What is the value of your mouse_modifier?
Try to set it to fn or ctrl and see if you can reproduce the issue.

Edit: Assuming this is system behaviour, there is likely a way to prevent it from triggering.

@thiagomeireless
Copy link
Author

Hey @koekeishiya thanks for the quick reply! I never thought the mouse_modifier would be the problem, but it is.

This only happens when using the alt modifier. I tested with ctrl and cmd and both worked fine (didn't test with fn as I use an external keyboard with only 3 left modifiers)

Do you have any idea on how could I prevent it from triggering when using alt modifier?

@koekeishiya
Copy link
Owner

koekeishiya commented Jul 25, 2023

It appears that yabai does not intercept the mouse-click for this action due to the level in which we observe events. I don't have a solution at the top of my head. See #1378 for history.

A fix to this particular issue is to insert ourselves at the HID level instead of AnnotatedSession, as was done originally; d4aa4c9 but that reverts some other fix.

@thiagomeireless
Copy link
Author

I see. Sadly I don't have much C experience to try messing around with it, but as I can change the mouse_modifier to another key and it works fine, feel free to close the issue if you feel like it.

I would still love to be able to use the desired alt modifier, of course 😅

@koekeishiya
Copy link
Owner

koekeishiya commented Jul 27, 2023

You can change this line https://github.com/koekeishiya/yabai/blob/master/src/mouse_handler.c#L286 from

mouse_state->handle = CGEventTapCreate(kCGAnnotatedSessionEventTap, kCGHeadInsertEventTap, kCGEventTapOptionDefault, mask, mouse_handler, mouse_state);

to

mouse_state->handle = CGEventTapCreate(kCGHIDEventTap, kCGHeadInsertEventTap, kCGEventTapOptionDefault, mask, mouse_handler, mouse_state);

and it will fix your problem, but it will revert other fix mentioned in #1378

@koekeishiya
Copy link
Owner

Related to #1877

@koekeishiya
Copy link
Owner

Fixed on master.

@koekeishiya koekeishiya added bug Something isn't working addressed not released Fixed upstream, but not yet released labels Mar 13, 2024
@koekeishiya
Copy link
Owner

Fixed in v7.0.0.

@koekeishiya koekeishiya removed the addressed not released Fixed upstream, but not yet released label Mar 13, 2024
@thiagomeireless
Copy link
Author

Hey @koekeishiya sorry for the ping on a closed issue, but I just upgrade and everything seems to be working well, except now the resize feature (mouse_modifier + mouse_action2) is not working. Trying with alt and cmd and problem persists.

Is there something I might be missing to configure in this new released version? No error logs:

❯ cat /tmp/yabai_thiago.out.log
yabai configuration loaded..
yabai configuration loaded..
yabai configuration loaded..

❯ cat /tmp/yabai_thiago.err.log
(empty)

@koekeishiya
Copy link
Owner

koekeishiya commented Mar 13, 2024

asfd of course changing from AnnotatedSessionTap to HIDTap changes the timestep of reported events causing the resize throttling to change completely... without that code ever being touched.

@koekeishiya
Copy link
Owner

#2160

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

2 participants