Skip to main content

gtk/auto/
offscreen_window.rs

1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from gir-files (https://github.com/gtk-rs/gir-files)
3// DO NOT EDIT
4
5use crate::{
6    Align, Application, Bin, Buildable, Container, ResizeMode, Widget, Window, WindowPosition,
7    WindowType,
8};
9use glib::{prelude::*, translate::*};
10use std::fmt;
11
12glib::wrapper! {
13    /// GtkOffscreenWindow is strictly intended to be used for obtaining
14    /// snapshots of widgets that are not part of a normal widget hierarchy.
15    /// Since [`OffscreenWindow`][crate::OffscreenWindow] is a toplevel widget you cannot obtain
16    /// snapshots of a full window with it since you cannot pack a toplevel
17    /// widget in another toplevel.
18    ///
19    /// The idea is to take a widget and manually set the state of it,
20    /// add it to a GtkOffscreenWindow and then retrieve the snapshot
21    /// as a [`cairo::Surface`][crate::cairo::Surface] or [`gdk_pixbuf::Pixbuf`][crate::gdk_pixbuf::Pixbuf].
22    ///
23    /// GtkOffscreenWindow derives from [`Window`][crate::Window] only as an implementation
24    /// detail. Applications should not use any API specific to [`Window`][crate::Window]
25    /// to operate on this object. It should be treated as a [`Bin`][crate::Bin] that
26    /// has no parent widget.
27    ///
28    /// When contained offscreen widgets are redrawn, GtkOffscreenWindow
29    /// will emit a [`damage-event`][struct@crate::Widget#damage-event] signal.
30    ///
31    /// # Implements
32    ///
33    /// [`OffscreenWindowExt`][trait@crate::prelude::OffscreenWindowExt], [`GtkWindowExt`][trait@crate::prelude::GtkWindowExt], [`BinExt`][trait@crate::prelude::BinExt], [`ContainerExt`][trait@crate::prelude::ContainerExt], [`WidgetExt`][trait@crate::prelude::WidgetExt], [`trait@glib::ObjectExt`], [`BuildableExt`][trait@crate::prelude::BuildableExt], [`GtkWindowExtManual`][trait@crate::prelude::GtkWindowExtManual], [`ContainerExtManual`][trait@crate::prelude::ContainerExtManual], [`WidgetExtManual`][trait@crate::prelude::WidgetExtManual], [`BuildableExtManual`][trait@crate::prelude::BuildableExtManual]
34    #[doc(alias = "GtkOffscreenWindow")]
35    pub struct OffscreenWindow(Object<ffi::GtkOffscreenWindow, ffi::GtkOffscreenWindowClass>) @extends Window, Bin, Container, Widget, @implements Buildable;
36
37    match fn {
38        type_ => || ffi::gtk_offscreen_window_get_type(),
39    }
40}
41
42impl OffscreenWindow {
43    pub const NONE: Option<&'static OffscreenWindow> = None;
44
45    /// Creates a toplevel container widget that is used to retrieve
46    /// snapshots of widgets without showing them on the screen.
47    ///
48    /// # Returns
49    ///
50    /// A pointer to a [`Widget`][crate::Widget]
51    #[doc(alias = "gtk_offscreen_window_new")]
52    pub fn new() -> OffscreenWindow {
53        assert_initialized_main_thread!();
54        unsafe { Widget::from_glib_none(ffi::gtk_offscreen_window_new()).unsafe_cast() }
55    }
56
57    // rustdoc-stripper-ignore-next
58    /// Creates a new builder-pattern struct instance to construct [`OffscreenWindow`] objects.
59    ///
60    /// This method returns an instance of [`OffscreenWindowBuilder`](crate::builders::OffscreenWindowBuilder) which can be used to create [`OffscreenWindow`] objects.
61    pub fn builder() -> OffscreenWindowBuilder {
62        OffscreenWindowBuilder::new()
63    }
64}
65
66impl Default for OffscreenWindow {
67    fn default() -> Self {
68        Self::new()
69    }
70}
71
72// rustdoc-stripper-ignore-next
73/// A [builder-pattern] type to construct [`OffscreenWindow`] objects.
74///
75/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
76#[must_use = "The builder must be built to be used"]
77pub struct OffscreenWindowBuilder {
78    builder: glib::object::ObjectBuilder<'static, OffscreenWindow>,
79}
80
81impl OffscreenWindowBuilder {
82    fn new() -> Self {
83        Self {
84            builder: glib::object::Object::builder(),
85        }
86    }
87
88    /// Whether the window should receive the input focus.
89    pub fn accept_focus(self, accept_focus: bool) -> Self {
90        Self {
91            builder: self.builder.property("accept-focus", accept_focus),
92        }
93    }
94
95    /// The [`Application`][crate::Application] associated with the window.
96    ///
97    /// The application will be kept alive for at least as long as it
98    /// has any windows associated with it (see [`ApplicationExtManual::hold()`][crate::gio::prelude::ApplicationExtManual::hold()]
99    /// for a way to keep it alive without windows).
100    ///
101    /// Normally, the connection between the application and the window
102    /// will remain until the window is destroyed, but you can explicitly
103    /// remove it by setting the :application property to [`None`].
104    pub fn application(self, application: &impl IsA<Application>) -> Self {
105        Self {
106            builder: self
107                .builder
108                .property("application", application.clone().upcast()),
109        }
110    }
111
112    /// The widget to which this window is attached.
113    /// See [`GtkWindowExt::set_attached_to()`][crate::prelude::GtkWindowExt::set_attached_to()].
114    ///
115    /// Examples of places where specifying this relation is useful are
116    /// for instance a [`Menu`][crate::Menu] created by a [`ComboBox`][crate::ComboBox], a completion
117    /// popup window created by [`Entry`][crate::Entry] or a typeahead search entry
118    /// created by [`TreeView`][crate::TreeView].
119    pub fn attached_to(self, attached_to: &impl IsA<Widget>) -> Self {
120        Self {
121            builder: self
122                .builder
123                .property("attached-to", attached_to.clone().upcast()),
124        }
125    }
126
127    /// Whether the window should be decorated by the window manager.
128    pub fn decorated(self, decorated: bool) -> Self {
129        Self {
130            builder: self.builder.property("decorated", decorated),
131        }
132    }
133
134    pub fn default_height(self, default_height: i32) -> Self {
135        Self {
136            builder: self.builder.property("default-height", default_height),
137        }
138    }
139
140    pub fn default_width(self, default_width: i32) -> Self {
141        Self {
142            builder: self.builder.property("default-width", default_width),
143        }
144    }
145
146    /// Whether the window frame should have a close button.
147    pub fn deletable(self, deletable: bool) -> Self {
148        Self {
149            builder: self.builder.property("deletable", deletable),
150        }
151    }
152
153    pub fn destroy_with_parent(self, destroy_with_parent: bool) -> Self {
154        Self {
155            builder: self
156                .builder
157                .property("destroy-with-parent", destroy_with_parent),
158        }
159    }
160
161    /// Whether the window should receive the input focus when mapped.
162    pub fn focus_on_map(self, focus_on_map: bool) -> Self {
163        Self {
164            builder: self.builder.property("focus-on-map", focus_on_map),
165        }
166    }
167
168    /// Whether 'focus rectangles' are currently visible in this window.
169    ///
170    /// This property is maintained by GTK+ based on user input
171    /// and should not be set by applications.
172    pub fn focus_visible(self, focus_visible: bool) -> Self {
173        Self {
174            builder: self.builder.property("focus-visible", focus_visible),
175        }
176    }
177
178    /// The window gravity of the window. See [`GtkWindowExt::move_()`][crate::prelude::GtkWindowExt::move_()] and [`gdk::Gravity`][crate::gdk::Gravity] for
179    /// more details about window gravity.
180    pub fn gravity(self, gravity: gdk::Gravity) -> Self {
181        Self {
182            builder: self.builder.property("gravity", gravity),
183        }
184    }
185
186    /// Whether the titlebar should be hidden during maximization.
187    pub fn hide_titlebar_when_maximized(self, hide_titlebar_when_maximized: bool) -> Self {
188        Self {
189            builder: self
190                .builder
191                .property("hide-titlebar-when-maximized", hide_titlebar_when_maximized),
192        }
193    }
194
195    pub fn icon(self, icon: &gdk_pixbuf::Pixbuf) -> Self {
196        Self {
197            builder: self.builder.property("icon", icon.clone()),
198        }
199    }
200
201    /// The :icon-name property specifies the name of the themed icon to
202    /// use as the window icon. See [`IconTheme`][crate::IconTheme] for more details.
203    pub fn icon_name(self, icon_name: impl Into<glib::GString>) -> Self {
204        Self {
205            builder: self.builder.property("icon-name", icon_name.into()),
206        }
207    }
208
209    /// Whether mnemonics are currently visible in this window.
210    ///
211    /// This property is maintained by GTK+ based on user input,
212    /// and should not be set by applications.
213    pub fn mnemonics_visible(self, mnemonics_visible: bool) -> Self {
214        Self {
215            builder: self
216                .builder
217                .property("mnemonics-visible", mnemonics_visible),
218        }
219    }
220
221    pub fn modal(self, modal: bool) -> Self {
222        Self {
223            builder: self.builder.property("modal", modal),
224        }
225    }
226
227    pub fn resizable(self, resizable: bool) -> Self {
228        Self {
229            builder: self.builder.property("resizable", resizable),
230        }
231    }
232
233    pub fn role(self, role: impl Into<glib::GString>) -> Self {
234        Self {
235            builder: self.builder.property("role", role.into()),
236        }
237    }
238
239    pub fn screen(self, screen: &gdk::Screen) -> Self {
240        Self {
241            builder: self.builder.property("screen", screen.clone()),
242        }
243    }
244
245    pub fn skip_pager_hint(self, skip_pager_hint: bool) -> Self {
246        Self {
247            builder: self.builder.property("skip-pager-hint", skip_pager_hint),
248        }
249    }
250
251    pub fn skip_taskbar_hint(self, skip_taskbar_hint: bool) -> Self {
252        Self {
253            builder: self
254                .builder
255                .property("skip-taskbar-hint", skip_taskbar_hint),
256        }
257    }
258
259    /// The :startup-id is a write-only property for setting window's
260    /// startup notification identifier. See [`GtkWindowExt::set_startup_id()`][crate::prelude::GtkWindowExt::set_startup_id()]
261    /// for more details.
262    pub fn startup_id(self, startup_id: impl Into<glib::GString>) -> Self {
263        Self {
264            builder: self.builder.property("startup-id", startup_id.into()),
265        }
266    }
267
268    pub fn title(self, title: impl Into<glib::GString>) -> Self {
269        Self {
270            builder: self.builder.property("title", title.into()),
271        }
272    }
273
274    /// The transient parent of the window. See [`GtkWindowExt::set_transient_for()`][crate::prelude::GtkWindowExt::set_transient_for()] for
275    /// more details about transient windows.
276    pub fn transient_for(self, transient_for: &impl IsA<Window>) -> Self {
277        Self {
278            builder: self
279                .builder
280                .property("transient-for", transient_for.clone().upcast()),
281        }
282    }
283
284    pub fn type_(self, type_: WindowType) -> Self {
285        Self {
286            builder: self.builder.property("type", type_),
287        }
288    }
289
290    pub fn type_hint(self, type_hint: gdk::WindowTypeHint) -> Self {
291        Self {
292            builder: self.builder.property("type-hint", type_hint),
293        }
294    }
295
296    pub fn urgency_hint(self, urgency_hint: bool) -> Self {
297        Self {
298            builder: self.builder.property("urgency-hint", urgency_hint),
299        }
300    }
301
302    pub fn window_position(self, window_position: WindowPosition) -> Self {
303        Self {
304            builder: self.builder.property("window-position", window_position),
305        }
306    }
307
308    pub fn border_width(self, border_width: u32) -> Self {
309        Self {
310            builder: self.builder.property("border-width", border_width),
311        }
312    }
313
314    pub fn child(self, child: &impl IsA<Widget>) -> Self {
315        Self {
316            builder: self.builder.property("child", child.clone().upcast()),
317        }
318    }
319
320    pub fn resize_mode(self, resize_mode: ResizeMode) -> Self {
321        Self {
322            builder: self.builder.property("resize-mode", resize_mode),
323        }
324    }
325
326    pub fn app_paintable(self, app_paintable: bool) -> Self {
327        Self {
328            builder: self.builder.property("app-paintable", app_paintable),
329        }
330    }
331
332    pub fn can_default(self, can_default: bool) -> Self {
333        Self {
334            builder: self.builder.property("can-default", can_default),
335        }
336    }
337
338    pub fn can_focus(self, can_focus: bool) -> Self {
339        Self {
340            builder: self.builder.property("can-focus", can_focus),
341        }
342    }
343
344    pub fn events(self, events: gdk::EventMask) -> Self {
345        Self {
346            builder: self.builder.property("events", events),
347        }
348    }
349
350    /// Whether to expand in both directions. Setting this sets both [`hexpand`][struct@crate::Widget#hexpand] and [`vexpand`][struct@crate::Widget#vexpand]
351    pub fn expand(self, expand: bool) -> Self {
352        Self {
353            builder: self.builder.property("expand", expand),
354        }
355    }
356
357    /// Whether the widget should grab focus when it is clicked with the mouse.
358    ///
359    /// This property is only relevant for widgets that can take focus.
360    ///
361    /// Before 3.20, several widgets (GtkButton, GtkFileChooserButton,
362    /// GtkComboBox) implemented this property individually.
363    pub fn focus_on_click(self, focus_on_click: bool) -> Self {
364        Self {
365            builder: self.builder.property("focus-on-click", focus_on_click),
366        }
367    }
368
369    /// How to distribute horizontal space if widget gets extra space, see [`Align`][crate::Align]
370    pub fn halign(self, halign: Align) -> Self {
371        Self {
372            builder: self.builder.property("halign", halign),
373        }
374    }
375
376    pub fn has_default(self, has_default: bool) -> Self {
377        Self {
378            builder: self.builder.property("has-default", has_default),
379        }
380    }
381
382    pub fn has_focus(self, has_focus: bool) -> Self {
383        Self {
384            builder: self.builder.property("has-focus", has_focus),
385        }
386    }
387
388    /// Enables or disables the emission of [`query-tooltip`][struct@crate::Widget#query-tooltip] on `widget`.
389    /// A value of [`true`] indicates that `widget` can have a tooltip, in this case
390    /// the widget will be queried using [`query-tooltip`][struct@crate::Widget#query-tooltip] to determine
391    /// whether it will provide a tooltip or not.
392    ///
393    /// Note that setting this property to [`true`] for the first time will change
394    /// the event masks of the GdkWindows of this widget to include leave-notify
395    /// and motion-notify events. This cannot and will not be undone when the
396    /// property is set to [`false`] again.
397    pub fn has_tooltip(self, has_tooltip: bool) -> Self {
398        Self {
399            builder: self.builder.property("has-tooltip", has_tooltip),
400        }
401    }
402
403    pub fn height_request(self, height_request: i32) -> Self {
404        Self {
405            builder: self.builder.property("height-request", height_request),
406        }
407    }
408
409    /// Whether to expand horizontally. See [`WidgetExt::set_hexpand()`][crate::prelude::WidgetExt::set_hexpand()].
410    pub fn hexpand(self, hexpand: bool) -> Self {
411        Self {
412            builder: self.builder.property("hexpand", hexpand),
413        }
414    }
415
416    /// Whether to use the [`hexpand`][struct@crate::Widget#hexpand] property. See [`WidgetExt::is_hexpand_set()`][crate::prelude::WidgetExt::is_hexpand_set()].
417    pub fn hexpand_set(self, hexpand_set: bool) -> Self {
418        Self {
419            builder: self.builder.property("hexpand-set", hexpand_set),
420        }
421    }
422
423    pub fn is_focus(self, is_focus: bool) -> Self {
424        Self {
425            builder: self.builder.property("is-focus", is_focus),
426        }
427    }
428
429    /// Sets all four sides' margin at once. If read, returns max
430    /// margin on any side.
431    pub fn margin(self, margin: i32) -> Self {
432        Self {
433            builder: self.builder.property("margin", margin),
434        }
435    }
436
437    /// Margin on bottom side of widget.
438    ///
439    /// This property adds margin outside of the widget's normal size
440    /// request, the margin will be added in addition to the size from
441    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
442    pub fn margin_bottom(self, margin_bottom: i32) -> Self {
443        Self {
444            builder: self.builder.property("margin-bottom", margin_bottom),
445        }
446    }
447
448    /// Margin on end of widget, horizontally. This property supports
449    /// left-to-right and right-to-left text directions.
450    ///
451    /// This property adds margin outside of the widget's normal size
452    /// request, the margin will be added in addition to the size from
453    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
454    pub fn margin_end(self, margin_end: i32) -> Self {
455        Self {
456            builder: self.builder.property("margin-end", margin_end),
457        }
458    }
459
460    /// Margin on start of widget, horizontally. This property supports
461    /// left-to-right and right-to-left text directions.
462    ///
463    /// This property adds margin outside of the widget's normal size
464    /// request, the margin will be added in addition to the size from
465    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
466    pub fn margin_start(self, margin_start: i32) -> Self {
467        Self {
468            builder: self.builder.property("margin-start", margin_start),
469        }
470    }
471
472    /// Margin on top side of widget.
473    ///
474    /// This property adds margin outside of the widget's normal size
475    /// request, the margin will be added in addition to the size from
476    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
477    pub fn margin_top(self, margin_top: i32) -> Self {
478        Self {
479            builder: self.builder.property("margin-top", margin_top),
480        }
481    }
482
483    pub fn name(self, name: impl Into<glib::GString>) -> Self {
484        Self {
485            builder: self.builder.property("name", name.into()),
486        }
487    }
488
489    pub fn no_show_all(self, no_show_all: bool) -> Self {
490        Self {
491            builder: self.builder.property("no-show-all", no_show_all),
492        }
493    }
494
495    /// The requested opacity of the widget. See [`WidgetExt::set_opacity()`][crate::prelude::WidgetExt::set_opacity()] for
496    /// more details about window opacity.
497    ///
498    /// Before 3.8 this was only available in GtkWindow
499    pub fn opacity(self, opacity: f64) -> Self {
500        Self {
501            builder: self.builder.property("opacity", opacity),
502        }
503    }
504
505    pub fn parent(self, parent: &impl IsA<Container>) -> Self {
506        Self {
507            builder: self.builder.property("parent", parent.clone().upcast()),
508        }
509    }
510
511    pub fn receives_default(self, receives_default: bool) -> Self {
512        Self {
513            builder: self.builder.property("receives-default", receives_default),
514        }
515    }
516
517    pub fn sensitive(self, sensitive: bool) -> Self {
518        Self {
519            builder: self.builder.property("sensitive", sensitive),
520        }
521    }
522
523    /// Sets the text of tooltip to be the given string, which is marked up
524    /// with the [Pango text markup language][PangoMarkupFormat].
525    /// Also see [`Tooltip::set_markup()`][crate::Tooltip::set_markup()].
526    ///
527    /// This is a convenience property which will take care of getting the
528    /// tooltip shown if the given string is not [`None`]: [`has-tooltip`][struct@crate::Widget#has-tooltip]
529    /// will automatically be set to [`true`] and there will be taken care of
530    /// [`query-tooltip`][struct@crate::Widget#query-tooltip] in the default signal handler.
531    ///
532    /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and [`tooltip-markup`][struct@crate::Widget#tooltip-markup]
533    /// are set, the last one wins.
534    pub fn tooltip_markup(self, tooltip_markup: impl Into<glib::GString>) -> Self {
535        Self {
536            builder: self
537                .builder
538                .property("tooltip-markup", tooltip_markup.into()),
539        }
540    }
541
542    /// Sets the text of tooltip to be the given string.
543    ///
544    /// Also see [`Tooltip::set_text()`][crate::Tooltip::set_text()].
545    ///
546    /// This is a convenience property which will take care of getting the
547    /// tooltip shown if the given string is not [`None`]: [`has-tooltip`][struct@crate::Widget#has-tooltip]
548    /// will automatically be set to [`true`] and there will be taken care of
549    /// [`query-tooltip`][struct@crate::Widget#query-tooltip] in the default signal handler.
550    ///
551    /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and [`tooltip-markup`][struct@crate::Widget#tooltip-markup]
552    /// are set, the last one wins.
553    pub fn tooltip_text(self, tooltip_text: impl Into<glib::GString>) -> Self {
554        Self {
555            builder: self.builder.property("tooltip-text", tooltip_text.into()),
556        }
557    }
558
559    /// How to distribute vertical space if widget gets extra space, see [`Align`][crate::Align]
560    pub fn valign(self, valign: Align) -> Self {
561        Self {
562            builder: self.builder.property("valign", valign),
563        }
564    }
565
566    /// Whether to expand vertically. See [`WidgetExt::set_vexpand()`][crate::prelude::WidgetExt::set_vexpand()].
567    pub fn vexpand(self, vexpand: bool) -> Self {
568        Self {
569            builder: self.builder.property("vexpand", vexpand),
570        }
571    }
572
573    /// Whether to use the [`vexpand`][struct@crate::Widget#vexpand] property. See [`WidgetExt::is_vexpand_set()`][crate::prelude::WidgetExt::is_vexpand_set()].
574    pub fn vexpand_set(self, vexpand_set: bool) -> Self {
575        Self {
576            builder: self.builder.property("vexpand-set", vexpand_set),
577        }
578    }
579
580    pub fn visible(self, visible: bool) -> Self {
581        Self {
582            builder: self.builder.property("visible", visible),
583        }
584    }
585
586    pub fn width_request(self, width_request: i32) -> Self {
587        Self {
588            builder: self.builder.property("width-request", width_request),
589        }
590    }
591
592    // rustdoc-stripper-ignore-next
593    /// Build the [`OffscreenWindow`].
594    #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
595    pub fn build(self) -> OffscreenWindow {
596        self.builder.build()
597    }
598}
599
600mod sealed {
601    pub trait Sealed {}
602    impl<T: super::IsA<super::OffscreenWindow>> Sealed for T {}
603}
604
605/// Trait containing all [`struct@OffscreenWindow`] methods.
606///
607/// # Implementors
608///
609/// [`OffscreenWindow`][struct@crate::OffscreenWindow]
610pub trait OffscreenWindowExt: IsA<OffscreenWindow> + sealed::Sealed + 'static {
611    /// Retrieves a snapshot of the contained widget in the form of
612    /// a [`gdk_pixbuf::Pixbuf`][crate::gdk_pixbuf::Pixbuf]. This is a new pixbuf with a reference count of 1,
613    /// and the application should unreference it once it is no longer
614    /// needed.
615    ///
616    /// # Returns
617    ///
618    /// A [`gdk_pixbuf::Pixbuf`][crate::gdk_pixbuf::Pixbuf] pointer, or [`None`].
619    #[doc(alias = "gtk_offscreen_window_get_pixbuf")]
620    #[doc(alias = "get_pixbuf")]
621    fn pixbuf(&self) -> Option<gdk_pixbuf::Pixbuf> {
622        unsafe {
623            from_glib_full(ffi::gtk_offscreen_window_get_pixbuf(
624                self.as_ref().to_glib_none().0,
625            ))
626        }
627    }
628
629    /// Retrieves a snapshot of the contained widget in the form of
630    /// a [`cairo::Surface`][crate::cairo::Surface]. If you need to keep this around over window
631    /// resizes then you should add a reference to it.
632    ///
633    /// # Returns
634    ///
635    /// A [`cairo::Surface`][crate::cairo::Surface] pointer to the offscreen
636    ///  surface, or [`None`].
637    #[doc(alias = "gtk_offscreen_window_get_surface")]
638    #[doc(alias = "get_surface")]
639    fn surface(&self) -> Option<cairo::Surface> {
640        unsafe {
641            from_glib_none(ffi::gtk_offscreen_window_get_surface(
642                self.as_ref().to_glib_none().0,
643            ))
644        }
645    }
646}
647
648impl<O: IsA<OffscreenWindow>> OffscreenWindowExt for O {}
649
650impl fmt::Display for OffscreenWindow {
651    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
652        f.write_str("OffscreenWindow")
653    }
654}