Preempt X11 keyboard grabs and window stacking when lockscreen is active

This commit is contained in:
Luxferre committed 2026-11-01 10:39:40 +02:00
1 parent 83dd79fe76
commit f112b6ae72
78 files changed
+403 -53

No files matched your search

+10
View File
@@ -1893,6 +1893,10 @@ inline void closeOtherPlugins(const char* selfPluginName) {
}
inline bool isAnotherPluginActive(const char* selfPluginName) {
if ((!selfPluginName || std::strcmp(selfPluginName, "locker") != 0) &&
::access("/tmp/bananarchy_screen_locked", F_OK) == 0) {
return true;
}
struct PluginRef {
const char* pidFile;
const char* name;
@@ -1939,6 +1943,12 @@ inline bool isAnotherPluginActive(const char* selfPluginName) {
}
inline void grabPluginKeyboard(Display* dpy, Window win) {
if (::access("/tmp/bananarchy_screen_locked", F_OK) == 0 &&
!isCallActiveOrRingingFast()) {
XUngrabKeyboard(dpy, CurrentTime);
XFlush(dpy);
return;
}
for (int i = 0; i < 40; ++i) {
if (XGrabKeyboard(dpy, win, True, GrabModeAsync, GrabModeAsync,
CurrentTime) == GrabSuccess) {