summaryrefslogtreecommitdiffstats
path: root/src/inkscape-window.cpp
diff options
context:
space:
mode:
authorMartin Owens <doctormo@gmail.com>2019-03-06 19:54:07 +0000
committerMartin Owens <doctormo@gmail.com>2019-03-06 19:54:07 +0000
commit09c89e9b6a80f4cbfe367c2870e6d9b2f57c5a8e (patch)
treedd6d6f0252411c1658355f97da64b7c445219165 /src/inkscape-window.cpp
parentfix ci: appimage remove gtk2 themes (diff)
parentFix query for monitor dimensions (diff)
downloadinkscape-09c89e9b6a80f4cbfe367c2870e6d9b2f57c5a8e.tar.gz
inkscape-09c89e9b6a80f4cbfe367c2870e6d9b2f57c5a8e.zip
Merge in Rescue code for restoring last used window geometry MR !534
Diffstat (limited to 'src/inkscape-window.cpp')
-rw-r--r--src/inkscape-window.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/inkscape-window.cpp b/src/inkscape-window.cpp
index 8c0525a87..bcf10cedd 100644
--- a/src/inkscape-window.cpp
+++ b/src/inkscape-window.cpp
@@ -85,11 +85,18 @@ InkscapeWindow::InkscapeWindow(SPDocument* document)
// ================ Window Options ==============
- show(); // Must show before resize!
+ // Make sure the GdkWindow is fully initialized before resizing/moving
+ // (ensures the monitor it'll be shown on is known)
+ realize();
// Resize the window to match the document properties
sp_namedview_window_from_document(_desktop); // This should probably be a member function here.
+ // Must show before setting zoom and view! (crashes otherwise)
+ // Showing after resizing/moving allows the window manager to correct an invalid size/position of the window
+ show();
+
+ sp_namedview_zoom_and_view_from_document(_desktop);
sp_namedview_update_layers_from_document(_desktop);
}