Commit 68bc012e authored by Hugo Lefeuvre's avatar Hugo Lefeuvre Committed by Sébastien Blin

fix: close preferences when going to background

Whenever we go to background and preferences are open, close
the preferences view before. This avoids the annoying situation
where ring is in preview mode and the camera continues recording
the user.

Change-Id: I10bcb2f8b46c5750757763913fcd6b0e1e635302
Tuleap: #1851
Reviewed-by: Sébastien Blin's avatarSébastien Blin <sebastien.blin@savoirfairelinux.com>
parent a8f91152
......@@ -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 */
......
......@@ -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
......
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment