X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7408cf7f7684c70fd86b6656452e9aab47c97be1..68d4172048cfc0f3e658ef90ff5af926eedfdd57:/src/gtk1/window.cpp?ds=sidebyside diff --git a/src/gtk1/window.cpp b/src/gtk1/window.cpp index ca83cf7c87..13eda5a41d 100644 --- a/src/gtk1/window.cpp +++ b/src/gtk1/window.cpp @@ -2194,11 +2194,11 @@ gtk_window_realized_callback( GtkWidget *m_widget, wxWindow *win ) if (g_isIdle) wxapp_install_idle_handler(); - - if (win->m_delayedBackgroundColour) + + if (win->m_delayedBackgroundColour && !win->GetThemeEnabled()) win->GtkSetBackgroundColour( win->GetBackgroundColour() ); - if (win->m_delayedForegroundColour) + if (win->m_delayedForegroundColour && !win->GetThemeEnabled()) win->GtkSetForegroundColour( win->GetForegroundColour() ); #ifdef __WXGTK20__ @@ -2450,8 +2450,10 @@ void wxWindowGTK::Init() m_hAdjust = (GtkAdjustment*) NULL; m_vAdjust = (GtkAdjustment*) NULL; - m_oldHorizontalPos = 0.0; + m_oldHorizontalPos = m_oldVerticalPos = 0.0; + m_oldClientWidth = + m_oldClientHeight = 0; m_resizing = FALSE; m_widgetStyle = (GtkStyle*) NULL; @@ -3020,7 +3022,8 @@ void wxWindowGTK::OnInternalIdle() } } - UpdateWindowUI(); + if (wxUpdateUIEvent::CanUpdate(this)) + UpdateWindowUI(wxUPDATE_UI_FROMIDLE); } void wxWindowGTK::DoGetSize( int *width, int *height ) const @@ -3605,6 +3608,18 @@ void wxWindowGTK::Refresh( bool eraseBackground, const wxRect *rect ) if (g_isIdle) wxapp_install_idle_handler(); + wxRect myRect(0,0,0,0); + if (m_wxwindow && rect) + { + myRect.SetSize(wxSize( m_wxwindow->allocation.width, + m_wxwindow->allocation.height)); + myRect.Intersect(*rect); + if (!myRect.width || !myRect.height) + // nothing to do, rectangle is empty + return; + rect = &myRect; + } + if (eraseBackground && m_wxwindow && m_wxwindow->window) { if (rect) @@ -4035,7 +4050,7 @@ void wxWindowGTK::SetWidgetStyle() { #ifdef __WXGTK20__ pango_font_description_free( style->font_desc ); - pango_font_description_copy( m_font.GetNativeFontInfo()->description ); + style->font_desc = pango_font_description_copy( m_font.GetNativeFontInfo()->description ); #else gdk_font_unref( style->font ); style->font = gdk_font_ref( m_font.GetInternalFont( 1.0 ) ); @@ -4200,8 +4215,7 @@ bool wxWindowGTK::DoPopupMenu( wxMenu *menu, int x, int y ) while (is_waiting) { - while (gtk_events_pending()) - gtk_main_iteration(); + gtk_main_iteration(); } return TRUE;