diff src/gtk-xemacs.c @ 2195:23d90a805259

[xemacs-hg @ 2004-07-31 12:03:05 by malcolmp] Fix cases where GTK scrollbars are left in the middle of a frame.
author malcolmp
date Sat, 31 Jul 2004 12:03:05 +0000
parents 95fee4a1420e
children 04bc9d2f42c7
line wrap: on
line diff
--- a/src/gtk-xemacs.c	Fri Jul 30 21:50:23 2004 +0000
+++ b/src/gtk-xemacs.c	Sat Jul 31 12:03:05 2004 +0000
@@ -342,8 +342,10 @@
 {
     GtkXEmacs *x = GTK_XEMACS (widget);
     struct frame *f = GTK_XEMACS_FRAME (x);
-    redisplay_redraw_exposed_area (f, area->x, area->y, area->width,
-				   area->height);
+
+    if (GTK_WIDGET_DRAWABLE (widget))
+      redisplay_redraw_exposed_area (f, area->x, area->y, area->width,
+				     area->height);
 }
 
 static void
@@ -359,32 +361,35 @@
        gtk_fixed_paint() directly, which clears the background window,
        which causes A LOT of flashing. */
 
-    gtk_xemacs_paint (widget, area);
+  if (GTK_WIDGET_DRAWABLE (widget))
+    {
+      gtk_xemacs_paint (widget, area);
 
-    children = fixed->children;
+      children = fixed->children;
 
-    while (children)
-      {
-	child = (GtkFixedChild*) children->data;
-	children = children->next;
-	/* #### This is what causes the scrollbar flickering!
-	   Evidently the scrollbars pretty much take care of drawing
-	   themselves in most cases.  Then we come along and tell them
-	   to redraw again!
+      while (children)
+	{
+	  child = (GtkFixedChild*) children->data;
+	  children = children->next;
+	  /* #### This is what causes the scrollbar flickering!
+	     Evidently the scrollbars pretty much take care of drawing
+	     themselves in most cases.  Then we come along and tell them
+	     to redraw again!
 
-	   But if we just leave it out, then they do not get drawn
-	   correctly the first time!
+	     But if we just leave it out, then they do not get drawn
+	     correctly the first time!
 
-	   Scrollbar flickering has been greatly helped by the
-	   optimizations in scrollbar-gtk.c /
-	   gtk_update_scrollbar_instance_status (), so this is not that
-	   big a deal anymore.
-	*/
-	if (gtk_widget_intersect (child->widget, area, &child_area))
-	  {
-	    gtk_widget_draw (child->widget, &child_area);
-	  }
-      }
+	     Scrollbar flickering has been greatly helped by the
+	     optimizations in scrollbar-gtk.c /
+	     gtk_update_scrollbar_instance_status (), so this is not that
+	     big a deal anymore.
+	  */
+	  if (gtk_widget_intersect (child->widget, area, &child_area))
+	    {
+	      gtk_widget_draw (child->widget, &child_area);
+	    }
+	}
+    }
 }
 
 static gint
@@ -394,14 +399,17 @@
     struct frame *f = GTK_XEMACS_FRAME (x);
     GdkRectangle *a = &event->area;
 
-    /* This takes care of drawing the scrollbars, etc */
-    parent_class->expose_event (widget, event);
+  if (GTK_WIDGET_DRAWABLE (widget))
+    {
+      /* This takes care of drawing the scrollbars, etc */
+      parent_class->expose_event (widget, event);
 
-    /* Now draw the actual frame data */
-    if (!check_for_ignored_expose (f, a->x, a->y, a->width, a->height) &&
-	!find_matching_subwindow (f, a->x, a->y, a->width, a->height))
-      redisplay_redraw_exposed_area (f, a->x, a->y, a->width, a->height);
-    return (TRUE);
+      /* Now draw the actual frame data */
+      if (!check_for_ignored_expose (f, a->x, a->y, a->width, a->height) &&
+	  !find_matching_subwindow (f, a->x, a->y, a->width, a->height))
+	redisplay_redraw_exposed_area (f, a->x, a->y, a->width, a->height);
+      return (TRUE);
+    }
 }
 
 Lisp_Object