mirror of
https://gitlab.gnome.org/GNOME/calls.git
synced 2024-12-14 00:17:35 +00:00
call-window: Take ui-active property into account
Only show the display after the "pre-ring" phase has passed. Fixes #371
This commit is contained in:
parent
93cf894a8c
commit
3d85ef802f
1 changed files with 40 additions and 2 deletions
|
@ -176,8 +176,8 @@ call_selector_child_activated_cb (GtkFlowBox *box,
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
add_call (CallsCallWindow *self,
|
add_call_to_window (CallsCallWindow *self,
|
||||||
CallsUiCallData *ui_call_data)
|
CallsUiCallData *ui_call_data)
|
||||||
{
|
{
|
||||||
CuiCall *call = (CuiCall *) ui_call_data;
|
CuiCall *call = (CuiCall *) ui_call_data;
|
||||||
CuiCallDisplay *display;
|
CuiCallDisplay *display;
|
||||||
|
@ -197,6 +197,42 @@ add_call (CallsCallWindow *self,
|
||||||
set_focus (self, display);
|
set_focus (self, display);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
on_call_notify_active_ui (CallsUiCallData *call,
|
||||||
|
GParamSpec *unused,
|
||||||
|
CallsCallWindow *self)
|
||||||
|
{
|
||||||
|
g_assert (CALLS_IS_CALL_WINDOW (self));
|
||||||
|
g_assert (CALLS_IS_UI_CALL_DATA (call));
|
||||||
|
|
||||||
|
if (!calls_ui_call_data_get_ui_active (call)) {
|
||||||
|
g_warning ("UI for a call should never switch back to being inactive");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
add_call_to_window (self, call);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
add_call (CallsCallWindow *self,
|
||||||
|
CallsUiCallData *call)
|
||||||
|
{
|
||||||
|
g_assert (CALLS_IS_CALL_WINDOW (self));
|
||||||
|
g_assert (CALLS_IS_UI_CALL_DATA (call));
|
||||||
|
|
||||||
|
if (calls_ui_call_data_get_ui_active (call)) {
|
||||||
|
add_call_to_window (self, call);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
g_signal_connect (call,
|
||||||
|
"notify::ui-active",
|
||||||
|
G_CALLBACK (on_call_notify_active_ui),
|
||||||
|
self);
|
||||||
|
}
|
||||||
|
|
||||||
struct DisplayData
|
struct DisplayData
|
||||||
{
|
{
|
||||||
GtkStack *call_stack;
|
GtkStack *call_stack;
|
||||||
|
@ -225,6 +261,8 @@ remove_call (CallsCallWindow *self,
|
||||||
g_assert (CALLS_IS_CALL_WINDOW (self));
|
g_assert (CALLS_IS_CALL_WINDOW (self));
|
||||||
g_assert (CALLS_IS_UI_CALL_DATA (ui_call_data));
|
g_assert (CALLS_IS_UI_CALL_DATA (ui_call_data));
|
||||||
|
|
||||||
|
g_signal_handlers_disconnect_by_data (ui_call_data, self);
|
||||||
|
|
||||||
n_calls = g_list_model_get_n_items (G_LIST_MODEL (self->calls));
|
n_calls = g_list_model_get_n_items (G_LIST_MODEL (self->calls));
|
||||||
for (guint i = 0; i < n_calls; i++) {
|
for (guint i = 0; i < n_calls; i++) {
|
||||||
g_autoptr (CallsCallSelectorItem) item =
|
g_autoptr (CallsCallSelectorItem) item =
|
||||||
|
|
Loading…
Reference in a new issue