From b676f3563e734c9d2fd265398f5d23d8ae66b199 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20Dj=C3=A4rv?= Date: Fri, 28 Mar 2003 20:33:01 +0000 Subject: [PATCH] * gtkutil.c (xg_tool_bar_item_expose_callback): Reduce size of area to be redrawn for better performance. --- src/ChangeLog | 5 +++++ src/gtkutil.c | 17 +++++++++++++---- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index f31d177a49a..f79e1633722 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2003-03-28 Jan Dj,Ad(Brv + + * gtkutil.c (xg_tool_bar_item_expose_callback): Reduce size + of area to be redrawn for better performance. + 2003-03-28 Stefan Monnier * xterm.c (take_vertical_position_into_account): Remove. diff --git a/src/gtkutil.c b/src/gtkutil.c index 22da5eea854..126cfc73cab 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -1383,8 +1383,6 @@ xg_keep_popup (menu, submenu) 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 @@ xg_tool_bar_item_expose_callback (w, event, client_data) 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; } -- 2.39.2