Skip to content

Conversation

@dremin
Copy link
Collaborator

@dremin dremin commented Feb 27, 2025

On Windows 8 and newer, as of #123 we use the shell hook messages sent to us when a window moves to another monitor, instead of the global window move event hook that we use on Windows 7.

However, one limitation is that this tells us when the window moves to another monitor, but not necessarily when the monitor it is on is removed. When that happens, the cached HMonitor becomes incorrect.

When the system's displays change, shells that use this value are going to have to handle the display change events anyway to add/remove taskbars, so they will naturally fetch HMonitor from ApplicationWindow.

By ignoring the cached value in this scenario, we always end up with the correct value when it is needed. We still keep the cache around so that we can avoid triggering PropertyChanged events when HMonitor doesn't change.

@dremin dremin requested a review from josuave February 27, 2025 04:23
@josuave josuave merged commit 2cb1e0a into master Feb 27, 2025
1 check passed
@josuave josuave deleted the ignore-monitor-cache branch February 27, 2025 23:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants