diff --git a/src/wbc-gtk.c b/src/wbc-gtk.c
index 052be7f..acc88fe 100644
--- a/src/wbc-gtk.c
+++ b/src/wbc-gtk.c
@@ -2484,8 +2484,8 @@ show_gui (WBCGtk *wbcg)
 		   wbv != NULL &&
 		   (wbv->preferred_width > 0 || wbv->preferred_height > 0)) {
 		/* Set grid size to preferred width */
-		int pwidth = wbv->preferred_width;
-		int pheight = wbv->preferred_height;
+		int pwidth = MIN (wbv->preferred_width, sx);
+		int pheight = MIN (wbv->preferred_height, sy);
 		GtkRequisition requisition;
 
 		pwidth = pwidth > 0 ? pwidth : -1;
