[aseprite] 153/250: Fix closing multiple tabs with middle-click without moving mouse (fix #826)

Tobias Hansen thansen at moszumanska.debian.org
Sun Dec 20 15:27:23 UTC 2015


This is an automated email from the git hooks/post-receive script.

thansen pushed a commit to branch master
in repository aseprite.

commit 615e369cc4bd4a2753e455e9c77b80d6f8536775
Author: David Capello <davidcapello at gmail.com>
Date:   Tue Oct 13 12:13:13 2015 -0300

    Fix closing multiple tabs with middle-click without moving mouse (fix #826)
---
 src/app/ui/tabs.cpp |  2 ++
 src/ui/manager.cpp  | 12 +++++++++---
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/src/app/ui/tabs.cpp b/src/app/ui/tabs.cpp
index 50ca27b..ed791bf 100644
--- a/src/app/ui/tabs.cpp
+++ b/src/app/ui/tabs.cpp
@@ -180,6 +180,8 @@ void Tabs::updateTabs()
     x += tabWidth;
     ++i;
   }
+
+  calculateHot();
   invalidate();
 }
 
diff --git a/src/ui/manager.cpp b/src/ui/manager.cpp
index cee7384..c76a1c5 100644
--- a/src/ui/manager.cpp
+++ b/src/ui/manager.cpp
@@ -931,13 +931,13 @@ void Manager::_closeWindow(Window* window, bool redraw_background)
   }
 
   // Free all widgets of special states.
-  if (capture_widget != NULL && capture_widget->getRoot() == window)
+  if (capture_widget && capture_widget->getRoot() == window)
     freeCapture();
 
-  if (mouse_widget != NULL && mouse_widget->getRoot() == window)
+  if (mouse_widget && mouse_widget->getRoot() == window)
     freeMouse();
 
-  if (focus_widget != NULL && focus_widget->getRoot() == window)
+  if (focus_widget && focus_widget->getRoot() == window)
     freeFocus();
 
   // Hide window.
@@ -959,6 +959,12 @@ void Manager::_closeWindow(Window* window, bool redraw_background)
     std::find(new_windows.begin(), new_windows.end(), window);
   if (it != new_windows.end())
     new_windows.erase(it);
+
+  // Update mouse widget (as it can be a widget below the
+  // recently closed window).
+  Widget* widget = pick(ui::get_mouse_position());
+  if (widget)
+    setMouse(widget);
 }
 
 bool Manager::onProcessMessage(Message* msg)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/aseprite.git



More information about the Pkg-games-commits mailing list