Xwayland: hide override redirect windows if locked

This commit is contained in:
Isaac Freund 2023-03-03 15:18:07 +01:00
parent 0be43ad45f
commit 4a9d84bdb8
No known key found for this signature in database
GPG Key ID: 86DED400DDFD7A11

View File

@ -18,6 +18,9 @@ const LockManager = @This();
const std = @import("std"); const std = @import("std");
const assert = std.debug.assert; const assert = std.debug.assert;
const build_options = @import("build_options");
const wlr = @import("wlroots"); const wlr = @import("wlroots");
const wl = @import("wayland").server.wl; const wl = @import("wayland").server.wl;
@ -92,6 +95,10 @@ fn handleLock(listener: *wl.Listener(*wlr.SessionLockV1), lock: *wlr.SessionLock
if (manager.state == .unlocked) { if (manager.state == .unlocked) {
manager.state = .waiting_for_lock_surfaces; manager.state = .waiting_for_lock_surfaces;
if (build_options.xwayland) {
server.root.layers.xwayland_override_redirect.node.setEnabled(false);
}
manager.lock_surfaces_timer.timerUpdate(200) catch { manager.lock_surfaces_timer.timerUpdate(200) catch {
log.err("error setting lock surfaces timer, imperfect frames may be shown", .{}); log.err("error setting lock surfaces timer, imperfect frames may be shown", .{});
manager.state = .waiting_for_blank; manager.state = .waiting_for_blank;
@ -218,6 +225,10 @@ fn handleUnlock(listener: *wl.Listener(void)) void {
} }
} }
if (build_options.xwayland) {
server.root.layers.xwayland_override_redirect.node.setEnabled(true);
}
{ {
var it = server.input_manager.seats.first; var it = server.input_manager.seats.first;
while (it) |node| : (it = node.next) { while (it) |node| : (it = node.next) {