forked from AuroraMiddleware/gtk
Check sanity of toplevel sizes
Emit a warning when sizes returned in GdkToplevelSize don't look sane. This is the case in the failing reftest.
This commit is contained in:
parent
658719a205
commit
a95012caa3
@ -99,6 +99,7 @@ gdk_toplevel_notify_compute_size (GdkToplevel *toplevel,
|
||||
GdkToplevelSize *size)
|
||||
{
|
||||
g_signal_emit (toplevel, signals[COMPUTE_SIZE], 0, size);
|
||||
gdk_toplevel_size_validate (size);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -117,3 +117,19 @@ gdk_toplevel_size_set_min_size (GdkToplevelSize *size,
|
||||
size->min_width = min_width;
|
||||
size->min_height = min_height;
|
||||
}
|
||||
|
||||
void
|
||||
gdk_toplevel_size_validate (GdkToplevelSize *size)
|
||||
{
|
||||
if (size->min_width > size->bounds_width ||
|
||||
size->min_height > size->bounds_height)
|
||||
g_warning ("GdkToplevelSize: min_size exceeds bounds");
|
||||
|
||||
if (size->width > size->bounds_width ||
|
||||
size->height > size->bounds_height)
|
||||
g_warning ("GdkToplevelSize: size exceeds bounds");
|
||||
|
||||
if (size->min_width > size->width ||
|
||||
size->min_height > size->height)
|
||||
g_warning ("GdkToplevelSize: min_size exceeds size");
|
||||
}
|
||||
|
@ -36,4 +36,6 @@ void gdk_toplevel_size_init (GdkToplevelSize *size,
|
||||
int bounds_width,
|
||||
int bounds_height);
|
||||
|
||||
void gdk_toplevel_size_validate (GdkToplevelSize *size);
|
||||
|
||||
#endif /* __GDK_TOPLEVEL_SIZE_PRIVATE_H__ */
|
||||
|
Loading…
Reference in New Issue
Block a user