gdk_display_get_monitor_at_window: Check for offscreen windows
And get the embedder before continuing, as the backend-specific get_monitor_at_window () only knows about its own windows. In order to check for offscreen windows, we introduce a new function gdk_window_is_impl_offscreen (). Unlike gdk_window_is_offscreen (), it doesn't rely on the window_type field, but actually checks whether GDK_WINDOW_IMPL_GET_CLASS (window->impl) is GdkOffscreenWindow. See previous commit for informations.
This commit is contained in:
parent
0c72ce94ea
commit
6982415c9f
@ -31,6 +31,8 @@ gboolean gdk_display_get_debug_updates (GdkDisplay *display);
|
||||
void gdk_display_set_debug_updates (GdkDisplay *display,
|
||||
gboolean debug_updates);
|
||||
|
||||
gboolean gdk_window_is_impl_offscreen (GdkWindow *window);
|
||||
|
||||
const gchar * gdk_get_desktop_startup_id (void);
|
||||
const gchar * gdk_get_desktop_autostart_id (void);
|
||||
|
||||
|
@ -2710,6 +2710,9 @@ gdk_display_get_monitor_at_window (GdkDisplay *display,
|
||||
|
||||
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
|
||||
|
||||
if (window && gdk_window_is_impl_offscreen (window))
|
||||
window = gdk_offscreen_window_get_embedder (window);
|
||||
|
||||
class = GDK_DISPLAY_GET_CLASS (display);
|
||||
if (class->get_monitor_at_window)
|
||||
{
|
||||
|
@ -780,3 +780,12 @@ gdk_offscreen_window_class_init (GdkOffscreenWindowClass *klass)
|
||||
impl_class->delete_property = NULL;
|
||||
impl_class->get_scale_factor = gdk_offscreen_window_get_scale_factor;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdk_window_is_impl_offscreen (GdkWindow *window)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE);
|
||||
|
||||
return GDK_IS_OFFSCREEN_WINDOW (window->impl);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user