diff --git a/src/telephony/client/ui/main_window.py b/src/telephony/client/ui/main_window.py index f92515c7..05f95745 100644 --- a/src/telephony/client/ui/main_window.py +++ b/src/telephony/client/ui/main_window.py @@ -394,10 +394,13 @@ def _refresh_calling_controls(self, *args): def _toast_target(self): """Return the overlay of the topmost surface. - A presented dialog is painted above the window content, so a - toast raised on the window's own overlay would sit hidden - underneath an open sheet. + An open sheet and a presented dialog are both painted above + the window content, so a toast raised on the window's own + overlay would sit hidden underneath them. """ + if self.sheet_host.get_open() and self.sheet_toast_overlay is not None: + return self.sheet_toast_overlay + dialog = self.get_visible_dialog() if dialog is not None: overlay = self._find_toast_overlay(dialog.get_child()) diff --git a/src/telephony/client/ui/widgets/common_widget.py b/src/telephony/client/ui/widgets/common_widget.py index 1ee681fb..e719cf61 100644 --- a/src/telephony/client/ui/widgets/common_widget.py +++ b/src/telephony/client/ui/widgets/common_widget.py @@ -53,12 +53,23 @@ def install_sheet_host(window): host.set_modal(True) host.set_content(content) window.set_content(host) + window.sheet_toast_overlay = None return host def present_sheet(window, child): - """Show a widget as the window's bottom sheet.""" - window.sheet_host.set_sheet(child) + """Show a widget as the window's bottom sheet. + + The sheet content rides inside its own toast overlay, because the + window's overlay sits under the sheet and a toast raised there + while a sheet is open answers to nobody. The host itself is left + where it is; the sheet slot is just a widget and takes the wrapper + without complaint. + """ + overlay = Adw.ToastOverlay() + overlay.set_child(child) + window.sheet_toast_overlay = overlay + window.sheet_host.set_sheet(overlay) window.sheet_host.set_open(True)