From c9976155d67731cfcd7bd300840125b8c7be290b Mon Sep 17 00:00:00 2001
From: Thomas Geymayer <tomgey@gmail.com>
Date: Thu, 13 Dec 2012 23:39:41 +0100
Subject: [PATCH] Update to latest SimGear and fix eating up every 2nd scroll
 event

---
 src/Canvas/gui_mgr.cxx | 6 ++----
 src/Canvas/window.cxx  | 2 +-
 src/Canvas/window.hxx  | 2 +-
 3 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/src/Canvas/gui_mgr.cxx b/src/Canvas/gui_mgr.cxx
index efd3f94e1..0190ba9f6 100644
--- a/src/Canvas/gui_mgr.cxx
+++ b/src/Canvas/gui_mgr.cxx
@@ -305,8 +305,6 @@ bool GUIMgr::handleMouse(const osgGA::GUIEventAdapter& ea)
   event->state = ea.getButtonMask();
   event->mod = ea.getModKeyMask();
 
-  static simgear::Rect<float> resize_region;
-
   if( !_resize_window.expired() )
   {
     switch( ea.getEventType() )
@@ -353,7 +351,7 @@ bool GUIMgr::handleMouse(const osgGA::GUIEventAdapter& ea)
 
   if( window_at_cursor )
   {
-    const simgear::Rect<float>& reg = window_at_cursor->getRegion();
+    const SGRect<float>& reg = window_at_cursor->getRegion();
 
     if(     window_at_cursor->isResizable()
         && (  ea.getEventType() == osgGA::GUIEventAdapter::MOVE
@@ -434,7 +432,7 @@ bool GUIMgr::handleMouse(const osgGA::GUIEventAdapter& ea)
       // duplicate events, so lets ignore the second event with the same
       // timestamp.
       if( _last_scroll_time == ea.getTime() )
-        return true;
+        return window_at_cursor ? true : false;
       _last_scroll_time = ea.getTime();
 
       event->type = sc::Event::WHEEL;
diff --git a/src/Canvas/window.cxx b/src/Canvas/window.cxx
index 57d862fa4..8c0494b47 100644
--- a/src/Canvas/window.cxx
+++ b/src/Canvas/window.cxx
@@ -89,7 +89,7 @@ namespace canvas
   }
 
   //----------------------------------------------------------------------------
-  const simgear::Rect<float>& Window::getRegion() const
+  const SGRect<float>& Window::getRegion() const
   {
     return _image.getRegion();
   }
diff --git a/src/Canvas/window.hxx b/src/Canvas/window.hxx
index 3b31623b0..46fb48ee2 100644
--- a/src/Canvas/window.hxx
+++ b/src/Canvas/window.hxx
@@ -51,7 +51,7 @@ namespace canvas
       virtual void valueChanged(SGPropertyNode* node);
 
       osg::Group* getGroup();
-      const simgear::Rect<float>& getRegion() const;
+      const SGRect<float>& getRegion() const;
 
       void setCanvas(simgear::canvas::CanvasPtr canvas);
       simgear::canvas::CanvasWeakPtr getCanvas() const;