Skip to content

Commit 6d1a8a1

Browse files
marafCopilot
andcommitted
Address PR review: drop unused Windows detection and dispose xdotool Process
- Removed Windows branch from IsAutoSubmitModifierPressed (and the WindowsApplication helper). SimulatePaste/SimulateEnter have no Windows implementation yet, so detecting Ctrl there just caused a 5s wait-for-release with no follow-up keystroke. - Wrapped the Linux xdotool Process.Start calls in 'using' to dispose the returned Process handle. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 5bcbc36 commit 6d1a8a1

2 files changed

Lines changed: 5 additions & 33 deletions

File tree

src/Neptuo.Productivity.SnippetManager.Avalonia/Navigator.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -387,9 +387,9 @@ private static bool IsAutoSubmitModifierPressed()
387387
if (OperatingSystem.IsMacOS())
388388
return MacOSApplication.IsCommandKeyPressed();
389389

390-
if (OperatingSystem.IsWindows())
391-
return WindowsApplication.IsCtrlKeyPressed();
392-
390+
// Other platforms don't yet have SimulatePaste/SimulateEnter implementations,
391+
// so modifier detection stays disabled to avoid the wait-for-release stall
392+
// with no keystroke follow-up.
393393
return false;
394394
}
395395

@@ -475,7 +475,7 @@ private static void SimulatePaste()
475475
{
476476
try
477477
{
478-
Process.Start(new ProcessStartInfo
478+
using var process = Process.Start(new ProcessStartInfo
479479
{
480480
FileName = "xdotool",
481481
Arguments = "key ctrl+v",
@@ -500,7 +500,7 @@ private static void SimulateEnter()
500500
{
501501
try
502502
{
503-
Process.Start(new ProcessStartInfo
503+
using var process = Process.Start(new ProcessStartInfo
504504
{
505505
FileName = "xdotool",
506506
Arguments = "key Return",

src/Neptuo.Productivity.SnippetManager.Avalonia/WindowsApplication.cs

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)