[epiphany] gedit-overlay: prevent underallocation warnings



commit d732145429c8366b98e82c08ba092a6514ef913b
Author: Xan Lopez <xlopez igalia com>
Date:   Thu Jun 9 21:13:31 2011 +0200

    gedit-overlay: prevent underallocation warnings
    
    This is somewhat hacky, but we'll switch to GtkOverlay soon anyway.

 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 29ac368..b80c0af 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);
 	}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]