X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/127328cdd34a23871eb547bb83fd4b5971a7e80a..27f35b6674b796e61986681261ec7a96bef93502:/src/gtk1/window.cpp diff --git a/src/gtk1/window.cpp b/src/gtk1/window.cpp index e66e9b1b9c..30dfae29e0 100644 --- a/src/gtk1/window.cpp +++ b/src/gtk1/window.cpp @@ -497,6 +497,14 @@ static int gtk_window_expose_callback( GtkWidget *widget, if (g_isIdle) wxapp_install_idle_handler(); +#ifdef __WXGTK20__ + // This callback gets called in drawing-idle time under + // GTK 2.0, so we don't need to defer anything to idle + // time anymore. + + GtkPizza *pizza = GTK_PIZZA( widget ); + if (gdk_event->window != pizza->bin_window) return FALSE; + #if 0 if (win->GetName()) { @@ -510,16 +518,11 @@ static int gtk_window_expose_callback( GtkWidget *widget, } #endif -#ifdef __WXGTK20__ - // This callback gets called in drawing-idle time under - // GTK 2.0, so we don't need to defer anything to idle - // time anymore. - win->GetUpdateRegion() = wxRegion( gdk_event->region ); win->GtkSendPaintEvents(); - // Draw window less widgets + // Let parent window draw window less widgets (* GTK_WIDGET_CLASS (pizza_parent_class)->expose_event) (widget, gdk_event); #else // This gets called immediately after an expose event @@ -539,8 +542,7 @@ static int gtk_window_expose_callback( GtkWidget *widget, // win->GtkUpdate(); #endif - - return TRUE; + return FALSE; } //----------------------------------------------------------------------------- @@ -1898,7 +1900,9 @@ static void gtk_window_vscroll_callback( GtkAdjustment *adjust, win->m_oldVerticalPos = adjust->value; +#ifndef __WXGTK20__ GtkScrolledWindow *sw = GTK_SCROLLED_WINDOW(win->m_widget); +#endif wxEventType command = GtkScrollWinTypeToWx(GET_SCROLL_TYPE(sw->vscrollbar)); int value = (int)(adjust->value+0.5); @@ -1927,7 +1931,9 @@ static void gtk_window_hscroll_callback( GtkAdjustment *adjust, float diff = adjust->value - win->m_oldHorizontalPos; if (fabs(diff) < 0.2) return; +#ifndef __WXGTK20__ GtkScrolledWindow *sw = GTK_SCROLLED_WINDOW(win->m_widget); +#endif wxEventType command = GtkScrollWinTypeToWx(GET_SCROLL_TYPE(sw->hscrollbar)); win->m_oldHorizontalPos = adjust->value; @@ -4261,21 +4267,13 @@ void wxWindowGTK::ScrollWindow( int dx, int dy, const wxRect* WXUNUSED(rect) ) GetClientSize( &cw, &ch ); m_clearRegion.Intersect( 0, 0, cw, ch ); } +#endif + m_clipPaintRegion = TRUE; gtk_pizza_scroll( GTK_PIZZA(m_wxwindow), -dx, -dy ); m_clipPaintRegion = FALSE; -#else - wxCHECK_RET( GTK_PIZZA(m_wxwindow)->bin_window != NULL, wxT("window needs client area for scrolling") ); - - gdk_window_scroll( GTK_PIZZA(m_wxwindow)->bin_window, dx, dy ); - - GTK_PIZZA(m_wxwindow)->xoffset += dx; - GTK_PIZZA(m_wxwindow)->yoffset += dy; - -#endif - }