| 155 | } |
| 156 | |
| 157 | void WorkerImplement::CliboardChanged() |
| 158 | { |
| 159 | LOG_ANY(L"ClipboardChangedInt"); |
| 160 | |
| 161 | if (!g_enabled.IsEnabled()) { |
| 162 | LOG_ANY(L"skip because disabled"); |
| 163 | } |
| 164 | |
| 165 | auto dwTime = GetTickCount64() - m_dwLastCtrlCReqvest; |
| 166 | bool isRecent = dwTime <= 500; |
| 167 | |
| 168 | EClipRequest request = m_clipRequest; |
| 169 | m_clipRequest = CLRMY_NONE; |
| 170 | |
| 171 | if (request != CLRMY_NONE) { |
| 172 | if (!isRecent) { |
| 173 | LOG_WARN(L"Request not recent"); |
| 174 | } |
| 175 | else { |
| 176 | if (request == CLRMY_GET_FROM_CLIP) { |
| 177 | Worker()->PostMsg([](WorkerImplement* w) {w->GetClipStringCallback(); }, 20); |
| 178 | return; |
| 179 | } |
| 180 | |
| 181 | if (request == CLRMY_hk_COPY) { |
| 182 | return; |
| 183 | } |
| 184 | |
| 185 | return; |
| 186 | } |
| 187 | } |
| 188 | |
| 189 | |
| 190 | // --- This is user request ---- |
| 191 | |
| 192 | if (conf_get_unsafe()->fClipboardClearFormat) { |
| 193 | Worker()->PostMsg([](WorkerImplement* w) {w->ClipboardClearFormat2(); }, 500); |
| 194 | } |
| 195 | |
| 196 | LOG_ANY(L"ClipboardChangedInt complete"); |
| 197 | } |
| 198 | |
| 199 | void WorkerImplement::ChangeForeground(HWND hwnd) |
| 200 | { |
no test coverage detected