fix: overlay not showing on non-primary monitors#969
Conversation
|
@cjpais I can confirm this fixes #811 for macos 26.3. It was driven by claude, so please feel free to just use this as a reference! I am not in love with having it as a macos only fix, given this is also a problem on windows. I will look into a more general fix later today when I test it on my windows machine. |
Two issues prevented the recording overlay from appearing on secondary monitors: 1. Monitor detection compared enigo's cursor coordinates against Tauri's physical monitor bounds without accounting for scale factor. On macOS, enigo returns logical coordinates; on Windows, GetCursorPos behavior depends on the process DPI-awareness context. Dividing monitor bounds by scale_factor normalizes to logical, which is safe on all platforms. 2. calculate_overlay_position used work_area() which returns incorrect coordinates for monitors with negative positions, and LogicalPosition which applied the wrong monitor's scale factor (doubling coordinates). Fix: compute position in physical pixels using monitor bounds directly, and use PhysicalPosition for all callers. Closes cjpais#811 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
7cf0ab4 to
8cf2fb3
Compare
|
Thank you for this, I will try and give this a test soon. Let's see if we can get this in the next release |
|
So I gave this a test and it doesn't seem to work perfectly to me. The behavior is maybe worse than it was before in the sense that at least when I'm testing on my machine and another monitor. When I click to the other monitor and do the transcription, there's like a flash of the overlay trying to be positioned in the right place, and then eventually it goes to the right place, which is good. But the problem is when I come back to my main monitor and click the transcribe button again starting a new transcription, the overlay doesn't show at all. And then when I click the button to finish the transcription, I do see a flash of it show in the right place. And then from there the next transcription on that monitor works as expected. But to me this is a bit of a regression. Maybe it's acceptable, but it would be best to fix it. |
|
I added a fix which worked for me, let me know if it works for you too |
|
@cjpais testing right now! |
|
Tested and it works fantastically without that bug you were mentioning. Shows instantly on the proper monitor in the proper place. Thank you for taking your time to get a proper fix in! |
|
@cjpais I went ahead and cleaned up the diff of this PR to match your fix! I tested and it fully works on my local setup here. |
|
what was the issue with the commit that I had here? you confirmed it worked and I did as well? the extra stuff you did broke the build. just curious the rationale |
Ah I misunderstood, I had thought JUST your commit was desired for the full fix so I moved to just your code changes! |
21ddaee to
c6738e2
Compare
|
@cjpais Hey! Cleaned this up and it should be good to go now. Rebased onto latest main (v0.7.10), squashed into a single commit, and the diff only touches calculate_overlay_position. The build issue from before is fixed and I tested it locally across all my monitors, works great. Sorry about the mess earlier! |
|
Thanks! Let me take a look I will try to merge this today. I actually meant for this to be in 0.7.10 but just forgot |
|
To be honest, I have no idea what the heck this commit history is. I think we both tested on after my commit and everything was fine. I don't see why we needed any other changes to begin with? This just slowed down the merge, and would have meant more testing (which I have limited time for). We already tested and confirmed it worked. I am reverting to that commit. Sorry I am a bit annoyed, I just have limited time to do things and this process was messy and don't want to repeat it again. I do appreciate you taking the time to make the fix. I kicked off a test build again mainly because of merging with main. Would you mind verifying it works again? |
c6738e2 to
e0954ed
Compare
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
🧪 Test Build ReadyBuild artifacts for PR #969 are available for testing. Download artifacts from workflow run Artifacts expire after 30 days. |
I pulled and tested locally. I can confirm it works on my macbook with external displays! Sorry for the headache! My latest consolidation/commit was intended to make the changeset as minimal and focused on the fix as possible, I didn't mean to cause churn in your testing 😅 |
Before Submitting This PR
Please confirm you have done the following:
Human Written Description
The recording overlay wasn't showing on non-primary monitors. The fix replaces
work_area()withmonitor.position()/monitor.size()incalculate_overlay_position, sincework_area()returns incorrect coordinates for monitors with negative positions. The per-platformOVERLAY_TOP_OFFSET/OVERLAY_BOTTOM_OFFSETconstants already account for system chrome (menu bar, taskbar).This is a single focused change to
calculate_overlay_positiononly, based on CJ's fix in e0954ed. Rebased onto latest main (v0.7.10).Related Issues/Discussions
Fixes #811
Community Feedback
Multiple users reported this in #811 across both macOS and Windows multi-monitor setups.
Testing
AI Assistance
If AI was used: