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

PI: Call Close() on vertical bar window when horizontal window is closed and vice versa #3106

Merged
merged 6 commits into from
Jun 5, 2024

Conversation

zadesai
Copy link
Contributor

@zadesai zadesai commented Jun 3, 2024

Detailed description of the pull request / Additional comments

Bug: PI crashes on relaunch when ClipboardMonitoring is enabled and we close the bar from the vertical window.
Problem: When we launch PI, we start both the vertical and horizontal window. As a part of Horizontal window load, we start the ClipboardMonitor instance. Now, when we close vertical window, the horizontal window is still activated and ClipboardMonitor is still running. When we start a new instance of PI, the new horiztontalWindow tries to start ClipboardMonitor again and thus failing at Debug.Assert(ListenerHwnd == listeningWindow, "Why are we trying to start with a different hwnd?");

Fix: Call horizontal window Close() from verticalwindow when closed and vice versa.

Also, updated the ClipboardMonitor to listen on PrimaryWindow HWND instead of barwindow HWND.

Validation steps performed

  1. Launch PI
  2. Move to vertical window
  3. Close PI
  4. Launch PI again from Dev Home Utilities and confirm there is no crash

PR checklist

@timkur
Copy link
Contributor

timkur commented Jun 4, 2024

Ideally we'd have the Clipboard monitor using the PrimaryWindow's HWND for monitoring... then we could continue to monitor in the background without the bar windows being around. #Resolved

@zadesai zadesai changed the title PI: Call WindowEx_Closed on vertical bar window when horizontal window is closed and vice versa PI: Call Close() on vertical bar window when horizontal window is closed and vice versa Jun 4, 2024
@zadesai
Copy link
Contributor Author

zadesai commented Jun 4, 2024

Updated the code to use PrimaryWindow's HWND. However, still starting the monitor when barwindow is opened and stopping it when bar window is closed.


In reply to: 2146322918

@zadesai zadesai merged commit dd39e1f into main Jun 5, 2024
4 checks passed
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.

Close window, relaunch from utilities causes PI to crash
4 participants