Skip to content
Snippets Groups Projects
Commit 68bc012e authored by Hugo Lefeuvre's avatar Hugo Lefeuvre Committed by Sébastien Blin
Browse files

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: default avatarSébastien Blin <sebastien.blin@savoirfairelinux.com>
parent a8f91152
No related branches found
No related tags found
No related merge requests found
...@@ -253,6 +253,7 @@ on_close_window(GtkWidget *window, G_GNUC_UNUSED GdkEvent *event, RingClient *cl ...@@ -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")) { if (g_settings_get_boolean(priv->settings, "show-status-icon")) {
/* we want to simply hide the window and keep the client running */ /* we want to simply hide the window and keep the client running */
ring_window_hide(client); ring_window_hide(client);
ring_main_window_reset(RING_MAIN_WINDOW(window));
return TRUE; /* do not propogate event */ return TRUE; /* do not propogate event */
} else { } else {
/* we want to quit the application, so just propogate the event */ /* we want to quit the application, so just propogate the event */
......
...@@ -1452,6 +1452,15 @@ CppImpl::slotShowIncomingCallView(const std::string& id, lrc::api::conversation: ...@@ -1452,6 +1452,15 @@ CppImpl::slotShowIncomingCallView(const std::string& id, lrc::api::conversation:
}} // namespace <anonymous>::details }} // 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 static void
......
...@@ -37,6 +37,7 @@ typedef struct _RingMainWindowClass RingMainWindowClass; ...@@ -37,6 +37,7 @@ typedef struct _RingMainWindowClass RingMainWindowClass;
GType ring_main_window_get_type (void) G_GNUC_CONST; GType ring_main_window_get_type (void) G_GNUC_CONST;
GtkWidget *ring_main_window_new (GtkApplication *app); GtkWidget *ring_main_window_new (GtkApplication *app);
void ring_main_window_reset (RingMainWindow *win);
G_END_DECLS G_END_DECLS
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment