From 62cb3cd8a1e15670c0f9dab2782945db07f42da8 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Fri, 12 Jul 2002 20:27:44 +0000 Subject: [PATCH] Tried to fix update/refresh again. The code erronously cleared the updated area if the area to be cleared was empty (such as after a call to Refresh(FALSE)). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16157 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/window.cpp | 27 +++++++-------------------- src/gtk1/window.cpp | 27 +++++++-------------------- 2 files changed, 14 insertions(+), 40 deletions(-) diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index 9f4d119eef..d3dac9b822 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -518,7 +518,7 @@ static int gtk_window_expose_callback( GtkWidget *widget, gdk_event->area.height ); // Actual redrawing takes place in idle time. - win->GtkUpdate(); + // win->GtkUpdate(); #ifdef __WXGTK20__ @@ -611,20 +611,12 @@ static void gtk_window_draw_callback( GtkWidget *widget, (char *)"base", 0, 0, -1, -1); } - - - if (!(GTK_WIDGET_APP_PAINTABLE (widget)) && - (pizza->clear_on_draw)) - { - gdk_window_clear_area( pizza->bin_window, - rect->x, rect->y, rect->width, rect->height); - } #endif + win->m_clearRegion.Union( rect->x, rect->y, rect->width, rect->height ); win->GetUpdateRegion().Union( rect->x, rect->y, rect->width, rect->height ); - // Actual redrawing takes place in idle time. - + // Update immediately, not in idle time. win->GtkUpdate(); #ifndef __WXUNIVERSAL__ @@ -3455,16 +3447,11 @@ void wxWindowGTK::GtkSendPaintEvents() else // if (!m_clearRegion.IsEmpty()) // always send an erase event { - // If the clear region is empty, and the update region isn't, - // then we're going to clear more than we repaint, - // so let's make sure the two regions are in sync. - if (m_clearRegion.IsEmpty() && !m_updateRegion.IsEmpty()) - { - m_clearRegion = m_updateRegion ; - } - wxWindowDC dc( (wxWindow*)this ); - dc.SetClippingRegion( m_clearRegion ); + if (m_clearRegion.IsEmpty()) + dc.SetClippingRegion( m_updateRegion ); + else + dc.SetClippingRegion( m_clearRegion ); wxEraseEvent erase_event( GetId(), &dc ); erase_event.SetEventObject( this ); diff --git a/src/gtk1/window.cpp b/src/gtk1/window.cpp index 9f4d119eef..d3dac9b822 100644 --- a/src/gtk1/window.cpp +++ b/src/gtk1/window.cpp @@ -518,7 +518,7 @@ static int gtk_window_expose_callback( GtkWidget *widget, gdk_event->area.height ); // Actual redrawing takes place in idle time. - win->GtkUpdate(); + // win->GtkUpdate(); #ifdef __WXGTK20__ @@ -611,20 +611,12 @@ static void gtk_window_draw_callback( GtkWidget *widget, (char *)"base", 0, 0, -1, -1); } - - - if (!(GTK_WIDGET_APP_PAINTABLE (widget)) && - (pizza->clear_on_draw)) - { - gdk_window_clear_area( pizza->bin_window, - rect->x, rect->y, rect->width, rect->height); - } #endif + win->m_clearRegion.Union( rect->x, rect->y, rect->width, rect->height ); win->GetUpdateRegion().Union( rect->x, rect->y, rect->width, rect->height ); - // Actual redrawing takes place in idle time. - + // Update immediately, not in idle time. win->GtkUpdate(); #ifndef __WXUNIVERSAL__ @@ -3455,16 +3447,11 @@ void wxWindowGTK::GtkSendPaintEvents() else // if (!m_clearRegion.IsEmpty()) // always send an erase event { - // If the clear region is empty, and the update region isn't, - // then we're going to clear more than we repaint, - // so let's make sure the two regions are in sync. - if (m_clearRegion.IsEmpty() && !m_updateRegion.IsEmpty()) - { - m_clearRegion = m_updateRegion ; - } - wxWindowDC dc( (wxWindow*)this ); - dc.SetClippingRegion( m_clearRegion ); + if (m_clearRegion.IsEmpty()) + dc.SetClippingRegion( m_updateRegion ); + else + dc.SetClippingRegion( m_clearRegion ); wxEraseEvent erase_event( GetId(), &dc ); erase_event.SetEventObject( this ); -- 2.45.2