Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions Morphic.Client/QuickStrip/QuickStripWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ private void Zoom(object sender, QuickStripSegmentedButtonControl.ActionEventArg
}

/// <summary>Original magnifier settings.</summary>
private Dictionary<Preferences.Key, object?> magnifyCapture;
private Dictionary<Preferences.Key, object?>? magnifyCapture;

private async void OnMagnify(object sender, QuickStripSegmentedButtonControl.ActionEventArgs e)
{
Expand All @@ -401,10 +401,11 @@ private async void OnMagnify(object sender, QuickStripSegmentedButtonControl.Act
{SettingsManager.Keys.WindowsMagnifierEnabled, true},
};

if (this.magnifyCapture == null)
if (magnifyCapture == null)
{
// capture the current settings
this.magnifyCapture = await this.session.SettingsManager.Capture(settings.Keys);
magnifyCapture = await session.SettingsManager.Capture(settings.Keys);
magnifyCapture[SettingsManager.Keys.WindowsMagnifierEnabled] = false;
}

await session.Apply(settings);
Expand All @@ -413,11 +414,14 @@ private async void OnMagnify(object sender, QuickStripSegmentedButtonControl.Act
{
_ = Countly.RecordEvent("Hide Magnifier");
// restore settings
await session.Apply(SettingsManager.Keys.WindowsMagnifierEnabled, false);
if (this.magnifyCapture != null)
if (magnifyCapture != null)
{
await this.session.Apply(this.magnifyCapture);
this.magnifyCapture = null;
await session.Apply(magnifyCapture);
magnifyCapture = null;
}
else
{
await session.Apply(SettingsManager.Keys.WindowsMagnifierEnabled, false);
}
}
}
Expand Down
20 changes: 12 additions & 8 deletions Morphic.Client/Solutions/windows.solutions.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,21 +72,25 @@
"type": "integer",
"default": 2,
"handler": {
"type": "com.microsoft.windows.registry",
"key_name": "HKEY_CURRENT_USER\\Software\\Microsoft\\ScreenMagnifier",
"value_name": "MagnificationMode",
"value_type": "dword"
"type": "com.microsoft.windows.system",
"setting_id": "SystemSettings_Accessibility_Magnifier_Mode",
"value_type": "string",
"integer_map": [
"",
"SystemSettings_Accessibility_Magnifier_ModeDocked",
"SystemSettings_Accessibility_Magnifier_ModeFullScreen",
"SystemSettings_Accessibility_Magnifier_ModeLens"
]
}
},
{
"name": "magnification",
"type": "integer",
"default": 200,
"handler": {
"type": "com.microsoft.windows.registry",
"key_name": "HKEY_CURRENT_USER\\Software\\Microsoft\\ScreenMagnifier",
"value_name": "Magnification",
"value_type": "dword"
"type": "com.microsoft.windows.system",
"setting_id": "SystemSettings_Accessibility_Magnifier_Magnification",
"value_type": "integer"
}
},
{
Expand Down