Release v0.6.36: offload notification registration and mitigate Viber paste timing
This commit is contained in:
+17
-1
@@ -529,6 +529,9 @@ LRESULT CALLBACK procedure(HWND w, UINT msg, WPARAM wp, LPARAM lp)
|
||||
require(text() == L"wrong ", "unrelated selection remains rejected with trimmed clipboard");
|
||||
app->settings.autoCorrect = true;
|
||||
app->settings.autoLanguages = {L"en", L"ru"};
|
||||
// The worker now shares the predictor's immutable dictionaries.
|
||||
// This fixture changes settings directly instead of applySettings.
|
||||
app->autoPredictor.configure(L"dictionaries", app->settings.autoLanguages);
|
||||
app->autoCorrector = ks::AutoCorrector{};
|
||||
ActivateKeyboardLayout(app->layouts[en].handle, 0);
|
||||
prepare(L"ghbdtn ", false);
|
||||
@@ -556,9 +559,22 @@ LRESULT CALLBACK procedure(HWND w, UINT msg, WPARAM wp, LPARAM lp)
|
||||
require(trimmedCopies >= 7, "fixture actually stripped spaces during recovery scenarios");
|
||||
pasteBehavior = 0;
|
||||
trimCopiedSpaces = false;
|
||||
finish();
|
||||
// User-selected middle range, followed by the same command with
|
||||
// no selection: retain both surrounding text and trailing spaces.
|
||||
prepare(L"OLDghbdtn NEXT", false);
|
||||
SendMessageW(field, EM_SETSEL, 3, 11);
|
||||
app->transform(ks::Direct + ru);
|
||||
break;
|
||||
}
|
||||
case 58:
|
||||
require(text() == L"OLDпривет NEXT", "explicit middle selection preserves surrounding text");
|
||||
app->transform(ks::Direct + en);
|
||||
break;
|
||||
case 59:
|
||||
require(text() == L"OLDghbdtn NEXT", "hotkey without selection reconverts only the previous middle range");
|
||||
require(ks::readClipboard(app->window).text() == sentinel, "selected and repeated conversions restore clipboard");
|
||||
finish();
|
||||
break;
|
||||
case 30:
|
||||
case 32:
|
||||
case 34:
|
||||
|
||||
@@ -5,9 +5,11 @@
|
||||
static std::wstring programs;
|
||||
static std::wstring activationExecutable, activationCommand;
|
||||
static int activationCalls{};
|
||||
static DWORD launchFlags{}; static bool inheritsHandles{};
|
||||
static BOOL WINAPI testCreateProcess(LPCWSTR path, LPWSTR command, LPSECURITY_ATTRIBUTES,
|
||||
LPSECURITY_ATTRIBUTES, BOOL, DWORD, LPVOID, LPCWSTR, LPSTARTUPINFOW, LPPROCESS_INFORMATION)
|
||||
LPSECURITY_ATTRIBUTES, BOOL inherit, DWORD flags, LPVOID, LPCWSTR, LPSTARTUPINFOW, LPPROCESS_INFORMATION)
|
||||
{
|
||||
launchFlags=flags; inheritsHandles=inherit;
|
||||
++activationCalls; activationExecutable=path; activationCommand=command;
|
||||
SetLastError(ERROR_CANCELLED); return FALSE; // Inspect activation without starting any program.
|
||||
}
|
||||
@@ -55,6 +57,14 @@ int main()
|
||||
valid=id.vt==VT_CLSID && *id.puuid==ks::ActivatorId; PropVariantClear(&id);
|
||||
if(!valid) throw std::runtime_error("shortcut activator missing");
|
||||
ks::registerScreenshotNotifications(); // Registration is safe to repeat.
|
||||
bool launchFailed=false;
|
||||
try { ks::startScreenshotNotificationRegistration(); }
|
||||
catch(const std::exception &) { launchFailed=true; }
|
||||
if(!launchFailed || activationExecutable!=helper.wstring() ||
|
||||
activationCommand!=L"\""+helper.wstring()+L"\" --register-notifications" ||
|
||||
!(launchFlags&CREATE_NO_WINDOW) || inheritsHandles)
|
||||
throw std::runtime_error("registration must launch the sibling helper and propagate failure");
|
||||
activationCalls=0;
|
||||
ks::Activator activator(helper.wstring(),false);
|
||||
activator.Activate(L"HrynCo.KSwitcher.Screenshot",L"check-update",nullptr,0);
|
||||
auto main=(helper.parent_path()/L"KSwitcher.exe").wstring();
|
||||
|
||||
Reference in New Issue
Block a user