Skip to content

Commit

Permalink
[PowerToys Run] Add "ignore hotkeys in fullscreen" setting (#3262) (#…
Browse files Browse the repository at this point in the history
…3604)

Connect Wox's existing "ignore hotkeys in fullscreen mode" setting to PowerLauncher and the PowerToys settings UI.

This allows PowerLauncher to ignore hotkeys if any application is currently in fullscreen mode, whether it's real exclusive fullscreen or borderless windowed mode. This applies to things like fullscreen games, video and presentations but not maximized windows.
  • Loading branch information
smiley committed Jun 4, 2020
1 parent fb3f4fa commit 7c7ccc3
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ public class PowerLauncherProperties

public bool override_win_s_key { get; set; }

public bool ignore_hotkeys_in_fullscreen { get; set; }

public PowerLauncherProperties()
{
open_powerlauncher = new HotkeySettings();
Expand All @@ -32,6 +34,7 @@ public PowerLauncherProperties()
open_console = new HotkeySettings();
search_result_preference = "most_recently_used";
search_type_preference = "application_name";
ignore_hotkeys_in_fullscreen = false;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,9 @@
<data name="PowerLauncher_OverrideWinSKey.Content" xml:space="preserve">
<value>Override Win+S key</value>
</data>
<data name="PowerLauncher_IgnoreHotkeysInFullScreen.Content" xml:space="preserve">
<value>Ignore hotkeys in fullscreen mode</value>
</data>
<data name="KeyboardManager_KeysMappingLayoutRightHeader.Text" xml:space="preserve">
<value>To:</value>
<comment>Keyboard Manager mapping keys view right header</comment>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,5 +235,22 @@ public bool OverrideWinSKey
}
}
}

public bool IgnoreHotkeysInFullScreen
{
get
{
return settings.properties.ignore_hotkeys_in_fullscreen;
}

set
{
if (settings.properties.ignore_hotkeys_in_fullscreen != value)
{
settings.properties.ignore_hotkeys_in_fullscreen = value;
UpdateSettings();
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,12 @@
IsChecked="{x:Bind Mode=TwoWay, Path=ViewModel.OverrideWinSKey}"
IsEnabled="False"
/>-->

<CheckBox x:Uid="PowerLauncher_IgnoreHotkeysInFullScreen"
Margin="{StaticResource SmallTopMargin}"
IsChecked="{x:Bind Mode=TwoWay, Path=ViewModel.IgnoreHotkeysInFullScreen}"
IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.EnablePowerLauncher}"
/>
</StackPanel>
<StackPanel
x:Name="SidePanel"
Expand Down
5 changes: 5 additions & 0 deletions src/modules/launcher/PowerLauncher/SettingsWatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ public void OverloadSettings()
{
_settings.MaxResultsToShow = overloadSettings.properties.maximum_number_of_results;
}

if (_settings.IgnoreHotkeysOnFullscreen != overloadSettings.properties.ignore_hotkeys_in_fullscreen)
{
_settings.IgnoreHotkeysOnFullscreen = overloadSettings.properties.ignore_hotkeys_in_fullscreen;
}
}
catch (Exception e)
{
Expand Down

0 comments on commit 7c7ccc3

Please sign in to comment.