From 95ae054f6fc6c773af9af3000661e4b95712efee Mon Sep 17 00:00:00 2001 From: ekklesia Date: Tue, 22 Sep 2026 20:24:06 -0500 Subject: [PATCH] fix: the presenter stops insisting on fullscreen after a few refusals The slideshow re-asserts fullscreen when a compositor takes it away, which is what keeps a teacher from being left looking at the library beside their slides. A compositor that granted it and revoked it repeatedly would have had this asking forever, in the middle of a Bible study. It gives up after five goes. The slides are still on the screen and Escape still works; only the insisting stops, which is a far better failure than a window fighting a compositor in front of a room. Co-Authored-By: Claude Opus 5 --- scripts/classroom-presentations | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/scripts/classroom-presentations b/scripts/classroom-presentations index cdf007a..2d9f9b1 100755 --- a/scripts/classroom-presentations +++ b/scripts/classroom-presentations @@ -138,6 +138,9 @@ class Presenter(Gtk.Window): self.page = min(max(start_page, 1), presentation.pages or 1) self.counted = False self.finished = False + # How many times fullscreen has been asked for without it + # sticking. See _state. + self.refused = 0 self.set_app_paintable(True) self.fullscreen() @@ -172,11 +175,23 @@ class Presenter(Gtk.Window): So fullscreen is re-asserted rather than assumed, for as long as the presentation is running. It stops the moment Escape is pressed, so this can never fight the teacher's way out. + + And it gives up after a few goes. A compositor that keeps + granting fullscreen and taking it away again would otherwise have + this asking forever, in the middle of a Bible study, which is a + worse failure than the window being the wrong size. After that + the slides are still on the screen and Escape still works — only + the insisting stops. """ if self.finished: return False - if not (event.new_window_state & Gdk.WindowState.FULLSCREEN): + if event.new_window_state & Gdk.WindowState.FULLSCREEN: + self.refused = 0 + return False + + if self.refused < 5: + self.refused += 1 self.fullscreen() return False