From 7048d098f15eae7138b7d01c88ad6aebc1afaf26 Mon Sep 17 00:00:00 2001 From: Patrick Storz Date: Sun, 17 Feb 2019 19:33:48 +0100 Subject: Rescue code for restoring last used window geometry It was accidentally dropped in 8b1840f9507f10911f63fc00b9885354ead99d53 Also show window *after* setting position/size. This gives the window manager the chance to move an off-screen window back into the visible desktop bounds (e.g. after a monitor was disconnected). --- src/inkscape-window.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/inkscape-window.cpp') diff --git a/src/inkscape-window.cpp b/src/inkscape-window.cpp index 8c0525a87..f85d94473 100644 --- a/src/inkscape-window.cpp +++ b/src/inkscape-window.cpp @@ -85,11 +85,14 @@ InkscapeWindow::InkscapeWindow(SPDocument* document) // ================ Window Options ============== - show(); // Must show before resize! - // 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) + // Should show after resizing/moving to allow window manager to correct an invalid windows size/position + show(); + sp_namedview_zoom_and_view_from_document(_desktop); sp_namedview_update_layers_from_document(_desktop); } -- cgit v1.2.3