summaryrefslogtreecommitdiff
path: root/src/protocols/InputMethodV2.cpp
diff options
context:
space:
mode:
authorYang, Ying-chao <yang.yingchao@qq.com>2024-06-13 17:33:47 +0800
committerGitHub <noreply@github.com>2024-06-13 11:33:47 +0200
commita54f98c20301a71efe5e73a8fc5e1bcd66f2bd34 (patch)
tree4ae2dfc00857b2857cd1cf0e0ec0dc295c9ad9dd /src/protocols/InputMethodV2.cpp
parentd677ac6f87acf97103327e321f7a05a0ce5774d6 (diff)
virtualkeyboard: check if VirtualKeyboard is valid before accessing client. (#6460)
This fixes crash when restarting fcitx (#6378)
Diffstat (limited to 'src/protocols/InputMethodV2.cpp')
-rw-r--r--src/protocols/InputMethodV2.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/protocols/InputMethodV2.cpp b/src/protocols/InputMethodV2.cpp
index 5d0bd417..24f7ad54 100644
--- a/src/protocols/InputMethodV2.cpp
+++ b/src/protocols/InputMethodV2.cpp
@@ -81,7 +81,7 @@ SP<CInputMethodV2> CInputMethodKeyboardGrabV2::getOwner() {
}
wl_client* CInputMethodKeyboardGrabV2::client() {
- return resource->client();
+ return resource->resource() ? resource->client() : nullptr;
}
CInputMethodPopupV2::CInputMethodPopupV2(SP<CZwpInputPopupSurfaceV2> resource_, SP<CInputMethodV2> owner_, SP<CWLSurfaceResource> surface) : resource(resource_), owner(owner_) {
@@ -373,4 +373,4 @@ void CInputMethodV2Protocol::onGetIME(CZwpInputMethodManagerV2* mgr, wl_resource
LOGM(LOG, "New IME with resource id {}", id);
events.newIME.emit(RESOURCE);
-} \ No newline at end of file
+}