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_width = alloc->width;
|
||||||
win->m_height = alloc->height;
|
win->m_height = alloc->height;
|
||||||
win->m_queuedFullRedraw = TRUE;
|
|
||||||
win->GtkUpdateSize();
|
win->GtkUpdateSize();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -703,18 +703,23 @@ static int gtk_window_expose_callback( GtkWidget *widget, GdkEventExpose *gdk_ev
|
|||||||
gdk_event->area.width,
|
gdk_event->area.width,
|
||||||
gdk_event->area.height );
|
gdk_event->area.height );
|
||||||
|
|
||||||
if (gdk_event->count == 0)
|
if (gdk_event->count == 0)
|
||||||
{
|
{
|
||||||
wxEraseEvent eevent( win->GetId() );
|
win->m_clipPaintRegion = TRUE;
|
||||||
eevent.SetEventObject( win );
|
|
||||||
win->GetEventHandler()->ProcessEvent(eevent);
|
wxEraseEvent eevent( win->GetId() );
|
||||||
|
eevent.SetEventObject( win );
|
||||||
|
win->GetEventHandler()->ProcessEvent(eevent);
|
||||||
|
|
||||||
wxPaintEvent event( win->GetId() );
|
if (!win->m_isFrame) printf( "OnExpose\n" );
|
||||||
event.SetEventObject( win );
|
|
||||||
win->GetEventHandler()->ProcessEvent( event );
|
|
||||||
|
|
||||||
win->GetUpdateRegion().Clear();
|
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
|
/* The following code will result in all window-less widgets
|
||||||
being redrawn if the wxWindows class is given a chance to
|
being redrawn if the wxWindows class is given a chance to
|
||||||
@@ -792,45 +797,52 @@ 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);
|
GtkPizza *pizza = GTK_PIZZA (widget);
|
||||||
|
|
||||||
if (!(GTK_WIDGET_APP_PAINTABLE (widget)) &&
|
if (!(GTK_WIDGET_APP_PAINTABLE (widget)) &&
|
||||||
(pizza->clear_on_draw))
|
(pizza->clear_on_draw))
|
||||||
{
|
{
|
||||||
gdk_window_clear_area( pizza->bin_window,
|
gdk_window_clear_area( pizza->bin_window,
|
||||||
rect->x, rect->y, rect->width, rect->height);
|
rect->x, rect->y, rect->width, rect->height);
|
||||||
}
|
}
|
||||||
|
|
||||||
win->GetUpdateRegion().Union( rect->x, rect->y, rect->width, rect->height );
|
win->GetUpdateRegion().Union( rect->x, rect->y, rect->width, rect->height );
|
||||||
|
|
||||||
win->m_clipPaintRegion = TRUE;
|
win->m_clipPaintRegion = TRUE;
|
||||||
|
|
||||||
wxClientDC dc(win);
|
wxEraseEvent eevent( win->GetId() );
|
||||||
wxEraseEvent eevent( win->GetId(), &dc );
|
eevent.SetEventObject( win );
|
||||||
eevent.SetEventObject( win );
|
win->GetEventHandler()->ProcessEvent(eevent);
|
||||||
win->GetEventHandler()->ProcessEvent(eevent);
|
|
||||||
|
|
||||||
wxPaintEvent event( win->GetId() );
|
if (!win->m_isFrame) printf( "OnDraw\n" );
|
||||||
event.SetEventObject( win );
|
|
||||||
win->GetEventHandler()->ProcessEvent( event );
|
|
||||||
|
|
||||||
win->GetUpdateRegion().Clear();
|
wxPaintEvent event( win->GetId() );
|
||||||
|
event.SetEventObject( win );
|
||||||
|
win->GetEventHandler()->ProcessEvent( event );
|
||||||
|
|
||||||
win->m_clipPaintRegion = FALSE;
|
win->GetUpdateRegion().Clear();
|
||||||
|
|
||||||
|
win->m_clipPaintRegion = FALSE;
|
||||||
|
|
||||||
GList *children = pizza->children;
|
GList *children = pizza->children;
|
||||||
while (children)
|
while (children)
|
||||||
|
{
|
||||||
|
GtkPizzaChild *child = (GtkPizzaChild*) children->data;
|
||||||
|
children = children->next;
|
||||||
|
|
||||||
|
GdkRectangle child_area;
|
||||||
|
if (gtk_widget_intersect (child->widget, rect, &child_area))
|
||||||
{
|
{
|
||||||
GtkPizzaChild *child = (GtkPizzaChild*) children->data;
|
gtk_widget_draw (child->widget, &child_area /* (GdkRectangle*) NULL*/ );
|
||||||
children = children->next;
|
|
||||||
|
|
||||||
GdkRectangle child_area;
|
|
||||||
if (gtk_widget_intersect (child->widget, rect, &child_area))
|
|
||||||
{
|
|
||||||
gtk_widget_draw (child->widget, &child_area /* (GdkRectangle*) NULL*/ );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@@ -2383,14 +2395,17 @@ void wxWindow::PostCreation()
|
|||||||
|
|
||||||
gtk_pizza_set_external( GTK_PIZZA(m_wxwindow), TRUE );
|
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_connect( GTK_OBJECT(m_wxwindow), "expose_event",
|
||||||
GTK_SIGNAL_FUNC(gtk_window_expose_callback), (gpointer)this );
|
GTK_SIGNAL_FUNC(gtk_window_expose_callback), (gpointer)this );
|
||||||
|
|
||||||
gtk_signal_connect( GTK_OBJECT(m_wxwindow), "draw",
|
gtk_signal_connect( GTK_OBJECT(m_wxwindow), "draw",
|
||||||
GTK_SIGNAL_FUNC(gtk_window_draw_callback), (gpointer)this );
|
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)
|
#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_width = alloc->width;
|
||||||
win->m_height = alloc->height;
|
win->m_height = alloc->height;
|
||||||
win->m_queuedFullRedraw = TRUE;
|
|
||||||
win->GtkUpdateSize();
|
win->GtkUpdateSize();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -703,18 +703,23 @@ static int gtk_window_expose_callback( GtkWidget *widget, GdkEventExpose *gdk_ev
|
|||||||
gdk_event->area.width,
|
gdk_event->area.width,
|
||||||
gdk_event->area.height );
|
gdk_event->area.height );
|
||||||
|
|
||||||
if (gdk_event->count == 0)
|
if (gdk_event->count == 0)
|
||||||
{
|
{
|
||||||
wxEraseEvent eevent( win->GetId() );
|
win->m_clipPaintRegion = TRUE;
|
||||||
eevent.SetEventObject( win );
|
|
||||||
win->GetEventHandler()->ProcessEvent(eevent);
|
wxEraseEvent eevent( win->GetId() );
|
||||||
|
eevent.SetEventObject( win );
|
||||||
|
win->GetEventHandler()->ProcessEvent(eevent);
|
||||||
|
|
||||||
wxPaintEvent event( win->GetId() );
|
if (!win->m_isFrame) printf( "OnExpose\n" );
|
||||||
event.SetEventObject( win );
|
|
||||||
win->GetEventHandler()->ProcessEvent( event );
|
|
||||||
|
|
||||||
win->GetUpdateRegion().Clear();
|
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
|
/* The following code will result in all window-less widgets
|
||||||
being redrawn if the wxWindows class is given a chance to
|
being redrawn if the wxWindows class is given a chance to
|
||||||
@@ -792,45 +797,52 @@ 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);
|
GtkPizza *pizza = GTK_PIZZA (widget);
|
||||||
|
|
||||||
if (!(GTK_WIDGET_APP_PAINTABLE (widget)) &&
|
if (!(GTK_WIDGET_APP_PAINTABLE (widget)) &&
|
||||||
(pizza->clear_on_draw))
|
(pizza->clear_on_draw))
|
||||||
{
|
{
|
||||||
gdk_window_clear_area( pizza->bin_window,
|
gdk_window_clear_area( pizza->bin_window,
|
||||||
rect->x, rect->y, rect->width, rect->height);
|
rect->x, rect->y, rect->width, rect->height);
|
||||||
}
|
}
|
||||||
|
|
||||||
win->GetUpdateRegion().Union( rect->x, rect->y, rect->width, rect->height );
|
win->GetUpdateRegion().Union( rect->x, rect->y, rect->width, rect->height );
|
||||||
|
|
||||||
win->m_clipPaintRegion = TRUE;
|
win->m_clipPaintRegion = TRUE;
|
||||||
|
|
||||||
wxClientDC dc(win);
|
wxEraseEvent eevent( win->GetId() );
|
||||||
wxEraseEvent eevent( win->GetId(), &dc );
|
eevent.SetEventObject( win );
|
||||||
eevent.SetEventObject( win );
|
win->GetEventHandler()->ProcessEvent(eevent);
|
||||||
win->GetEventHandler()->ProcessEvent(eevent);
|
|
||||||
|
|
||||||
wxPaintEvent event( win->GetId() );
|
if (!win->m_isFrame) printf( "OnDraw\n" );
|
||||||
event.SetEventObject( win );
|
|
||||||
win->GetEventHandler()->ProcessEvent( event );
|
|
||||||
|
|
||||||
win->GetUpdateRegion().Clear();
|
wxPaintEvent event( win->GetId() );
|
||||||
|
event.SetEventObject( win );
|
||||||
|
win->GetEventHandler()->ProcessEvent( event );
|
||||||
|
|
||||||
win->m_clipPaintRegion = FALSE;
|
win->GetUpdateRegion().Clear();
|
||||||
|
|
||||||
|
win->m_clipPaintRegion = FALSE;
|
||||||
|
|
||||||
GList *children = pizza->children;
|
GList *children = pizza->children;
|
||||||
while (children)
|
while (children)
|
||||||
|
{
|
||||||
|
GtkPizzaChild *child = (GtkPizzaChild*) children->data;
|
||||||
|
children = children->next;
|
||||||
|
|
||||||
|
GdkRectangle child_area;
|
||||||
|
if (gtk_widget_intersect (child->widget, rect, &child_area))
|
||||||
{
|
{
|
||||||
GtkPizzaChild *child = (GtkPizzaChild*) children->data;
|
gtk_widget_draw (child->widget, &child_area /* (GdkRectangle*) NULL*/ );
|
||||||
children = children->next;
|
|
||||||
|
|
||||||
GdkRectangle child_area;
|
|
||||||
if (gtk_widget_intersect (child->widget, rect, &child_area))
|
|
||||||
{
|
|
||||||
gtk_widget_draw (child->widget, &child_area /* (GdkRectangle*) NULL*/ );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@@ -2383,14 +2395,17 @@ void wxWindow::PostCreation()
|
|||||||
|
|
||||||
gtk_pizza_set_external( GTK_PIZZA(m_wxwindow), TRUE );
|
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_connect( GTK_OBJECT(m_wxwindow), "expose_event",
|
||||||
GTK_SIGNAL_FUNC(gtk_window_expose_callback), (gpointer)this );
|
GTK_SIGNAL_FUNC(gtk_window_expose_callback), (gpointer)this );
|
||||||
|
|
||||||
gtk_signal_connect( GTK_OBJECT(m_wxwindow), "draw",
|
gtk_signal_connect( GTK_OBJECT(m_wxwindow), "draw",
|
||||||
GTK_SIGNAL_FUNC(gtk_window_draw_callback), (gpointer)this );
|
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)
|
#if (GTK_MINOR_VERSION > 0)
|
||||||
|
Reference in New Issue
Block a user