From 574bf5078506e4788ba94c07571421b20c0e2716 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Sun, 25 Nov 2001 20:10:46 +0000 Subject: [PATCH] Correct wxTimer bug in wxGTK. Correct SetSize bug for certain Toplevel windows in wxMAC. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12696 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/timer.cpp | 3 +++ src/gtk1/timer.cpp | 3 +++ src/mac/carbon/window.cpp | 3 ++- src/mac/window.cpp | 3 ++- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/gtk/timer.cpp b/src/gtk/timer.cpp index f8531ba81c..2afdb78df9 100644 --- a/src/gtk/timer.cpp +++ b/src/gtk/timer.cpp @@ -61,6 +61,9 @@ bool wxTimer::Start( int millisecs, bool oneShot ) { (void)wxTimerBase::Start(millisecs, oneShot); + if (m_tag != -1) + gtk_timeout_remove( m_tag ); + m_tag = gtk_timeout_add( m_milli, timeout_callback, this ); return TRUE; diff --git a/src/gtk1/timer.cpp b/src/gtk1/timer.cpp index f8531ba81c..2afdb78df9 100644 --- a/src/gtk1/timer.cpp +++ b/src/gtk1/timer.cpp @@ -61,6 +61,9 @@ bool wxTimer::Start( int millisecs, bool oneShot ) { (void)wxTimerBase::Start(millisecs, oneShot); + if (m_tag != -1) + gtk_timeout_remove( m_tag ); + m_tag = gtk_timeout_add( m_milli, timeout_callback, this ); return TRUE; diff --git a/src/mac/carbon/window.cpp b/src/mac/carbon/window.cpp index 11948e733d..b3100bf14e 100644 --- a/src/mac/carbon/window.cpp +++ b/src/mac/carbon/window.cpp @@ -349,7 +349,7 @@ void wxWindowMac::DoGetPosition(int *x, int *y) const xx = m_x ; yy = m_y ; - if (GetParent()) + if (!m_macWindowData && GetParent()) { wxPoint pt(GetParent()->GetClientAreaOrigin()); xx -= pt.x; @@ -670,6 +670,7 @@ void wxWindowMac::DoSetSize(int x, int y, int width, int height, int sizeFlags) // get the current size and position... int currentX, currentY; GetPosition(¤tX, ¤tY); + int currentW,currentH; GetSize(¤tW, ¤tH); diff --git a/src/mac/window.cpp b/src/mac/window.cpp index 11948e733d..b3100bf14e 100644 --- a/src/mac/window.cpp +++ b/src/mac/window.cpp @@ -349,7 +349,7 @@ void wxWindowMac::DoGetPosition(int *x, int *y) const xx = m_x ; yy = m_y ; - if (GetParent()) + if (!m_macWindowData && GetParent()) { wxPoint pt(GetParent()->GetClientAreaOrigin()); xx -= pt.x; @@ -670,6 +670,7 @@ void wxWindowMac::DoSetSize(int x, int y, int width, int height, int sizeFlags) // get the current size and position... int currentX, currentY; GetPosition(¤tX, ¤tY); + int currentW,currentH; GetSize(¤tW, ¤tH); -- 2.45.2