diff options
Diffstat (limited to 'src/ui/dialog/dialog.cpp')
| -rw-r--r-- | src/ui/dialog/dialog.cpp | 28 |
1 files changed, 4 insertions, 24 deletions
diff --git a/src/ui/dialog/dialog.cpp b/src/ui/dialog/dialog.cpp index 3d949a8c9..f7e9a1bed 100644 --- a/src/ui/dialog/dialog.cpp +++ b/src/ui/dialog/dialog.cpp @@ -20,13 +20,10 @@ #include "dialog-manager.h" #include <gtkmm/dialog.h> -#if GTKMM_CHECK_VERSION(3,22,0) -# include <gdkmm/monitor.h> -#endif - #include <gdk/gdkkeysyms.h> #include "inkscape.h" +#include "ui/monitor.h" #include "ui/tools/tool-base.h" #include "desktop.h" @@ -166,26 +163,9 @@ void Dialog::read_geometry() resize(w, h); } -#if GTKMM_CHECK_VERSION(3,22,0) - auto const display = Gdk::Display::get_default(); - 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); - } - - Gdk::Rectangle screen_geometry; - if (monitor) { - monitor->get_geometry(screen_geometry); - } - auto const screen_width = screen_geometry.get_width(); - auto const screen_height = screen_geometry.get_height(); -#else - auto const screen_width = gdk_screen_width(); - auto const screen_height = gdk_screen_height(); -#endif + Gdk::Rectangle monitor_geometry = Inkscape::UI::get_monitor_geometry_primary(); + auto const screen_width = monitor_geometry.get_width(); + auto const screen_height = monitor_geometry.get_height(); // If there are stored values for where the dialog should be // located, then restore the dialog to that position. |
