changeset 50333:60da21fd968b

* gtkutil.c (xg_tool_bar_item_expose_callback): Reduce size of area to be redrawn for better performance.
author Jan Djärv <jan.h.d@swipnet.se>
date Fri, 28 Mar 2003 20:33:01 +0000
parents 90e7d2037d2a
children 04c0558bea4f
files src/ChangeLog src/gtkutil.c
diffstat 2 files changed, 18 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Fri Mar 28 17:49:49 2003 +0000
+++ b/src/ChangeLog	Fri Mar 28 20:33:01 2003 +0000
@@ -1,3 +1,8 @@
+2003-03-28  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>
+
+	* gtkutil.c (xg_tool_bar_item_expose_callback): Reduce size
+	of area to be redrawn for better performance.
+
 2003-03-28  Stefan Monnier  <monnier@cs.yale.edu>
 
 	* xterm.c (take_vertical_position_into_account): Remove.
--- a/src/gtkutil.c	Fri Mar 28 17:49:49 2003 +0000
+++ b/src/gtkutil.c	Fri Mar 28 20:33:01 2003 +0000
@@ -1383,8 +1383,6 @@
                     G_CALLBACK (tearoff_remove), menu);
 }
 
-int xg_debug = 0;
-
 /* Create a menu item widget, and connect the callbacks.
    ITEM decribes the menu item.
    F is the frame the created menu belongs to.
@@ -2949,8 +2947,19 @@
      GdkEventExpose *event;
      gpointer client_data;
 {
-  event->area.x = event->area.y = 0;
-  event->area.width = event->area.height = 1000;
+  gint width, height;
+
+  gdk_drawable_get_size (event->window, &width, &height);
+
+  event->area.x -= width > event->area.width ? width-event->area.width : 0;
+  event->area.y -= height > event->area.height ? height-event->area.height : 0;
+
+  event->area.x = max(0, event->area.x);
+  event->area.y = max(0, event->area.y);
+  
+  event->area.width = max (width, event->area.width);
+  event->area.height = max (height, event->area.height);
+  
   return FALSE;
 }