diff src/toolbar-msw.c @ 298:70ad99077275 r21-0b47

Import from CVS: tag r21-0b47
author cvs
date Mon, 13 Aug 2007 10:39:40 +0200
parents 4b85ae5eabfb
children 8626e4521993
line wrap: on
line diff
--- a/src/toolbar-msw.c	Mon Aug 13 10:38:47 2007 +0200
+++ b/src/toolbar-msw.c	Mon Aug 13 10:39:40 2007 +0200
@@ -57,6 +57,7 @@
 #endif
 #define MSWINDOWS_BUTTON_SHADOW_THICKNESS 2
 #define MSWINDOWS_BLANK_SIZE 5
+#define MSWINDOWS_MINIMUM_TOOLBAR_SIZE 8
 
 #define SET_TOOLBAR_WAS_VISIBLE_FLAG(frame, pos, flag)			\
   do {									\
@@ -153,6 +154,16 @@
 
   get_toolbar_coords (f, pos, &x, &y, &bar_width, &bar_height, &vert, 0);
 
+  /* ediff bogusly sets the height to 2 for some obscure X-specific
+     reason. This ensures that we only try and output a toolbar for
+     sensible sizes */
+  if (bar_width < MSWINDOWS_MINIMUM_TOOLBAR_SIZE
+      ||
+      bar_height < MSWINDOWS_MINIMUM_TOOLBAR_SIZE)
+    {
+      return;
+    }
+
   if (x==1)
     x=0;
 
@@ -300,7 +311,8 @@
 		      /* need to build an image list for the bitmaps */
 		      if (!ilist && !(ilist = ImageList_Create 
 				      ( bmwidth, bmheight,
-					ILC_MASK | ILC_COLOR24, 
+					(IMAGE_INSTANCE_MSWINDOWS_MASK (p) 
+					 ? ILC_MASK  : 0) | ILC_COLOR24, 
 					nbuttons, nbuttons * 2 )))
 			{
 			  xfree (button_tbl);