[aseprite] 118/250: Show she::DisplayCreationException message when she::System::createDisplay() fails
Tobias Hansen
thansen at moszumanska.debian.org
Sun Dec 20 15:27:19 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 e4a71b906536ed96d2ebb1cc732611a4b892bb87
Author: David Capello <davidcapello at gmail.com>
Date: Thu Oct 1 10:54:47 2015 -0300
Show she::DisplayCreationException message when she::System::createDisplay() fails
---
src/app/modules/gui.cpp | 11 ++++++-----
src/she/system.h | 2 +-
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/src/app/modules/gui.cpp b/src/app/modules/gui.cpp
index 3345588..05649d8 100644
--- a/src/app/modules/gui.cpp
+++ b/src/app/modules/gui.cpp
@@ -103,6 +103,7 @@ static int get_screen_scale()
// Initializes GUI.
int init_module_gui()
{
+ std::string lastError = "Unknown error";
int w, h;
bool maximized;
int scale = get_screen_scale();
@@ -112,8 +113,8 @@ int init_module_gui()
if (w > 0 && h > 0)
main_display = she::instance()->createDisplay(w, h, scale);
}
- catch (const she::DisplayCreationException&) {
- // Do nothing, the display wasn't created.
+ catch (const she::DisplayCreationException& e) {
+ lastError = e.what();
}
if (!main_display) {
@@ -128,14 +129,14 @@ int init_module_gui()
Preferences::instance().general.screenScale(scale);
break;
}
- catch (const she::DisplayCreationException&) {
- // Ignore
+ catch (const she::DisplayCreationException& e) {
+ lastError = e.what();
}
}
}
if (!main_display) {
- she::error_message("Unable to create a user-interface display.\n");
+ she::error_message(("Unable to create a user-interface display.\nDetails: "+lastError+"\n").c_str());
return -1;
}
diff --git a/src/she/system.h b/src/she/system.h
index 83acf66..0de3e1b 100644
--- a/src/she/system.h
+++ b/src/she/system.h
@@ -22,7 +22,7 @@ namespace she {
class NativeDialogs;
class Surface;
- class DisplayCreationException : std::runtime_error {
+ class DisplayCreationException : public std::runtime_error {
public:
DisplayCreationException(const char* msg) throw()
: std::runtime_error(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