diff --git a/src/ring_client.cpp b/src/ring_client.cpp index f123c8d5ef04a825a97101d623baefb6ff6d4195..ed2f33f5b0f1538fd9f1ce87a67db172938c0af1 100644 --- a/src/ring_client.cpp +++ b/src/ring_client.cpp @@ -253,6 +253,7 @@ on_close_window(GtkWidget *window, G_GNUC_UNUSED GdkEvent *event, RingClient *cl if (g_settings_get_boolean(priv->settings, "show-status-icon")) { /* we want to simply hide the window and keep the client running */ ring_window_hide(client); + ring_main_window_reset(RING_MAIN_WINDOW(window)); return TRUE; /* do not propogate event */ } else { /* we want to quit the application, so just propogate the event */ diff --git a/src/ringmainwindow.cpp b/src/ringmainwindow.cpp index eac63185967f6dc2b70f0d61ecf32e687d96e742..cd434c989fd7aeb99376fadbf6a4c6421a73d0b6 100644 --- a/src/ringmainwindow.cpp +++ b/src/ringmainwindow.cpp @@ -1452,6 +1452,15 @@ CppImpl::slotShowIncomingCallView(const std::string& id, lrc::api::conversation: }} // namespace <anonymous>::details +void +ring_main_window_reset(RingMainWindow* self) +{ + g_return_if_fail(IS_RING_MAIN_WINDOW(self)); + auto* priv = RING_MAIN_WINDOW_GET_PRIVATE(RING_MAIN_WINDOW(self)); + if (priv->cpp->show_settings) + priv->cpp->leaveSettingsView(); +} + //============================================================================== static void diff --git a/src/ringmainwindow.h b/src/ringmainwindow.h index 38195095cbd2510268683e93b392ca1943a07b9a..d7e7f033a44c4d19a1d872e097570022c4ca2626 100644 --- a/src/ringmainwindow.h +++ b/src/ringmainwindow.h @@ -37,6 +37,7 @@ typedef struct _RingMainWindowClass RingMainWindowClass; GType ring_main_window_get_type (void) G_GNUC_CONST; GtkWidget *ring_main_window_new (GtkApplication *app); +void ring_main_window_reset (RingMainWindow *win); G_END_DECLS