Skip to content

Commit d6eb127

Browse files
committed
lock keyboard on wayland
1 parent e6853ec commit d6eb127

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

safeeyes/ui/break_screen.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,6 @@ def __show_break_screen(self, message, image_path, widget, tray_actions):
157157
# Lock the keyboard
158158
if not self.context['is_wayland']:
159159
utility.start_thread(self.__lock_keyboard_x11)
160-
else:
161-
# TODO: Wayland keyboard locking
162-
logging.warning("Keyboard locking not yet implemented for Wayland.")
163160

164161
display = Gdk.Display.get_default()
165162
monitors = display.get_monitors()
@@ -232,6 +229,10 @@ def __show_break_screen(self, message, image_path, widget, tray_actions):
232229
window.fullscreen_on_monitor(monitor)
233230
window.present()
234231

232+
if self.context['is_wayland']:
233+
# this may or may not be granted by the window system
234+
window.get_surface().inhibit_system_shortcuts(None)
235+
235236
i = i + 1
236237

237238
def __update_count_down(self, count):

0 commit comments

Comments
 (0)