fix(grab): keyboard not released when mouse capture failed. cause keyboard cannot be typed

- 修复鼠标抓取失败时,未释放键盘.导致抓取判断为失败.导致后续键盘无法输入
This commit is contained in:
liuxinhao 2023-08-19 16:12:47 +08:00
parent 568278dd67
commit af65b345e1
2 changed files with 35 additions and 1 deletions

View File

@ -0,0 +1,30 @@
From 506baacdce54a39307fa01d296b8eb2b9850226e Mon Sep 17 00:00:00 2001
From: liuxinhao <liuxinhao@kylinsec.com.cn>
Date: Sat, 19 Aug 2023 16:03:29 +0800
Subject: [PATCH] fix(grab): keyboard not released when mouse capture failed.
cause keyboard cannot be typed
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 修复鼠标抓取失败时,未释放键盘.导致抓取判断为失败.导致后续键盘无法输入
---
src/grab/grab.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/grab/grab.cpp b/src/grab/grab.cpp
index e7fed6c..3c4a079 100644
--- a/src/grab/grab.cpp
+++ b/src/grab/grab.cpp
@@ -177,7 +177,7 @@ bool Grab::doGrab(WId wid, bool grabPointer)
{
int errCode = reply ? reply->status:1;
KLOG_WARNING() << "grab pointer to" << wid << "failed!" << getGrabError(errCode);
- xcb_ungrab_pointer(QX11Info::connection(), XCB_TIME_CURRENT_TIME);
+ xcb_ungrab_keyboard(QX11Info::connection(), XCB_TIME_CURRENT_TIME);
}
}
--
2.33.0

View File

@ -1,6 +1,6 @@
Name: kiran-screensaver
Version: 2.2.3
Release: 2
Release: 4
Summary: Kiran Desktop Screensaver Backend
Summary(zh_CN): kiran桌面屏保后端
@ -8,6 +8,7 @@ License: MulanPSL-2.0
Source0: %{name}-%{version}.tar.gz
Patch0001: 0001-fix-gsettings-screensaver-locker-paths-use-the-cmake.patch
Patch0002: 0002-fix-grab-keyboard-not-released-when-mouse-capture-fa.patch
BuildRequires: gcc-c++
BuildRequires: cmake
@ -71,6 +72,9 @@ glib-compile-schemas /usr/share/glib-2.0/schemas &> /dev/nulls || :
rm -rf %{buildroot}
%changelog
* Sat Aug 19 2023 liuxinhao <liuxinhao@kylinsec.com.cn> - 2.2.3-4
- KYOS-B: fix keyboard not released when mouse capture failed. cause keyboard cannot be typed
* Fri Aug 11 2023 liuxinhao <liuxinhao@kylinsec.com.cn> - 2.2.3-2
- KYOS-B: gsettings screensaver-locker paths use the cmake macro (#12303)