summaryrefslogtreecommitdiffstats
path: root/src/ui/dialog/dialog.cpp
diff options
context:
space:
mode:
authorTavmjong Bah <tavmjong@free.fr>2017-12-24 09:10:50 +0000
committerTavmjong Bah <tavmjong@free.fr>2017-12-24 09:10:50 +0000
commit9f858e0cb6515c09b1bff1456e91de4ffd05c889 (patch)
tree4c3c2b4a655e6ece1c84f0fd574c3e9f8d2a3631 /src/ui/dialog/dialog.cpp
parentShow appropriate warning if non-existent export ID is specified (diff)
downloadinkscape-9f858e0cb6515c09b1bff1456e91de4ffd05c889.tar.gz
inkscape-9f858e0cb6515c09b1bff1456e91de4ffd05c889.zip
Name a few more widgets. Minor cleanup.
Diffstat (limited to 'src/ui/dialog/dialog.cpp')
-rw-r--r--src/ui/dialog/dialog.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/ui/dialog/dialog.cpp b/src/ui/dialog/dialog.cpp
index e50824c7b..fbbb4f869 100644
--- a/src/ui/dialog/dialog.cpp
+++ b/src/ui/dialog/dialog.cpp
@@ -168,9 +168,14 @@ void Dialog::read_geometry()
#if WITH_GTKMM_3_22
auto const display = Gdk::Display::get_default();
- auto const monitor = display->get_primary_monitor();
+ auto monitor = display->get_primary_monitor();
+
+ // If user hasn't configured a primary monitor, nullptr is returned so try first monitor.
+ if (!monitor) {
+ std::cerr << "Dialog::read_geometry: no primary monitor configured!" << std::endl;
+ monitor = display->get_monitor(0);
+ }
- // If user hasn't configured a primary monitor, nullptr is returned.
Gdk::Rectangle screen_geometry;
if (monitor) {
monitor->get_geometry(screen_geometry);
@@ -179,7 +184,7 @@ void Dialog::read_geometry()
auto const screen_height = screen_geometry.get_height();
#else
auto const screen_width = gdk_screen_width();
- auto const screen_height = gdk_screen_width();
+ auto const screen_height = gdk_screen_height();
#endif
// If there are stored values for where the dialog should be