X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3013a903c1f32c31526a5229ec341b4a2f5c42fd..da1158bb912c4aef45c07ce2de5b69ea2773f65e:/src/gtk1/window.cpp?ds=sidebyside diff --git a/src/gtk1/window.cpp b/src/gtk1/window.cpp index 9f4d119eef..c12e2fad49 100644 --- a/src/gtk1/window.cpp +++ b/src/gtk1/window.cpp @@ -54,6 +54,7 @@ #endif #include +#include #include "wx/gtk/private.h" #include @@ -518,7 +519,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 +612,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__ @@ -2699,16 +2692,14 @@ void wxWindowGTK::DoSetSize( int x, int y, int width, int height, int sizeFlags { if (x != -1) m_x = x + pizza->xoffset; if (y != -1) m_y = y + pizza->yoffset; - if (width != -1) m_width = width; - if (height != -1) m_height = height; } else { m_x = x + pizza->xoffset; m_y = y + pizza->yoffset; - m_width = width; - m_height = height; } + if (width != -1) m_width = width; + if (height != -1) m_height = height; if ((sizeFlags & wxSIZE_AUTO_WIDTH) == wxSIZE_AUTO_WIDTH) { @@ -3149,7 +3140,7 @@ void wxWindowGTK::GetTextExtent( const wxString& string, wxCHECK_RET( fontToUse.Ok(), wxT("invalid font") ); GdkFont *font = fontToUse.GetInternalFont( 1.0 ); - if (x) (*x) = gdk_string_width( font, string.mbc_str() ); + if (x) (*x) = gdk_string_width( font, wxGTK_CONV( string ) ); if (y) (*y) = font->ascent + font->descent; if (descent) (*descent) = font->descent; if (externalLeading) (*externalLeading) = 0; // ?? @@ -3421,7 +3412,8 @@ void wxWindowGTK::GtkSendPaintEvents() // Clip to paint region in wxClientDC m_clipPaintRegion = TRUE; - + +#ifndef __WXGTK20__ if (GetThemeEnabled()) { // find ancestor from which to steal background @@ -3453,24 +3445,23 @@ void wxWindowGTK::GtkSendPaintEvents() } } else - // if (!m_clearRegion.IsEmpty()) // always send an erase event +#endif +#ifdef __WXGTK20__ + if (!m_clearRegion.IsEmpty()) // Always send an erase event under GTK 1.2 +#endif { - // 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 ); if (!GetEventHandler()->ProcessEvent(erase_event)) { +#ifndef __WXGTK20__ if (!g_eraseGC) { g_eraseGC = gdk_gc_new( pizza->bin_window ); @@ -3485,6 +3476,7 @@ void wxWindowGTK::GtkSendPaintEvents() upd.GetX(), upd.GetY(), upd.GetWidth(), upd.GetHeight() ); upd ++; } +#endif } m_clearRegion.Clear(); }