ms-windows engine: get the size of windows and pixmaps without the deprecated call the engine is built without, which newer compilers refuse

This commit is contained in:
Daemonratte 2026-10-16 16:06:17 +02:00
commit 1bba6211a7
No known key found for this signature in database

View file

@ -878,6 +878,22 @@ setup_system_styles (GtkStyle *style)
}
}
/* the size of a window or pixmap, without the deprecated
* gdk_drawable_get_size() this engine is built without */
static void
drawable_get_size (GdkDrawable *drawable, gint *width, gint *height)
{
if (GDK_IS_WINDOW (drawable))
{
if (width)
*width = gdk_window_get_width (GDK_WINDOW (drawable));
if (height)
*height = gdk_window_get_height (GDK_WINDOW (drawable));
}
else
gdk_pixmap_get_size (GDK_PIXMAP (drawable), width, height);
}
static gboolean
sanitize_size (GdkWindow *window, gint *width, gint *height)
{
@ -886,15 +902,15 @@ sanitize_size (GdkWindow *window, gint *width, gint *height)
if ((*width == -1) && (*height == -1))
{
set_bg = GDK_IS_WINDOW (window);
gdk_drawable_get_size (window, width, height);
drawable_get_size (window, width, height);
}
else if (*width == -1)
{
gdk_drawable_get_size (window, width, NULL);
drawable_get_size (window, width, NULL);
}
else if (*height == -1)
{
gdk_drawable_get_size (window, NULL, height);
drawable_get_size (window, NULL, height);
}
return set_bg;