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:
parent
73357d22fb
commit
1bba6211a7
1 changed files with 19 additions and 3 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue