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

Try avoid moving windows when removing/adding monitors #824

Conversation

dalyIsaac
Copy link
Owner

@dalyIsaac dalyIsaac commented Feb 6, 2024

When Windows removes/adds monitors, it will helpfully move windows to/from monitors. However, Whim is a window manager and we'd like to control this behavior.

To work around Windows' helpfulness, the WindowManager and ButlerEventHandlers ignore all Windows events for tracked windows. This has the downside of potentially missing a window closing, but I've judged that it's more important to keep windows in the correct workspaces.

Other changes include:

  • Removing an ineffectual lock
  • Updating some calls to obsolete methods
  • Another attempt at avoiding AccessViolationException in the Bar

@dalyIsaac dalyIsaac added bug Something isn't working core Whim labels Feb 6, 2024
@dalyIsaac dalyIsaac linked an issue Feb 6, 2024 that may be closed by this pull request
7 tasks
Copy link

codecov bot commented Feb 7, 2024

Codecov Report

Attention: 5 lines in your changes are missing coverage. Please review.

Comparison is base (57d5381) 81.27% compared to head (7f91bcc) 81.30%.
Report is 2 commits behind head on main.

❗ Current head 7f91bcc differs from pull request most recent head bb5c87f. Consider uploading reports for the commit bb5c87f to get more accurate results

Files Patch % Lines
src/Whim/Window/WindowManager.cs 94.73% 0 Missing and 2 partials ⚠️
src/Whim.Bar/BarPlugin.cs 0.00% 0 Missing and 1 partial ⚠️
src/Whim/Context/InternalContext.cs 0.00% 1 Missing ⚠️
src/Whim/Monitor/MonitorManager.cs 83.33% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #824      +/-   ##
==========================================
+ Coverage   81.27%   81.30%   +0.03%     
==========================================
  Files         197      198       +1     
  Lines       10227    10212      -15     
  Branches     1142     1140       -2     
==========================================
- Hits         8312     8303       -9     
+ Misses       1790     1785       -5     
+ Partials      125      124       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dalyIsaac dalyIsaac force-pushed the 817-dont-route-already-added-windows-in-windowmanager_windowadded branch from 2d48e64 to 7f91bcc Compare February 7, 2024 10:16
@dalyIsaac dalyIsaac marked this pull request as ready for review February 7, 2024 10:34
@dalyIsaac dalyIsaac merged commit 7667f4d into main Feb 7, 2024
6 checks passed
@dalyIsaac dalyIsaac deleted the 817-dont-route-already-added-windows-in-windowmanager_windowadded branch February 7, 2024 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working core Whim
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Don't move windows when removing/adding monitors
1 participant