diff --git a/rtgui/editorpanel.cc b/rtgui/editorpanel.cc index 648004aee..d139cc8e8 100644 --- a/rtgui/editorpanel.cc +++ b/rtgui/editorpanel.cc @@ -453,7 +453,7 @@ public: }; EditorPanel::EditorPanel (FilePanel* filePanel) - : catalogPane(nullptr), realized(false), tbBeforeLock(nullptr), iHistoryShow(nullptr), iHistoryHide(nullptr), iTopPanel_1_Show(nullptr), iTopPanel_1_Hide(nullptr), iRightPanel_1_Show(nullptr), iRightPanel_1_Hide(nullptr), iBeforeLockON(nullptr), iBeforeLockOFF(nullptr), previewHandler(nullptr), beforePreviewHandler(nullptr), beforeIarea(nullptr), beforeBox(nullptr), afterBox(nullptr), beforeLabel(nullptr), afterLabel(nullptr), beforeHeaderBox(nullptr), afterHeaderBox(nullptr), parent(nullptr), openThm(nullptr), isrc(nullptr), ipc(nullptr), beforeIpc(nullptr), err(0), isProcessing(false) + : catalogPane(nullptr), realized(false), tbBeforeLock(nullptr), iHistoryShow(nullptr), iHistoryHide(nullptr), iTopPanel_1_Show(nullptr), iTopPanel_1_Hide(nullptr), iRightPanel_1_Show(nullptr), iRightPanel_1_Hide(nullptr), iBeforeLockON(nullptr), iBeforeLockOFF(nullptr), previewHandler(nullptr), beforePreviewHandler(nullptr), beforeIarea(nullptr), beforeBox(nullptr), afterBox(nullptr), beforeLabel(nullptr), afterLabel(nullptr), beforeHeaderBox(nullptr), afterHeaderBox(nullptr), parent(nullptr), parentWindow(nullptr), openThm(nullptr), isrc(nullptr), ipc(nullptr), beforeIpc(nullptr), err(0), isProcessing(false) { epih = new EditorPanelIdleHelper; @@ -899,7 +899,7 @@ void EditorPanel::rightPaneButtonReleased (GdkEventButton *event) { if (event->button == 1) { int winW, winH; - parent->get_size (winW, winH); + parentWindow->get_size (winW, winH); // Button 1 released : it's a resize options.toolPanelWidth = winW - hpanedr->get_position(); } @@ -929,7 +929,7 @@ void EditorPanel::showTopPanel (bool show) void EditorPanel::setAspect () { int winW, winH; - parent->get_size (winW, winH); + parentWindow->get_size (winW, winH); hpanedl->set_position (options.historyPanelWidth); hpanedr->set_position (winW - options.toolPanelWidth); diff --git a/rtgui/editorpanel.h b/rtgui/editorpanel.h index 050909d7d..d3d0eeaf7 100644 --- a/rtgui/editorpanel.h +++ b/rtgui/editorpanel.h @@ -67,6 +67,12 @@ public: { parent = p; } + + void setParentWindow (Gtk::Window* p) + { + parentWindow = p; + } + void writeOptions(); void showTopPanel (bool show); @@ -196,6 +202,7 @@ private: HistogramPanel* histogramPanel; ToolPanelCoordinator* tpc; RTWindow* parent; + Gtk::Window* parentWindow; //SaveAsDialog* saveAsDialog; FilePanel* fPanel; diff --git a/rtgui/editwindow.cc b/rtgui/editwindow.cc index 1d08ac783..36340f7a6 100644 --- a/rtgui/editwindow.cc +++ b/rtgui/editwindow.cc @@ -124,6 +124,7 @@ void EditWindow::on_mainNB_switch_page(Gtk::Widget* widget, guint page_num) void EditWindow::addEditorPanel (EditorPanel* ep, const std::string &name) { ep->setParent (parent); + ep->setParentWindow(this); // construct closeable tab for the image Gtk::HBox* hb = Gtk::manage (new Gtk::HBox ()); diff --git a/rtgui/rtwindow.cc b/rtgui/rtwindow.cc index 5edfb3b25..567739791 100644 --- a/rtgui/rtwindow.cc +++ b/rtgui/rtwindow.cc @@ -146,6 +146,7 @@ RTWindow::RTWindow () if(simpleEditor) { epanel = Gtk::manage( new EditorPanel (nullptr) ); epanel->setParent (this); + epanel->setParentWindow(this); add (*epanel); show_all (); @@ -387,6 +388,7 @@ void RTWindow::addEditorPanel (EditorPanel* ep, const std::string &name) wndEdit->addEditorPanel(ep, name); } else { ep->setParent (this); + ep->setParentWindow(this); // construct closeable tab for the image Gtk::Grid* titleGrid = Gtk::manage (new Gtk::Grid ()); @@ -868,6 +870,7 @@ void RTWindow::createSetmEditor() // Editor panel, single-tab mode only epanel = Gtk::manage ( new EditorPanel (fpanel) ); epanel->setParent (this); + epanel->setParentWindow(this); // decorate tab Gtk::Grid* const editorLabelGrid = Gtk::manage (new Gtk::Grid ());