mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Merge pull request #3816 from Flow-Launcher/clipboard_invalid
Use try-catch for query text box paste
This commit is contained in:
commit
b60cca42ce
1 changed files with 17 additions and 7 deletions
|
|
@ -44,6 +44,9 @@ namespace Flow.Launcher
|
||||||
|
|
||||||
#region Private Fields
|
#region Private Fields
|
||||||
|
|
||||||
|
// Class Name
|
||||||
|
private static readonly string ClassName = nameof(MainWindow);
|
||||||
|
|
||||||
// Dependency Injection
|
// Dependency Injection
|
||||||
private readonly Settings _settings;
|
private readonly Settings _settings;
|
||||||
private readonly Theme _theme;
|
private readonly Theme _theme;
|
||||||
|
|
@ -1255,6 +1258,8 @@ namespace Flow.Launcher
|
||||||
}
|
}
|
||||||
|
|
||||||
private void QueryTextBox_OnPaste(object sender, DataObjectPastingEventArgs e)
|
private void QueryTextBox_OnPaste(object sender, DataObjectPastingEventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
var isText = e.SourceDataObject.GetDataPresent(DataFormats.UnicodeText, true);
|
var isText = e.SourceDataObject.GetDataPresent(DataFormats.UnicodeText, true);
|
||||||
if (isText)
|
if (isText)
|
||||||
|
|
@ -1266,6 +1271,11 @@ namespace Flow.Launcher
|
||||||
e.DataObject = data;
|
e.DataObject = data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
App.API.LogException(ClassName, "Failed to paste text", ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void QueryTextBox_KeyUp(object sender, KeyEventArgs e)
|
private void QueryTextBox_KeyUp(object sender, KeyEventArgs e)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue