diff options
author | Xan Lopez <xlopez@igalia.com> | 2011-06-10 03:13:31 +0800 |
---|---|---|
committer | Xan Lopez <xlopez@igalia.com> | 2011-06-10 03:13:31 +0800 |
commit | d732145429c8366b98e82c08ba092a6514ef913b (patch) | |
tree | cc611e5292ea35223023527b285061600a261c77 /lib/widgets/gedit-overlay.c | |
parent | 7084eadd14a1ba9013e1cb0206a7da5c2e23e014 (diff) | |
download | gsoc2013-epiphany-d732145429c8366b98e82c08ba092a6514ef913b.tar gsoc2013-epiphany-d732145429c8366b98e82c08ba092a6514ef913b.tar.gz gsoc2013-epiphany-d732145429c8366b98e82c08ba092a6514ef913b.tar.bz2 gsoc2013-epiphany-d732145429c8366b98e82c08ba092a6514ef913b.tar.lz gsoc2013-epiphany-d732145429c8366b98e82c08ba092a6514ef913b.tar.xz gsoc2013-epiphany-d732145429c8366b98e82c08ba092a6514ef913b.tar.zst gsoc2013-epiphany-d732145429c8366b98e82c08ba092a6514ef913b.zip |
gedit-overlay: prevent underallocation warnings
This is somewhat hacky, but we'll switch to GtkOverlay soon anyway.
Diffstat (limited to 'lib/widgets/gedit-overlay.c')
-rw-r--r-- | lib/widgets/gedit-overlay.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/widgets/gedit-overlay.c b/lib/widgets/gedit-overlay.c index 29ac36810..b80c0af1c 100644 --- a/lib/widgets/gedit-overlay.c +++ b/lib/widgets/gedit-overlay.c @@ -321,8 +321,18 @@ gedit_overlay_size_allocate (GtkWidget *widget, alloc.y = 0; } - alloc.width = MIN (main_alloc.width, req.width); - alloc.height = MIN (main_alloc.height, req.height); + if (main_alloc.width < req.width || main_alloc.height < req.height) + { + GdkWindow *child_window = gtk_widget_get_window (child); + if (child_window) + gdk_window_move_resize (child_window, + alloc.x, alloc.y, + MIN (main_alloc.width, req.width), + MIN (main_alloc.height, req.height)); + } + + alloc.width = req.width; + alloc.height = req.height; gtk_widget_size_allocate (child, &alloc); } |