Skip to content
Merged
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
26 changes: 18 additions & 8 deletions Flow.Launcher/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@

#region Private Fields

// Class Name
private static readonly string ClassName = nameof(MainWindow);

// Dependency Injection
private readonly Settings _settings;
private readonly Theme _theme;
Expand Down Expand Up @@ -111,7 +114,7 @@
{
var handle = Win32Helper.GetWindowHandle(this, true);
_hwndSource = HwndSource.FromHwnd(handle);
_hwndSource.AddHook(WndProc);

Check warning on line 117 in Flow.Launcher/MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`Wnd` is not a recognized word. (unrecognized-spelling)
Win32Helper.HideFromAltTab(this);
Win32Helper.DisableControlBox(this);
}
Expand Down Expand Up @@ -364,7 +367,7 @@
{
try
{
_hwndSource.RemoveHook(WndProc);

Check warning on line 370 in Flow.Launcher/MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`Wnd` is not a recognized word. (unrecognized-spelling)
}
catch (Exception)
{
Expand Down Expand Up @@ -567,9 +570,9 @@

#endregion

#region Window WndProc

Check warning on line 573 in Flow.Launcher/MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`Wnd` is not a recognized word. (unrecognized-spelling)

private IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)

Check warning on line 575 in Flow.Launcher/MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`Wnd` is not a recognized word. (unrecognized-spelling)
{
switch (msg)
{
Expand Down Expand Up @@ -744,17 +747,17 @@
Header = App.API.GetTranslation("iconTrayOpen") + " (" + _settings.Hotkey + ")",
Icon = openIcon
};
var gamemodeIcon = new FontIcon { Glyph = "\ue7fc" };

Check warning on line 750 in Flow.Launcher/MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`gamemode` is not a recognized word. (unrecognized-spelling)
var gamemode = new MenuItem

Check warning on line 751 in Flow.Launcher/MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`gamemode` is not a recognized word. (unrecognized-spelling)
{
Header = App.API.GetTranslation("GameMode"),
Icon = gamemodeIcon

Check warning on line 754 in Flow.Launcher/MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`gamemode` is not a recognized word. (unrecognized-spelling)
};
var positionresetIcon = new FontIcon { Glyph = "\ue73f" };
var positionreset = new MenuItem

Check warning on line 757 in Flow.Launcher/MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`positionreset` is not a recognized word. (unrecognized-spelling)
{
Header = App.API.GetTranslation("PositionReset"),
Icon = positionresetIcon

Check warning on line 760 in Flow.Launcher/MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`positionreset` is not a recognized word. (unrecognized-spelling)
};
var settingsIcon = new FontIcon { Glyph = "\ue713" };
var settings = new MenuItem
Expand All @@ -770,7 +773,7 @@
};

open.Click += (o, e) => _viewModel.ToggleFlowLauncher();
gamemode.Click += (o, e) => _viewModel.ToggleGameMode();

Check warning on line 776 in Flow.Launcher/MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`gamemode` is not a recognized word. (unrecognized-spelling)
positionreset.Click += (o, e) => _ = PositionResetAsync();
settings.Click += (o, e) => App.API.OpenSettingDialog();
exit.Click += (o, e) => Close();
Expand All @@ -791,7 +794,7 @@

private void UpdatePosition()
{
// Initialize call twice to work around multi-display alignment issue- https://github.com/Flow-Launcher/Flow.Launcher/issues/2910

Check failure on line 797 in Flow.Launcher/MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`work around` matches a line_forbidden.patterns entry: `\bwork[- ]arounds?\b`. (forbidden-pattern)
InitializePosition();
InitializePosition();
}
Expand All @@ -807,7 +810,7 @@

private void InitializePosition()
{
// Initialize call twice to work around multi-display alignment issue- https://github.com/Flow-Launcher/Flow.Launcher/issues/2910

Check failure on line 813 in Flow.Launcher/MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`work around` matches a line_forbidden.patterns entry: `\bwork[- ]arounds?\b`. (forbidden-pattern)
InitializePositionInner();
InitializePositionInner();
return;
Expand Down Expand Up @@ -1256,14 +1259,21 @@

private void QueryTextBox_OnPaste(object sender, DataObjectPastingEventArgs e)
{
var isText = e.SourceDataObject.GetDataPresent(DataFormats.UnicodeText, true);
if (isText)
{
var text = e.SourceDataObject.GetData(DataFormats.UnicodeText) as string;
text = text.Replace(Environment.NewLine, " ");
DataObject data = new DataObject();
data.SetData(DataFormats.UnicodeText, text);
e.DataObject = data;
try
{
var isText = e.SourceDataObject.GetDataPresent(DataFormats.UnicodeText, true);
if (isText)
{
var text = e.SourceDataObject.GetData(DataFormats.UnicodeText) as string;
text = text.Replace(Environment.NewLine, " ");
DataObject data = new DataObject();
data.SetData(DataFormats.UnicodeText, text);
e.DataObject = data;
}
}
catch (Exception ex)
{
App.API.LogException(ClassName, "Failed to paste text", ex);
}
}

Expand Down
Loading