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