diff --git a/include/wx/gtk/dcclient.h b/include/wx/gtk/dcclient.h index f91eae7dc9..8499b259b5 100644 --- a/include/wx/gtk/dcclient.h +++ b/include/wx/gtk/dcclient.h @@ -134,20 +134,6 @@ private: DECLARE_DYNAMIC_CLASS(wxWindowDC) }; -//----------------------------------------------------------------------------- -// wxPaintDC -//----------------------------------------------------------------------------- - -class wxPaintDC : public wxWindowDC -{ -public: - wxPaintDC(); - wxPaintDC( wxWindow *win ); - -private: - DECLARE_DYNAMIC_CLASS(wxPaintDC) -}; - //----------------------------------------------------------------------------- // wxClientDC //----------------------------------------------------------------------------- @@ -162,4 +148,18 @@ private: DECLARE_DYNAMIC_CLASS(wxClientDC) }; +//----------------------------------------------------------------------------- +// wxPaintDC +//----------------------------------------------------------------------------- + +class wxPaintDC : public wxClientDC +{ +public: + wxPaintDC() { } + wxPaintDC( wxWindow *win ); + +private: + DECLARE_DYNAMIC_CLASS(wxPaintDC) +}; + #endif // __GTKDCCLIENTH__ diff --git a/include/wx/gtk1/dcclient.h b/include/wx/gtk1/dcclient.h index f91eae7dc9..8499b259b5 100644 --- a/include/wx/gtk1/dcclient.h +++ b/include/wx/gtk1/dcclient.h @@ -134,20 +134,6 @@ private: DECLARE_DYNAMIC_CLASS(wxWindowDC) }; -//----------------------------------------------------------------------------- -// wxPaintDC -//----------------------------------------------------------------------------- - -class wxPaintDC : public wxWindowDC -{ -public: - wxPaintDC(); - wxPaintDC( wxWindow *win ); - -private: - DECLARE_DYNAMIC_CLASS(wxPaintDC) -}; - //----------------------------------------------------------------------------- // wxClientDC //----------------------------------------------------------------------------- @@ -162,4 +148,18 @@ private: DECLARE_DYNAMIC_CLASS(wxClientDC) }; +//----------------------------------------------------------------------------- +// wxPaintDC +//----------------------------------------------------------------------------- + +class wxPaintDC : public wxClientDC +{ +public: + wxPaintDC() { } + wxPaintDC( wxWindow *win ); + +private: + DECLARE_DYNAMIC_CLASS(wxPaintDC) +}; + #endif // __GTKDCCLIENTH__ diff --git a/samples/univ/univ.cpp b/samples/univ/univ.cpp index 65b76fc150..4a5e9a0477 100644 --- a/samples/univ/univ.cpp +++ b/samples/univ/univ.cpp @@ -421,5 +421,7 @@ void MyUnivCanvas::OnPaint(wxPaintEvent& event) dc.DrawText(_T("This is the top of the canvas"), 10, 10); dc.DrawLabel(_T("This is the bottom of the canvas"), wxRect(0, 950, 950, 50), wxALIGN_RIGHT | wxBOTTOM); + + event.Skip(); } diff --git a/src/gtk/dcclient.cpp b/src/gtk/dcclient.cpp index 0cad4913f8..2ce555fa16 100644 --- a/src/gtk/dcclient.cpp +++ b/src/gtk/dcclient.cpp @@ -2208,15 +2208,10 @@ void wxWindowDC::DoDrawSpline( wxList *points ) // wxPaintDC //----------------------------------------------------------------------------- -IMPLEMENT_DYNAMIC_CLASS(wxPaintDC,wxWindowDC) - -wxPaintDC::wxPaintDC() - : wxWindowDC() -{ -} +IMPLEMENT_DYNAMIC_CLASS(wxPaintDC, wxClientDC) wxPaintDC::wxPaintDC( wxWindow *win ) - : wxWindowDC( win ) + : wxClientDC( win ) { #if USE_PAINT_REGION if (!win->m_clipPaintRegion) @@ -2233,7 +2228,11 @@ wxPaintDC::wxPaintDC( wxWindow *win ) gdk_gc_set_clip_region( m_textGC, region ); gdk_gc_set_clip_region( m_bgGC, region ); } -#endif +#endif // USE_PAINT_REGION + +#ifdef __WXUNIVERSAL__ + SetClippingRegion(win->GetClientRect()); +#endif // __WXUNIVERSAL__ } //----------------------------------------------------------------------------- diff --git a/src/gtk/timer.cpp b/src/gtk/timer.cpp index d44dbeb7f2..3f78af2a26 100644 --- a/src/gtk/timer.cpp +++ b/src/gtk/timer.cpp @@ -16,18 +16,6 @@ #include "gtk/gtk.h" -// ---------------------------------------------------------------------------- -// This is a hack to work around a crash in wxGTK which happens (sometimes) -// when the timer is deleted from the GTK event handler. In this case even -// though the timer is stopped in its dtor, it is apparently too late to -// prevent the dead timer from being called from g_timeout_dispatch() during -// the same iteration of g_main_dispatch(). A better solution must be found, -// possibly by deferring the timer deletion until later, this is only a -// temporary hack! (VZ) -// ---------------------------------------------------------------------------- - -static wxTimer *gs_timerDead = (wxTimer *)NULL; - // ---------------------------------------------------------------------------- // wxTimer // ---------------------------------------------------------------------------- @@ -37,13 +25,6 @@ IMPLEMENT_ABSTRACT_CLASS(wxTimer,wxObject) static gint timeout_callback( gpointer data ) { wxTimer *timer = (wxTimer*)data; - if ( timer == gs_timerDead ) - { - // shouldn't be called more than once for the dead timer anyhow - gs_timerDead = NULL; - - return FALSE; - } /* when getting called from GDK's timer handler we are no longer within GDK's grab on the GUI @@ -69,8 +50,6 @@ void wxTimer::Init() wxTimer::~wxTimer() { - gs_timerDead = this; - wxTimer::Stop(); } diff --git a/src/gtk1/dcclient.cpp b/src/gtk1/dcclient.cpp index 0cad4913f8..2ce555fa16 100644 --- a/src/gtk1/dcclient.cpp +++ b/src/gtk1/dcclient.cpp @@ -2208,15 +2208,10 @@ void wxWindowDC::DoDrawSpline( wxList *points ) // wxPaintDC //----------------------------------------------------------------------------- -IMPLEMENT_DYNAMIC_CLASS(wxPaintDC,wxWindowDC) - -wxPaintDC::wxPaintDC() - : wxWindowDC() -{ -} +IMPLEMENT_DYNAMIC_CLASS(wxPaintDC, wxClientDC) wxPaintDC::wxPaintDC( wxWindow *win ) - : wxWindowDC( win ) + : wxClientDC( win ) { #if USE_PAINT_REGION if (!win->m_clipPaintRegion) @@ -2233,7 +2228,11 @@ wxPaintDC::wxPaintDC( wxWindow *win ) gdk_gc_set_clip_region( m_textGC, region ); gdk_gc_set_clip_region( m_bgGC, region ); } -#endif +#endif // USE_PAINT_REGION + +#ifdef __WXUNIVERSAL__ + SetClippingRegion(win->GetClientRect()); +#endif // __WXUNIVERSAL__ } //----------------------------------------------------------------------------- diff --git a/src/gtk1/timer.cpp b/src/gtk1/timer.cpp index d44dbeb7f2..3f78af2a26 100644 --- a/src/gtk1/timer.cpp +++ b/src/gtk1/timer.cpp @@ -16,18 +16,6 @@ #include "gtk/gtk.h" -// ---------------------------------------------------------------------------- -// This is a hack to work around a crash in wxGTK which happens (sometimes) -// when the timer is deleted from the GTK event handler. In this case even -// though the timer is stopped in its dtor, it is apparently too late to -// prevent the dead timer from being called from g_timeout_dispatch() during -// the same iteration of g_main_dispatch(). A better solution must be found, -// possibly by deferring the timer deletion until later, this is only a -// temporary hack! (VZ) -// ---------------------------------------------------------------------------- - -static wxTimer *gs_timerDead = (wxTimer *)NULL; - // ---------------------------------------------------------------------------- // wxTimer // ---------------------------------------------------------------------------- @@ -37,13 +25,6 @@ IMPLEMENT_ABSTRACT_CLASS(wxTimer,wxObject) static gint timeout_callback( gpointer data ) { wxTimer *timer = (wxTimer*)data; - if ( timer == gs_timerDead ) - { - // shouldn't be called more than once for the dead timer anyhow - gs_timerDead = NULL; - - return FALSE; - } /* when getting called from GDK's timer handler we are no longer within GDK's grab on the GUI @@ -69,8 +50,6 @@ void wxTimer::Init() wxTimer::~wxTimer() { - gs_timerDead = this; - wxTimer::Stop(); } diff --git a/src/univ/scrolbar.cpp b/src/univ/scrolbar.cpp index 7a03df5a22..2210582119 100644 --- a/src/univ/scrolbar.cpp +++ b/src/univ/scrolbar.cpp @@ -451,6 +451,7 @@ void wxScrollBarTimer::Notify() if ( m_skipNext ) { // scroll normally now - reduce the delay + Stop(); Start(50); // FIXME: hardcoded delay m_skipNext = FALSE; diff --git a/src/univ/winuniv.cpp b/src/univ/winuniv.cpp index 64b5861251..28fe84c4ee 100644 --- a/src/univ/winuniv.cpp +++ b/src/univ/winuniv.cpp @@ -514,9 +514,9 @@ void wxWindow::ScrollWindow(int dx, int dy, const wxRect *rect) ptDest = ptOrigin = GetClientAreaOrigin(); wxSize size; - size.x = sizeTotal.x - abs(dx); - size.y = sizeTotal.y - abs(dy); - if ( size.x < 0 || size.y < 0 ) + size.x = sizeTotal.x - abs(dx) - 1; + size.y = sizeTotal.y - abs(dy) - 1; + if ( size.x <= 0 || size.y <= 0 ) { // just redraw everything as nothing of the displayed image will stay wxLogTrace(_T("scroll"), _T("refreshing everything"));