Added support for the wxNO_FULL_PAINT_ON_REDRAW style,
Minor flicker reduction (when not using abovementioned flag). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@8459 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -126,7 +126,6 @@ static void gtk_frame_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation*
|
||||
|
||||
win->m_width = alloc->width;
|
||||
win->m_height = alloc->height;
|
||||
win->m_queuedFullRedraw = TRUE;
|
||||
win->GtkUpdateSize();
|
||||
}
|
||||
}
|
||||
|
@@ -705,15 +705,20 @@ 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);
|
||||
|
||||
if (!win->m_isFrame) printf( "OnExpose\n" );
|
||||
|
||||
wxPaintEvent event( win->GetId() );
|
||||
event.SetEventObject( win );
|
||||
win->GetEventHandler()->ProcessEvent( event );
|
||||
|
||||
win->GetUpdateRegion().Clear();
|
||||
win->m_clipPaintRegion = FALSE;
|
||||
}
|
||||
|
||||
/* The following code will result in all window-less widgets
|
||||
@@ -792,6 +797,13 @@ static void gtk_window_draw_callback( GtkWidget *widget, GdkRectangle *rect, wxW
|
||||
}
|
||||
*/
|
||||
|
||||
if ((win->HasFlag(wxNO_FULL_REPAINT_ON_RESIZE)) &&
|
||||
(win->GetChildren().GetCount() == 0))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
GtkPizza *pizza = GTK_PIZZA (widget);
|
||||
|
||||
if (!(GTK_WIDGET_APP_PAINTABLE (widget)) &&
|
||||
@@ -805,11 +817,12 @@ static void gtk_window_draw_callback( GtkWidget *widget, GdkRectangle *rect, wxW
|
||||
|
||||
win->m_clipPaintRegion = TRUE;
|
||||
|
||||
wxClientDC dc(win);
|
||||
wxEraseEvent eevent( win->GetId(), &dc );
|
||||
wxEraseEvent eevent( win->GetId() );
|
||||
eevent.SetEventObject( win );
|
||||
win->GetEventHandler()->ProcessEvent(eevent);
|
||||
|
||||
if (!win->m_isFrame) printf( "OnDraw\n" );
|
||||
|
||||
wxPaintEvent event( win->GetId() );
|
||||
event.SetEventObject( win );
|
||||
win->GetEventHandler()->ProcessEvent( event );
|
||||
@@ -818,7 +831,6 @@ static void gtk_window_draw_callback( GtkWidget *widget, GdkRectangle *rect, wxW
|
||||
|
||||
win->m_clipPaintRegion = FALSE;
|
||||
|
||||
|
||||
GList *children = pizza->children;
|
||||
while (children)
|
||||
{
|
||||
@@ -2383,14 +2395,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)
|
||||
|
@@ -126,7 +126,6 @@ static void gtk_frame_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation*
|
||||
|
||||
win->m_width = alloc->width;
|
||||
win->m_height = alloc->height;
|
||||
win->m_queuedFullRedraw = TRUE;
|
||||
win->GtkUpdateSize();
|
||||
}
|
||||
}
|
||||
|
@@ -705,15 +705,20 @@ 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);
|
||||
|
||||
if (!win->m_isFrame) printf( "OnExpose\n" );
|
||||
|
||||
wxPaintEvent event( win->GetId() );
|
||||
event.SetEventObject( win );
|
||||
win->GetEventHandler()->ProcessEvent( event );
|
||||
|
||||
win->GetUpdateRegion().Clear();
|
||||
win->m_clipPaintRegion = FALSE;
|
||||
}
|
||||
|
||||
/* The following code will result in all window-less widgets
|
||||
@@ -792,6 +797,13 @@ static void gtk_window_draw_callback( GtkWidget *widget, GdkRectangle *rect, wxW
|
||||
}
|
||||
*/
|
||||
|
||||
if ((win->HasFlag(wxNO_FULL_REPAINT_ON_RESIZE)) &&
|
||||
(win->GetChildren().GetCount() == 0))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
GtkPizza *pizza = GTK_PIZZA (widget);
|
||||
|
||||
if (!(GTK_WIDGET_APP_PAINTABLE (widget)) &&
|
||||
@@ -805,11 +817,12 @@ static void gtk_window_draw_callback( GtkWidget *widget, GdkRectangle *rect, wxW
|
||||
|
||||
win->m_clipPaintRegion = TRUE;
|
||||
|
||||
wxClientDC dc(win);
|
||||
wxEraseEvent eevent( win->GetId(), &dc );
|
||||
wxEraseEvent eevent( win->GetId() );
|
||||
eevent.SetEventObject( win );
|
||||
win->GetEventHandler()->ProcessEvent(eevent);
|
||||
|
||||
if (!win->m_isFrame) printf( "OnDraw\n" );
|
||||
|
||||
wxPaintEvent event( win->GetId() );
|
||||
event.SetEventObject( win );
|
||||
win->GetEventHandler()->ProcessEvent( event );
|
||||
@@ -818,7 +831,6 @@ static void gtk_window_draw_callback( GtkWidget *widget, GdkRectangle *rect, wxW
|
||||
|
||||
win->m_clipPaintRegion = FALSE;
|
||||
|
||||
|
||||
GList *children = pizza->children;
|
||||
while (children)
|
||||
{
|
||||
@@ -2383,14 +2395,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)
|
||||
|
Reference in New Issue
Block a user