[aseprite] 99/308: Don't restore the window minimized

Tobias Hansen thansen at moszumanska.debian.org
Tue Mar 8 02:44:57 UTC 2016


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

thansen pushed a commit to branch master
in repository aseprite.

commit be9b33828d86054e27315a5a511c3fe7b2e598ba
Author: David Capello <davidcapello at gmail.com>
Date:   Fri Dec 11 19:46:41 2015 -0300

    Don't restore the window minimized
---
 src/app/modules/gui.cpp          | 5 ++++-
 src/she/alleg4/alleg_display.cpp | 9 +++++++++
 src/she/alleg4/alleg_display.h   | 1 +
 src/she/display.h                | 1 +
 4 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/src/app/modules/gui.cpp b/src/app/modules/gui.cpp
index 32ebe1f..0003ad5 100644
--- a/src/app/modules/gui.cpp
+++ b/src/app/modules/gui.cpp
@@ -138,8 +138,11 @@ static bool create_main_display(bool gpuAccel,
     }
   }
 
-  if (main_display && !windowLayout.empty())
+  if (main_display && !windowLayout.empty()) {
     main_display->setLayout(windowLayout);
+    if (main_display->isMinimized())
+      main_display->maximize();
+  }
 
   return (main_display != nullptr);
 }
diff --git a/src/she/alleg4/alleg_display.cpp b/src/she/alleg4/alleg_display.cpp
index a42b935..e4f6614 100644
--- a/src/she/alleg4/alleg_display.cpp
+++ b/src/she/alleg4/alleg_display.cpp
@@ -504,6 +504,15 @@ bool Alleg4Display::isMaximized() const
 #endif
 }
 
+bool Alleg4Display::isMinimized() const
+{
+#ifdef _WIN32
+  return (::GetWindowLong(win_get_window(), GWL_STYLE) & WS_MINIMIZE ? true: false);
+#else
+  return false;
+#endif
+}
+
 void Alleg4Display::setTitleBar(const std::string& title)
 {
   set_window_title(title.c_str());
diff --git a/src/she/alleg4/alleg_display.h b/src/she/alleg4/alleg_display.h
index 51c2845..5a608aa 100644
--- a/src/she/alleg4/alleg_display.h
+++ b/src/she/alleg4/alleg_display.h
@@ -31,6 +31,7 @@ namespace she {
     void flip(const gfx::Rect& bounds) override;
     void maximize() override;
     bool isMaximized() const override;
+    bool isMinimized() const override;
     void setTitleBar(const std::string& title) override;
     NativeCursor nativeMouseCursor() override;
     bool setNativeMouseCursor(NativeCursor cursor) override;
diff --git a/src/she/display.h b/src/she/display.h
index ae2e3b1..4c614af 100644
--- a/src/she/display.h
+++ b/src/she/display.h
@@ -53,6 +53,7 @@ namespace she {
 
     virtual void maximize() = 0;
     virtual bool isMaximized() const = 0;
+    virtual bool isMinimized() const = 0;
 
     virtual void setTitleBar(const std::string& title) = 0;
 

-- 
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