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 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5
parent
f2942a2946
commit
95ae054f6f
@@ -138,6 +138,9 @@ class Presenter(Gtk.Window):
|
|||||||
self.page = min(max(start_page, 1), presentation.pages or 1)
|
self.page = min(max(start_page, 1), presentation.pages or 1)
|
||||||
self.counted = False
|
self.counted = False
|
||||||
self.finished = 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.set_app_paintable(True)
|
||||||
self.fullscreen()
|
self.fullscreen()
|
||||||
@@ -172,11 +175,23 @@ class Presenter(Gtk.Window):
|
|||||||
So fullscreen is re-asserted rather than assumed, for as long as
|
So fullscreen is re-asserted rather than assumed, for as long as
|
||||||
the presentation is running. It stops the moment Escape is
|
the presentation is running. It stops the moment Escape is
|
||||||
pressed, so this can never fight the teacher's way out.
|
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:
|
if self.finished:
|
||||||
return False
|
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()
|
self.fullscreen()
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
|||||||
Reference in New Issue
Block a user