You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix AdvancedPaste auto-copy failing on Electron/Chromium apps
The Ctrl+C fallback in send_copy_selection() was injecting keystrokes
without first releasing modifier keys held from the hotkey combination.
Target apps received e.g. Win+Shift+Ctrl+C instead of Ctrl+C, which
doesn't trigger a copy.
Changes:
- Release all modifier keys before Ctrl+C and restore them after,
matching the existing try_to_paste_as_plain_text() pattern
- Extract send_ctrl_c_input() and poll_clipboard_sequence() helpers
from inline code for clarity
- Increase clipboard polling window from 150ms to 500ms for slower
Chromium/Electron clipboard updates
- Add warn-level logging on failure paths for customer diagnostics
- Check WM_COPY actually changed the clipboard before declaring success
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
// Prevent Start Menu from activating after Win key release/restore
596
+
INPUT dummyEvent = {};
597
+
dummyEvent.type = INPUT_KEYBOARD;
598
+
dummyEvent.ki.wVk = 0xFF;
599
+
dummyEvent.ki.dwFlags = KEYEVENTF_KEYUP;
600
+
inputs.push_back(dummyEvent);
601
+
602
+
auto uSent = SendInput(static_cast<UINT>(inputs.size()), inputs.data(), sizeof(INPUT));
603
+
if (uSent != inputs.size())
604
+
{
605
+
DWORD errorCode = GetLastError();
606
+
auto errorMessage = get_last_error_message(errorCode);
607
+
Logger::error(L"SendInput failed for Ctrl+C. Expected to send {} inputs and sent only {}. {}", inputs.size(), uSent, errorMessage.has_value() ? errorMessage.value() : L"");
auto uSent = SendInput(static_cast<UINT>(inputs.size()), inputs.data(), sizeof(INPUT));
573
-
if (uSent != inputs.size())
574
-
{
575
-
DWORD errorCode = GetLastError();
576
-
auto errorMessage = get_last_error_message(errorCode);
577
-
Logger::error(L"SendInput failed for Ctrl+C. Expected to send {} inputs and sent only {}. {}", inputs.size(), uSent, errorMessage.has_value() ? errorMessage.value() : L"");
0 commit comments