Preempt X11 keyboard grabs and window stacking when lockscreen is active
This commit is contained in:
1 parent
83dd79fe76
commit
f112b6ae72
78 files changed
+403
-53
No files matched your search
@@ -1094,7 +1094,7 @@ int webarchy_run_main(int argc, char** argv) {
|
||||
|
||||
auto syncWebkitVisibility = [&]() {
|
||||
if (!br.initialized || br.webkitXid == None) return;
|
||||
if (visible && !anyModalOpen()) {
|
||||
if (visible && !anyModalOpen() && !isPhonePasscodeLocked()) {
|
||||
XMoveResizeWindow(neo.dpy, br.webkitXid, 0, 35, 240, 217);
|
||||
XMapRaised(neo.dpy, br.webkitXid);
|
||||
} else if (visible) {
|
||||
@@ -1358,6 +1358,7 @@ int webarchy_run_main(int argc, char** argv) {
|
||||
openWindow();
|
||||
}
|
||||
|
||||
bool mutedByLock = false;
|
||||
while (gRunning) {
|
||||
for (const std::string& cmd : readFifoLines(fifoFd)) {
|
||||
if (cmd == "NOP") continue;
|
||||
@@ -1407,6 +1408,23 @@ int webarchy_run_main(int argc, char** argv) {
|
||||
}
|
||||
|
||||
if (visible) {
|
||||
if (isPhonePasscodeLocked()) {
|
||||
if (!mutedByLock) {
|
||||
mutedByLock = true;
|
||||
XUngrabKeyboard(neo.dpy, CurrentTime);
|
||||
XFlush(neo.dpy);
|
||||
if (br.initialized && br.webView) {
|
||||
webkit_web_view_set_is_muted(br.webView, TRUE);
|
||||
}
|
||||
syncWebkitVisibility();
|
||||
}
|
||||
} else if (mutedByLock) {
|
||||
mutedByLock = false;
|
||||
if (br.initialized && br.webView) {
|
||||
webkit_web_view_set_is_muted(br.webView, FALSE);
|
||||
}
|
||||
render();
|
||||
}
|
||||
neo.bindAsActiveContext();
|
||||
int ev = neoui_poll_event(0);
|
||||
while (ev != NEO_EV_NONE) {
|
||||
|
||||
Reference in new issue
Block a user