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

Fix #4156 (OSD stealing mouse clicks from OSC even while hidden), #4612: (OSC responds to mouse hover when behind OSD) #4637

Merged
merged 3 commits into from Jan 14, 2024

Conversation

svobs
Copy link
Contributor

@svobs svobs commented Oct 5, 2023


Description:

Could not have been a more straightforward fix. When the OSD was hidden, its alpha was set to 0, but isHidden was never set to true (looks deleted or forgot to include).

Update: added a fix for #4612, since it needed the original fix as a prerequisite.

@svobs svobs changed the title Fix #4156: OSD stealing mouse clicks from OSC even while hidden Fix #4156 (OSD stealing mouse clicks from OSC even while hidden), #4612: (OSC responds to mouse hover when behind OSD) Oct 5, 2023
@svobs
Copy link
Contributor Author

svobs commented Oct 5, 2023

Added another commit which fixes #4612.

It also adds an else which takes care to hide the thumbnail when it is determined it should not be shown. This may help with #4559.

Copy link
Member

@uiryuu uiryuu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sidebar can also cover the thumbnail, please also fix this issue. Otherwise this pr is good to merge.

@@ -2265,6 +2262,16 @@ class MainWindowController: PlayerWindowController {
}
}

private func refreshSeekTimeAndThumnail(from event: NSEvent) {
let isCoveredByOSD = !osdVisualEffectView.isHidden && isMouseEvent(event, inAnyOf: [osdVisualEffectView])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also found that if the sidebar covers the thumbnail, it will also trigger the thumbnail, and I've confirmed that something like this
let isCoveredBySidebar = !sideBarView.isHidden && isMouseEvent(event, inAnyOf: [sideBarView])
and checking both isCoveredByOSD and isCoveredBySidebar is able to fix this problem

@@ -2265,6 +2262,16 @@ class MainWindowController: PlayerWindowController {
}
}

private func refreshSeekTimeAndThumnail(from event: NSEvent) {

This comment was marked as resolved.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pushed another commit which should address feedback, thanks.

@svobs svobs force-pushed the pr-fix-floating-osc-click-over-osd branch from b9b8a78 to 1039c9b Compare December 29, 2023 23:59
@svobs svobs force-pushed the pr-fix-floating-osc-click-over-osd branch from 1039c9b to 6566561 Compare December 30, 2023 00:02
@uiryuu uiryuu merged commit 26d4703 into iina:develop Jan 14, 2024
1 check passed
@uiryuu
Copy link
Member

uiryuu commented Jan 14, 2024

Thanks!

@low-batt low-batt linked an issue Mar 18, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OSC responds to mouse when behind the OSD
3 participants