From e22454beda8a13cb1b9b8fb739deb2b6e6c973a0 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Sun, 26 Nov 2000 10:20:11 +0000 Subject: [PATCH] Ported stable-tree refresh code to devel tree. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8828 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/window.cpp | 45 +++++++++++++++++++++++++++------------------ src/gtk1/window.cpp | 45 +++++++++++++++++++++++++++------------------ 2 files changed, 54 insertions(+), 36 deletions(-) diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index a85d6ab17b..937692b051 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -700,6 +700,8 @@ static int gtk_window_expose_callback( GtkWidget *widget, GdkEventExpose *gdk_ev if (gdk_event->count == 0) { + win->m_clipPaintRegion = TRUE; + wxEraseEvent eevent( win->GetId() ); eevent.SetEventObject( win ); win->GetEventHandler()->ProcessEvent(eevent); @@ -709,6 +711,8 @@ static int gtk_window_expose_callback( GtkWidget *widget, GdkEventExpose *gdk_ev win->GetEventHandler()->ProcessEvent( event ); win->GetUpdateRegion().Clear(); + + win->m_clipPaintRegion = FALSE; } /* The following code will result in all window-less widgets @@ -774,9 +778,11 @@ static void gtk_window_draw_callback( GtkWidget *widget, GdkRectangle *rect, wxW if (g_isIdle) wxapp_install_idle_handler(); - // this is supposed to take care of extra (and unneeded) frame repaints - if (win->GetChildren().GetCount() == 0) - return; + if ((win->HasFlag(wxNO_FULL_REPAINT_ON_RESIZE)) && + (win->GetChildren().GetCount() == 0)) + { + return; + } /* if (win->GetName() == wxT("panel")) @@ -817,22 +823,22 @@ static void gtk_window_draw_callback( GtkWidget *widget, GdkRectangle *rect, wxW win->m_clipPaintRegion = TRUE; - wxEraseEvent eevent( win->GetId() ); - eevent.SetEventObject( win ); - win->GetEventHandler()->ProcessEvent(eevent); + wxEraseEvent eevent( win->GetId() ); + eevent.SetEventObject( win ); + win->GetEventHandler()->ProcessEvent(eevent); - wxPaintEvent event( win->GetId() ); - event.SetEventObject( win ); - win->GetEventHandler()->ProcessEvent( event ); + wxPaintEvent event( win->GetId() ); + event.SetEventObject( win ); + win->GetEventHandler()->ProcessEvent( event ); - win->GetUpdateRegion().Clear(); + win->GetUpdateRegion().Clear(); - win->m_clipPaintRegion = FALSE; + win->m_clipPaintRegion = FALSE; - GList *children = pizza->children; - while (children) - { + GList *children = pizza->children; + while (children) + { GtkPizzaChild *child = (GtkPizzaChild*) children->data; children = children->next; @@ -841,7 +847,7 @@ static void gtk_window_draw_callback( GtkWidget *widget, GdkRectangle *rect, wxW { gtk_widget_draw (child->widget, &child_area /* (GdkRectangle*) NULL*/ ); } - } + } } //----------------------------------------------------------------------------- @@ -2394,14 +2400,17 @@ void wxWindow::PostCreation() gtk_pizza_set_external( GTK_PIZZA(m_wxwindow), TRUE ); - gtk_signal_connect( GTK_OBJECT(m_wxwindow), "event", - GTK_SIGNAL_FUNC(gtk_window_event_event_callback), (gpointer)this ); - gtk_signal_connect( GTK_OBJECT(m_wxwindow), "expose_event", GTK_SIGNAL_FUNC(gtk_window_expose_callback), (gpointer)this ); gtk_signal_connect( GTK_OBJECT(m_wxwindow), "draw", GTK_SIGNAL_FUNC(gtk_window_draw_callback), (gpointer)this ); + + if (HasFlag(wxNO_FULL_REPAINT_ON_RESIZE)) + { + gtk_signal_connect( GTK_OBJECT(m_wxwindow), "event", + GTK_SIGNAL_FUNC(gtk_window_event_event_callback), (gpointer)this ); + } } #if (GTK_MINOR_VERSION > 0) diff --git a/src/gtk1/window.cpp b/src/gtk1/window.cpp index a85d6ab17b..937692b051 100644 --- a/src/gtk1/window.cpp +++ b/src/gtk1/window.cpp @@ -700,6 +700,8 @@ static int gtk_window_expose_callback( GtkWidget *widget, GdkEventExpose *gdk_ev if (gdk_event->count == 0) { + win->m_clipPaintRegion = TRUE; + wxEraseEvent eevent( win->GetId() ); eevent.SetEventObject( win ); win->GetEventHandler()->ProcessEvent(eevent); @@ -709,6 +711,8 @@ static int gtk_window_expose_callback( GtkWidget *widget, GdkEventExpose *gdk_ev win->GetEventHandler()->ProcessEvent( event ); win->GetUpdateRegion().Clear(); + + win->m_clipPaintRegion = FALSE; } /* The following code will result in all window-less widgets @@ -774,9 +778,11 @@ static void gtk_window_draw_callback( GtkWidget *widget, GdkRectangle *rect, wxW if (g_isIdle) wxapp_install_idle_handler(); - // this is supposed to take care of extra (and unneeded) frame repaints - if (win->GetChildren().GetCount() == 0) - return; + if ((win->HasFlag(wxNO_FULL_REPAINT_ON_RESIZE)) && + (win->GetChildren().GetCount() == 0)) + { + return; + } /* if (win->GetName() == wxT("panel")) @@ -817,22 +823,22 @@ static void gtk_window_draw_callback( GtkWidget *widget, GdkRectangle *rect, wxW win->m_clipPaintRegion = TRUE; - wxEraseEvent eevent( win->GetId() ); - eevent.SetEventObject( win ); - win->GetEventHandler()->ProcessEvent(eevent); + wxEraseEvent eevent( win->GetId() ); + eevent.SetEventObject( win ); + win->GetEventHandler()->ProcessEvent(eevent); - wxPaintEvent event( win->GetId() ); - event.SetEventObject( win ); - win->GetEventHandler()->ProcessEvent( event ); + wxPaintEvent event( win->GetId() ); + event.SetEventObject( win ); + win->GetEventHandler()->ProcessEvent( event ); - win->GetUpdateRegion().Clear(); + win->GetUpdateRegion().Clear(); - win->m_clipPaintRegion = FALSE; + win->m_clipPaintRegion = FALSE; - GList *children = pizza->children; - while (children) - { + GList *children = pizza->children; + while (children) + { GtkPizzaChild *child = (GtkPizzaChild*) children->data; children = children->next; @@ -841,7 +847,7 @@ static void gtk_window_draw_callback( GtkWidget *widget, GdkRectangle *rect, wxW { gtk_widget_draw (child->widget, &child_area /* (GdkRectangle*) NULL*/ ); } - } + } } //----------------------------------------------------------------------------- @@ -2394,14 +2400,17 @@ void wxWindow::PostCreation() gtk_pizza_set_external( GTK_PIZZA(m_wxwindow), TRUE ); - gtk_signal_connect( GTK_OBJECT(m_wxwindow), "event", - GTK_SIGNAL_FUNC(gtk_window_event_event_callback), (gpointer)this ); - gtk_signal_connect( GTK_OBJECT(m_wxwindow), "expose_event", GTK_SIGNAL_FUNC(gtk_window_expose_callback), (gpointer)this ); gtk_signal_connect( GTK_OBJECT(m_wxwindow), "draw", GTK_SIGNAL_FUNC(gtk_window_draw_callback), (gpointer)this ); + + if (HasFlag(wxNO_FULL_REPAINT_ON_RESIZE)) + { + gtk_signal_connect( GTK_OBJECT(m_wxwindow), "event", + GTK_SIGNAL_FUNC(gtk_window_event_event_callback), (gpointer)this ); + } } #if (GTK_MINOR_VERSION > 0) -- 2.45.2