Skip to content

Commit 455dc52

Browse files
Merge origin/main into stable
2 parents ed1d15f + fecd2e7 commit 455dc52

5 files changed

Lines changed: 94 additions & 9 deletions

File tree

.github/actions/spell-check/expect.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,7 @@ defaultlib
365365
DEFAULTONLY
366366
DEFAULTSIZE
367367
defaulttonearest
368+
DEFAULTTONEAREST
368369
DEFAULTTONULL
369370
DEFAULTTOPRIMARY
370371
DEFERERASE
@@ -1882,6 +1883,7 @@ toolwindow
18821883
TOPDOWNDIB
18831884
TOUCHEVENTF
18841885
TOUCHINPUT
1886+
touchpads
18851887
TPMLEFTALIGN
18861888
TPMRETURNCMD
18871889
TRACEHANDLE

src/modules/ZoomIt/ZoomIt/Zoomit.cpp

Lines changed: 36 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9784,7 +9784,10 @@ LRESULT APIENTRY MainWndProc(
97849784
{
97859785
if (!RegisterHotKey(hWnd, ZOOM_HOTKEY, g_ToggleMod, g_ToggleKey & 0xFF))
97869786
{
9787-
MessageBox(hWnd, L"The specified zoom toggle hotkey is already in use.\nSelect a different zoom toggle hotkey.", APPNAME, MB_ICONERROR);
9787+
if(!g_StartedByPowerToys)
9788+
{
9789+
MessageBox(hWnd, L"The specified zoom toggle hotkey is already in use.\nSelect a different zoom toggle hotkey.", APPNAME, MB_ICONERROR);
9790+
}
97889791
showOptions = TRUE;
97899792
}
97909793
}
@@ -9793,23 +9796,32 @@ LRESULT APIENTRY MainWndProc(
97939796
if (!RegisterHotKey(hWnd, LIVE_HOTKEY, g_LiveZoomToggleMod, g_LiveZoomToggleKey & 0xFF) ||
97949797
!RegisterHotKey(hWnd, LIVE_DRAW_HOTKEY, g_LiveZoomToggleMod ^ MOD_SHIFT, g_LiveZoomToggleKey & 0xFF))
97959798
{
9796-
MessageBox(hWnd, L"The specified live-zoom toggle hotkey is already in use.\nSelect a different zoom toggle hotkey.", APPNAME, MB_ICONERROR);
9799+
if(!g_StartedByPowerToys)
9800+
{
9801+
MessageBox(hWnd, L"The specified live-zoom toggle hotkey is already in use.\nSelect a different zoom toggle hotkey.", APPNAME, MB_ICONERROR);
9802+
}
97979803
showOptions = TRUE;
97989804
}
97999805
}
98009806
if (g_DrawToggleKey)
98019807
{
98029808
if (!RegisterHotKey(hWnd, DRAW_HOTKEY, g_DrawToggleMod, g_DrawToggleKey & 0xFF))
98039809
{
9804-
MessageBox(hWnd, L"The specified draw w/out zoom hotkey is already in use.\nSelect a different draw w/out zoom hotkey.", APPNAME, MB_ICONERROR);
9810+
if(!g_StartedByPowerToys)
9811+
{
9812+
MessageBox(hWnd, L"The specified draw w/out zoom hotkey is already in use.\nSelect a different draw w/out zoom hotkey.", APPNAME, MB_ICONERROR);
9813+
}
98059814
showOptions = TRUE;
98069815
}
98079816
}
98089817
if (g_BreakToggleKey)
98099818
{
98109819
if (!RegisterHotKey(hWnd, BREAK_HOTKEY, g_BreakToggleMod, g_BreakToggleKey & 0xFF))
98119820
{
9812-
MessageBox(hWnd, L"The specified break timer hotkey is already in use.\nSelect a different break timer hotkey.", APPNAME, MB_ICONERROR);
9821+
if(!g_StartedByPowerToys)
9822+
{
9823+
MessageBox(hWnd, L"The specified break timer hotkey is already in use.\nSelect a different break timer hotkey.", APPNAME, MB_ICONERROR);
9824+
}
98139825
showOptions = TRUE;
98149826
}
98159827
}
@@ -9818,7 +9830,10 @@ LRESULT APIENTRY MainWndProc(
98189830
if (!RegisterHotKey(hWnd, DEMOTYPE_HOTKEY, g_DemoTypeToggleMod, g_DemoTypeToggleKey & 0xFF) ||
98199831
!RegisterHotKey(hWnd, DEMOTYPE_RESET_HOTKEY, (g_DemoTypeToggleMod ^ MOD_SHIFT), g_DemoTypeToggleKey & 0xFF))
98209832
{
9821-
MessageBox(hWnd, L"The specified live-type hotkey is already in use.\nSelect a different live-type hotkey.", APPNAME, MB_ICONERROR);
9833+
if(!g_StartedByPowerToys)
9834+
{
9835+
MessageBox(hWnd, L"The specified live-type hotkey is already in use.\nSelect a different live-type hotkey.", APPNAME, MB_ICONERROR);
9836+
}
98229837
showOptions = TRUE;
98239838
}
98249839
}
@@ -9827,7 +9842,10 @@ LRESULT APIENTRY MainWndProc(
98279842
if (!RegisterHotKey(hWnd, SNIP_HOTKEY, g_SnipToggleMod, g_SnipToggleKey & 0xFF) ||
98289843
!RegisterHotKey(hWnd, SNIP_SAVE_HOTKEY, (g_SnipToggleMod ^ MOD_SHIFT), g_SnipToggleKey & 0xFF))
98299844
{
9830-
MessageBox(hWnd, L"The specified snip hotkey is already in use.\nSelect a different snip hotkey.", APPNAME, MB_ICONERROR);
9845+
if(!g_StartedByPowerToys)
9846+
{
9847+
MessageBox(hWnd, L"The specified snip hotkey is already in use.\nSelect a different snip hotkey.", APPNAME, MB_ICONERROR);
9848+
}
98319849
showOptions = TRUE;
98329850
}
98339851
}
@@ -9837,15 +9855,21 @@ LRESULT APIENTRY MainWndProc(
98379855
if (!RegisterHotKey(hWnd, SNIP_PANORAMA_HOTKEY, g_SnipPanoramaToggleMod | MOD_NOREPEAT, g_SnipPanoramaToggleKey & 0xFF) ||
98389856
!RegisterHotKey(hWnd, SNIP_PANORAMA_SAVE_HOTKEY, ( g_SnipPanoramaToggleMod ^ MOD_SHIFT ) | MOD_NOREPEAT, g_SnipPanoramaToggleKey & 0xFF))
98399857
{
9840-
MessageBox(hWnd, L"The specified panorama snip hotkey is already in use.\nSelect a different panorama snip hotkey.", APPNAME, MB_ICONERROR);
9858+
if(!g_StartedByPowerToys)
9859+
{
9860+
MessageBox(hWnd, L"The specified panorama snip hotkey is already in use.\nSelect a different panorama snip hotkey.", APPNAME, MB_ICONERROR);
9861+
}
98419862
showOptions = TRUE;
98429863
}
98439864
}
98449865
if (g_SnipOcrToggleKey)
98459866
{
98469867
if (!RegisterHotKey(hWnd, SNIP_OCR_HOTKEY, g_SnipOcrToggleMod, g_SnipOcrToggleKey & 0xFF))
98479868
{
9848-
MessageBox(hWnd, L"The specified snip OCR hotkey is already in use.\nSelect a different snip OCR hotkey.", APPNAME, MB_ICONERROR);
9869+
if(!g_StartedByPowerToys)
9870+
{
9871+
MessageBox(hWnd, L"The specified snip OCR hotkey is already in use.\nSelect a different snip OCR hotkey.", APPNAME, MB_ICONERROR);
9872+
}
98499873
showOptions = TRUE;
98509874
}
98519875
}
@@ -9855,7 +9879,10 @@ LRESULT APIENTRY MainWndProc(
98559879
!RegisterHotKey(hWnd, RECORD_CROP_HOTKEY, (g_RecordToggleMod ^ MOD_SHIFT) | MOD_NOREPEAT, g_RecordToggleKey & 0xFF) ||
98569880
!RegisterHotKey(hWnd, RECORD_WINDOW_HOTKEY, (g_RecordToggleMod ^ MOD_ALT) | MOD_NOREPEAT, g_RecordToggleKey & 0xFF))
98579881
{
9858-
MessageBox(hWnd, L"The specified record hotkey is already in use.\nSelect a different record hotkey.", APPNAME, MB_ICONERROR);
9882+
if(!g_StartedByPowerToys)
9883+
{
9884+
MessageBox(hWnd, L"The specified record hotkey is already in use.\nSelect a different record hotkey.", APPNAME, MB_ICONERROR);
9885+
}
98599886
showOptions = TRUE;
98609887
}
98619888
}

src/modules/cmdpal/Microsoft.CmdPal.UI.ViewModels/Settings/DockSettings.cs

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// See the LICENSE file in the project root for more information.
44

55
using System.Collections.Immutable;
6+
using System.Text.Json;
67
using System.Text.Json.Serialization;
78
using Windows.UI;
89

@@ -135,12 +136,52 @@ public enum DockSide
135136
Bottom = 3,
136137
}
137138

139+
[JsonConverter(typeof(DockSizeJsonConverter))]
138140
public enum DockSize
139141
{
140142
Default,
141143
Compact,
142144
}
143145

146+
/// <summary>
147+
/// Custom converter for <see cref="DockSize"/> that preserves backward
148+
/// compatibility with previously-persisted values. Earlier builds shipped a
149+
/// <c>Small</c>/<c>Medium</c>/<c>Large</c> enum; those values are migrated to
150+
/// <see cref="DockSize.Default"/> so existing settings.json files continue to
151+
/// load instead of failing the entire deserialization.
152+
/// </summary>
153+
internal sealed class DockSizeJsonConverter : JsonConverter<DockSize>
154+
{
155+
public override DockSize Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
156+
{
157+
if (reader.TokenType == JsonTokenType.String)
158+
{
159+
var value = reader.GetString();
160+
if (Enum.TryParse<DockSize>(value, ignoreCase: true, out var parsed))
161+
{
162+
return parsed;
163+
}
164+
165+
// Legacy values from the original Small/Medium/Large enum, or any
166+
// other unknown string — fall back to Default so the user's
167+
// settings file remains loadable after upgrading.
168+
return DockSize.Default;
169+
}
170+
171+
if (reader.TokenType == JsonTokenType.Number && reader.TryGetInt32(out var number))
172+
{
173+
return Enum.IsDefined(typeof(DockSize), number) ? (DockSize)number : DockSize.Default;
174+
}
175+
176+
return DockSize.Default;
177+
}
178+
179+
public override void Write(Utf8JsonWriter writer, DockSize value, JsonSerializerOptions options)
180+
{
181+
writer.WriteStringValue(value.ToString());
182+
}
183+
}
184+
144185
public enum DockBackdrop
145186
{
146187
Transparent,

src/settings-ui/Settings.UI/SettingsXAML/Views/GrabAndMovePage.xaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@
1818
ModuleImageSource="ms-appx:///Assets/Settings/Modules/GrabAndMove.png">
1919
<controls:SettingsPageControl.ModuleContent>
2020
<StackPanel ChildrenTransitions="{StaticResource SettingsCardsAnimations}" Orientation="Vertical">
21+
22+
<InfoBar
23+
x:Uid="GrabAndMove_TouchpadInfoBar"
24+
Margin="0,0,0,8"
25+
IsClosable="False"
26+
IsOpen="True"
27+
Severity="Informational" />
28+
2129
<controls:GPOInfoControl ShowWarning="{x:Bind ViewModel.IsEnabledGpoConfigured, Mode=OneWay}">
2230
<tkcontrols:SettingsCard
2331
Name="GrabAndMoveEnableToggleControlHeaderText"

src/settings-ui/Settings.UI/Strings/en-us/Resources.resw

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5943,6 +5943,13 @@ Text uses the current drawing color.</value>
59435943
<value>Grab And Move</value>
59445944
<comment>"Grab And Move" is the name of the utility</comment>
59455945
</data>
5946+
<data name="GrabAndMove_TouchpadInfoBar.Title" xml:space="preserve">
5947+
<value>Touchpad support</value>
5948+
</data>
5949+
<data name="GrabAndMove_TouchpadInfoBar.Message" xml:space="preserve">
5950+
<value>Grab And Move may not work reliably with some touchpads.</value>
5951+
<comment>"Grab And Move" is the name of the utility</comment>
5952+
</data>
59465953
<data name="LearnMore_GrabAndMove.Text" xml:space="preserve">
59475954
<value>Learn more about Grab And Move</value>
59485955
<comment>"Grab And Move" is the name of the utility</comment>

0 commit comments

Comments
 (0)