@@ -308,62 +308,121 @@ impl<P: Params> Window<P> {
308308 }
309309
310310 /// Returns the scale factor that can be used to map logical pixels to physical pixels, and vice versa.
311+ ///
312+ /// # Panics
313+ ///
314+ /// Panics if the app is not running yet, usually when called on the [`setup`](crate::Builder#method.setup) closure.
315+ /// You can spawn a task to use the API using the [`async_runtime`](crate::async_runtime) to prevent the panic.
311316 pub fn scale_factor ( & self ) -> crate :: Result < f64 > {
312317 self . window . dispatcher . scale_factor ( ) . map_err ( Into :: into)
313318 }
314319
315320 /// Returns the position of the top-left hand corner of the window's client area relative to the top-left hand corner of the desktop.
321+ ///
322+ /// # Panics
323+ ///
324+ /// Panics if the app is not running yet, usually when called on the [`setup`](crate::Builder#method.setup) closure.
325+ /// You can spawn a task to use the API using the [`async_runtime`](crate::async_runtime) to prevent the panic.
316326 pub fn inner_position ( & self ) -> crate :: Result < PhysicalPosition < i32 > > {
317327 self . window . dispatcher . inner_position ( ) . map_err ( Into :: into)
318328 }
319329
320330 /// Returns the position of the top-left hand corner of the window relative to the top-left hand corner of the desktop.
331+ ///
332+ /// # Panics
333+ ///
334+ /// Panics if the app is not running yet, usually when called on the [`setup`](crate::Builder#method.setup) closure.
335+ /// You can spawn a task to use the API using the [`async_runtime`](crate::async_runtime) to prevent the panic.
321336 pub fn outer_position ( & self ) -> crate :: Result < PhysicalPosition < i32 > > {
322337 self . window . dispatcher . outer_position ( ) . map_err ( Into :: into)
323338 }
324339
325340 /// Returns the physical size of the window's client area.
326341 ///
327342 /// The client area is the content of the window, excluding the title bar and borders.
343+ ///
344+ /// # Panics
345+ ///
346+ /// Panics if the app is not running yet, usually when called on the [`setup`](crate::Builder#method.setup) closure.
347+ /// You can spawn a task to use the API using the [`async_runtime`](crate::async_runtime) to prevent the panic.
328348 pub fn inner_size ( & self ) -> crate :: Result < PhysicalSize < u32 > > {
329349 self . window . dispatcher . inner_size ( ) . map_err ( Into :: into)
330350 }
331351
332352 /// Returns the physical size of the entire window.
333353 ///
334354 /// These dimensions include the title bar and borders. If you don't want that (and you usually don't), use inner_size instead.
355+ ///
356+ /// # Panics
357+ ///
358+ /// Panics if the app is not running yet, usually when called on the [`setup`](crate::Builder#method.setup) closure.
359+ /// You can spawn a task to use the API using the [`async_runtime`](crate::async_runtime) to prevent the panic.
335360 pub fn outer_size ( & self ) -> crate :: Result < PhysicalSize < u32 > > {
336361 self . window . dispatcher . outer_size ( ) . map_err ( Into :: into)
337362 }
338363
339364 /// Gets the window's current fullscreen state.
365+ ///
366+ /// # Panics
367+ ///
368+ /// Panics if the app is not running yet, usually when called on the [`setup`](crate::Builder#method.setup) closure.
369+ /// You can spawn a task to use the API using the [`async_runtime`](crate::async_runtime) to prevent the panic.
340370 pub fn is_fullscreen ( & self ) -> crate :: Result < bool > {
341371 self . window . dispatcher . is_fullscreen ( ) . map_err ( Into :: into)
342372 }
343373
344374 /// Gets the window's current maximized state.
375+ ///
376+ /// # Panics
377+ ///
378+ /// Panics if the app is not running yet, usually when called on the [`setup`](crate::Builder#method.setup) closure.
379+ /// You can spawn a task to use the API using the [`async_runtime`](crate::async_runtime) to prevent the panic.
345380 pub fn is_maximized ( & self ) -> crate :: Result < bool > {
346381 self . window . dispatcher . is_maximized ( ) . map_err ( Into :: into)
347382 }
348383
349384 /// Gets the window’s current decoration state.
385+ ///
386+ /// # Panics
387+ ///
388+ /// Panics if the app is not running yet, usually when called on the [`setup`](crate::Builder#method.setup) closure.
389+ /// You can spawn a task to use the API using the [`async_runtime`](crate::async_runtime) to prevent the panic.
350390 pub fn is_decorated ( & self ) -> crate :: Result < bool > {
351391 self . window . dispatcher . is_decorated ( ) . map_err ( Into :: into)
352392 }
353393
354394 /// Gets the window’s current resizable state.
395+ ///
396+ /// # Panics
397+ ///
398+ /// Panics if the app is not running yet, usually when called on the [`setup`](crate::Builder#method.setup) closure.
399+ /// You can spawn a task to use the API using the [`async_runtime`](crate::async_runtime) to prevent the panic.
355400 pub fn is_resizable ( & self ) -> crate :: Result < bool > {
356401 self . window . dispatcher . is_resizable ( ) . map_err ( Into :: into)
357402 }
358403
359404 /// Gets the window's current vibility state.
405+ ///
406+ /// # Panics
407+ ///
408+ /// Panics if the app is not running yet, usually when called on the [`setup`](crate::Builder#method.setup) closure.
409+ /// You can spawn a task to use the API using the [`async_runtime`](crate::async_runtime) to prevent the panic.
360410 pub fn is_visible ( & self ) -> crate :: Result < bool > {
361411 self . window . dispatcher . is_visible ( ) . map_err ( Into :: into)
362412 }
363413
364414 /// Returns the monitor on which the window currently resides.
365415 ///
366416 /// Returns None if current monitor can't be detected.
417+ ///
418+ /// ## Platform-specific
419+ ///
420+ /// - **Linux:** Unsupported
421+ ///
422+ /// # Panics
423+ ///
424+ /// Panics if the app is not running yet, usually when called on the [`setup`](crate::Builder#method.setup) closure.
425+ /// You can spawn a task to use the API using the [`async_runtime`](crate::async_runtime) to prevent the panic.
367426 pub fn current_monitor ( & self ) -> crate :: Result < Option < Monitor > > {
368427 self
369428 . window
@@ -376,6 +435,15 @@ impl<P: Params> Window<P> {
376435 /// Returns the primary monitor of the system.
377436 ///
378437 /// Returns None if it can't identify any monitor as a primary one.
438+ ///
439+ /// ## Platform-specific
440+ ///
441+ /// - **Linux:** Unsupported
442+ ///
443+ /// # Panics
444+ ///
445+ /// Panics if the app is not running yet, usually when called on the [`setup`](crate::Builder#method.setup) closure.
446+ /// You can spawn a task to use the API using the [`async_runtime`](crate::async_runtime) to prevent the panic.
379447 pub fn primary_monitor ( & self ) -> crate :: Result < Option < Monitor > > {
380448 self
381449 . window
@@ -386,6 +454,15 @@ impl<P: Params> Window<P> {
386454 }
387455
388456 /// Returns the list of all the monitors available on the system.
457+ ///
458+ /// ## Platform-specific
459+ ///
460+ /// - **Linux:** Unsupported
461+ ///
462+ /// # Panics
463+ ///
464+ /// Panics if the app is not running yet, usually when called on the [`setup`](crate::Builder#method.setup) closure.
465+ /// You can spawn a task to use the API using the [`async_runtime`](crate::async_runtime) to prevent the panic.
389466 pub fn available_monitors ( & self ) -> crate :: Result < Vec < Monitor > > {
390467 self
391468 . window
@@ -396,6 +473,11 @@ impl<P: Params> Window<P> {
396473 }
397474
398475 /// Returns the native handle that is used by this window.
476+ ///
477+ /// # Panics
478+ ///
479+ /// Panics if the app is not running yet, usually when called on the [`setup`](crate::Builder#method.setup) closure.
480+ /// You can spawn a task to use the API using the [`async_runtime`](crate::async_runtime) to prevent the panic.
399481 #[ cfg( windows) ]
400482 pub fn hwnd ( & self ) -> crate :: Result < * mut std:: ffi:: c_void > {
401483 self . window . dispatcher . hwnd ( ) . map_err ( Into :: into)
0 commit comments