changeset 50130:66a7f2850b56

Clear frame didn't redraw scrollbars, fixed that.
author Jan Djärv <jan.h.d@swipnet.se>
date Fri, 14 Mar 2003 19:13:17 +0000
parents d0142038feaa
children c078950f7aa6
files src/ChangeLog src/gtkutil.c src/xterm.c
diffstat 3 files changed, 27 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Fri Mar 14 18:34:18 2003 +0000
+++ b/src/ChangeLog	Fri Mar 14 19:13:17 2003 +0000
@@ -1,5 +1,7 @@
 2003-03-14  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>
 
+	* xterm.c (x_clear_frame): Call xg_frame_cleared for GTK.
+
 	* gtkutil.c (struct xg_last_sb_pos): New structure.
 	(handle_fixed_child): New function.
 	(xg_resize_widgets): Call handle_fixed_child on all scroll bar widgets
@@ -11,6 +13,7 @@
 	and force a redraw on the scroll bar.
 	(xg_set_toolkit_scroll_bar_thumb): Do not change/redraw scroll bar
 	if xg_last_sb_pos shows the positions are up to date.
+	(xg_frame_cleared): New function.
 
 2003-03-13  Kenichi Handa  <handa@m17n.org>
 
--- a/src/gtkutil.c	Fri Mar 14 18:34:18 2003 +0000
+++ b/src/gtkutil.c	Fri Mar 14 19:13:17 2003 +0000
@@ -316,6 +316,24 @@
     }
 }
 
+/* This gets called after the frame F has been cleared.  Since that is
+   done with X calls, we need to redraw GTK widget (scroll bars).  */
+void
+xg_frame_cleared (f)
+     FRAME_PTR f;
+{
+  GtkWidget *wfixed = f->output_data.x->edit_widget;
+
+  if (wfixed)
+    {
+      gtk_container_foreach (GTK_CONTAINER (wfixed),
+                             (GtkCallback) handle_fixed_child,
+                             NULL);
+      gtk_container_set_reallocate_redraws (GTK_CONTAINER (wfixed), TRUE);
+      gdk_window_process_all_updates ();
+    }
+}
+
 /* Function to handle resize of our widgets.  Since Emacs has some layouts
    that does not fit well with GTK standard containers, we do most layout
    manually.
@@ -346,12 +364,7 @@
 
       gtk_widget_size_allocate (x->edit_widget, &all);
 
-      gtk_container_foreach (GTK_CONTAINER (x->edit_widget),
-                             (GtkCallback) handle_fixed_child,
-                             NULL);
-      gtk_container_set_reallocate_redraws (GTK_CONTAINER (x->edit_widget),
-                                            TRUE);
-      gdk_window_process_all_updates ();
+      xg_frame_cleared (f);
 
       change_frame_size (f, rows, columns, 0, 1, 0);
       SET_FRAME_GARBAGED (f);
--- a/src/xterm.c	Fri Mar 14 18:34:18 2003 +0000
+++ b/src/xterm.c	Fri Mar 14 19:13:17 2003 +0000
@@ -5343,6 +5343,11 @@
   x_scroll_bar_clear (f);
 
   XFlush (FRAME_X_DISPLAY (f));
+
+#ifdef USE_GTK
+  xg_frame_cleared (f);
+#endif
+
   UNBLOCK_INPUT;
 }