mirror of
https://github.com/kunkundi/crossdesk.git
synced 2025-12-24 17:41:41 +08:00
[fix] release keyboard hook after remote control disconnects, refs #23
This commit is contained in:
@@ -51,7 +51,16 @@ int KeyboardCapturer::Hook(OnKeyAction on_key_action, void* user_ptr) {
|
||||
}
|
||||
|
||||
int KeyboardCapturer::Unhook() {
|
||||
g_on_key_action = nullptr;
|
||||
g_user_ptr = nullptr;
|
||||
|
||||
running_ = false;
|
||||
|
||||
if (display_) {
|
||||
XSelectInput(display_, DefaultRootWindow(display_), 0);
|
||||
XFlush(display_);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user