-
-
Notifications
You must be signed in to change notification settings - Fork 108
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
Mouse click event not captured on unfocused displays #392
Comments
This is a side-effect of the new mouse/event system. The new API I am using seems to not report any mouse events on non-focussed displays. I realize that this suboptimal but going back to the rusty Carbon API would be even more suboptimal I think. Maybe I can improve on the current design by doing some more research. |
Thank you! Maybe I can dig into this if I manage to find time. |
v2.16.3 fixed this issue for me. Cheers. |
screenrecord.mp4Hi, @FelixKratz, I have upgraded to mac os sonoma today, and faced with slightly similar issue. Sketchybar: v 2.16.3 |
It is a change in Sonoma that causes mouse events to not work at all. I will soon prepare a patch for Sonoma, then the original issue will be solved as well. |
All of these issues should be fixed in v.2.16.4 |
Hey @FelixKratz - I'm playing around with adding |
I am on 14.2.1 as well and my click scripts seem to be working can you provide a minimal example which does not work for you? Edit: sketchybar --bar color=0xff000000
sketchybar --add item test left --set test label="Click Me" click_script='osascript -e "display dialog \"Works\""' |
My minimal example was the example you shared for popups: #12 However, thanks for sharing ☝️, that's much simpler and also not triggering clicks. I'm running
What else... I'm using AeroSpace (not Yabai), I have SIP disabled. 🤔 If there's some other way I can debug I'm game. Also, I'm happy to open a new Issue. |
We can try some other things to narrow down the problem some more:
sketchybar --add slider slider left 100 --set slider slider.background.color=0xffffffff slider.highlight_color=0xffff0000 slider.background.height=15
sketchybar --add item test left --set test label="Click Me" script='osascript -e "display dialog \"Hallo\""' --subscribe test mouse.clicked
|
|
Ok, next steps for debugging are in code, are you able to build from source? First interesting test would be: Line 20 in 6ff8ffa
and next step after that would be: Line 98 in 6ff8ffa build the binary and see what it prints when you try to click the test item. |
OK, thanks for sticking with my @FelixKratz. I do see "Mouse Event" but I do not see "item: " when adding these debug lines. |
Can you try to find out in which line of this function the mouse handling errors out? Lines 70 to 98 in 6ff8ffa
Maybe first do a sanity check that the event actually reaches this function with a print in the first line and then progressively work through all the
BTW are you using arm or intel? |
OK, I don't know what I did wrong last time but I am getting all the way through wid: 362
adid: 0
after bar_manager_refresh I'm on Arm. edit - maybe I should look at |
Yes, have a look inside |
Nope, it does not survive here: Line 205 in 6ff8ffa
|
|
Oh I overlooked something above that is probably already the problem.... Can you check why this function returns zero? Lines 101 to 131 in 6ff8ffa
Is it because of an early return due to some error, or does the function go all the way to the bottom?
|
Was just grabbing all the values through
Will checkout |
Looks like |
Can you check the value of |
|
Ok, interesting, I just disconnected my external and the click worked as expected (eg. I saw the "Works" dialog). When I reconnect it does not work. 🤔 |
The function sketchybar --set test display=active should only render the test item (from above) on the active display. Can you check if this is indeed not working by switching focus between displays? |
On both displays: ❯ sketchybar --set test display=active
no value returned, though exit code is 👍. However the item itself seems to be destroyed when running the command (disappears from bar). FWIW - I can reliably reproduce this. External connected I never see the dialog, external disconnected I always see the dialog. |
I can also say that about a week ago, while converting my config to Lua, |
Can you try the latest commit? d2299c8 |
Same behaviour, works w/o external, does not work w/ external. At a glance, |
I think I know why. It has to do with the option: "Displays have separate spaces" in System Settings under Desktop & Dock. The problem with "Displays have separate spaces" being off is that there seems to be no event emitted when the active display changes. It would probably be best to include a check on startup that prevents sketchybar from running if this option is not set appropriately. |
OK, nice find! It's possible I changed this setting in that time span as well (sorry I forgot) when switching from Yabai to Aerospace related docs. I've had some odd issues with that setting enabled so I had switched it off. |
I have included a check on startup. Just too many things are completely broken when the active display id is not reported properly. Maybe I find another way to get the id of the active display which works with "Displays have separate spaces" off, then the bar should again work with this option turned off. |
After upgrading to v2.16.2, clicking on an icon that's not on the current focused display won't produce a mouse click event. For example, I'm now typing in the browser on display 1; if I click a sketchbar icon on display 2, the callback script won't be called. I've tested with a script that prints a message when clicked and confirmed no event was received.
I'm using sketchybar with yabai v5.0.7. Is it possible that yabai's space focus logic interferes with sketchybar?
The text was updated successfully, but these errors were encountered: