[fix] restore clipboard sync after focus returns, refs #121

This commit is contained in:
dijunkun
2026-10-20 11:34:24 +08:00
parent 4e5bf66734
commit 62ba3693af
3 changed files with 65 additions and 6 deletions
@@ -41,6 +41,7 @@ public:
private:
int SendToPeers(const std::string &text);
void SendDeferredLocalText();
GuiRuntime &owner_;
uint32_t event_type_ = 0;
@@ -51,8 +52,11 @@ private:
std::weak_ptr<gui_detail::RemoteSession> pending_session_;
uint64_t pending_generation_ = 0;
std::string last_text_;
// UI thread only. Retain the destination of a local copy while its stream
// window is unfocused; last_text_ holds the latest value to send on return.
std::weak_ptr<gui_detail::RemoteSession> deferred_local_session_;
};
} // namespace crossdesk
#endif // _CLIPBOARD_CONTROLLER_H_
#endif // _CLIPBOARD_CONTROLLER_H_