-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Try avoid moving windows when removing/adding monitors (#824)
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`
- Loading branch information
Showing
21 changed files
with
365 additions
and
372 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using Microsoft.UI.Dispatching; | ||
using NSubstitute; | ||
|
||
namespace Whim.TestUtils; | ||
|
||
public static class NativeManagerUtils | ||
{ | ||
public static void SetupTryEnqueue(IContext ctx) | ||
{ | ||
ctx.NativeManager.When(cnm => cnm.TryEnqueue(Arg.Any<DispatcherQueueHandler>())) | ||
.Do(callInfo => | ||
{ | ||
DispatcherQueueHandler handler = callInfo.ArgAt<DispatcherQueueHandler>(0); | ||
handler.Invoke(); | ||
}); | ||
} | ||
} |
Oops, something went wrong.