Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
liblinphone
Commits
6fab1343
Commit
6fab1343
authored
Oct 22, 2015
by
François Grisez
Browse files
Gtk: Optimize the update of transient buttons in the friend list
parent
e9c787b7
Changes
2
Hide whitespace changes
Inline
Side-by-side
gtk/friendlist.c
View file @
6fab1343
...
...
@@ -981,29 +981,39 @@ void linphone_gtk_buddy_info_updated(LinphoneCore *lc, LinphoneFriend *lf){
linphone_gtk_show_friends
();
}
static
void
update_hovered_row_path
(
GtkTreeView
*
friendlist
,
int
x_window
,
int
y_window
)
{
static
gboolean
update_hovered_row_path
(
GtkTreeView
*
friendlist
,
int
x_window
,
int
y_window
)
{
int
x_bin
,
y_bin
;
GtkTreePath
*
path
;
GtkTreePath
*
new_path
;
GtkTreePath
*
old_path
=
(
GtkTreePath
*
)
g_object_get_data
(
G_OBJECT
(
friendlist
),
"hovered_row"
);
gtk_tree_view_convert_widget_to_bin_window_coords
(
friendlist
,
x_window
,
y_window
,
&
x_bin
,
&
y_bin
);
gtk_tree_view_get_path_at_pos
(
friendlist
,
x_bin
,
y_bin
,
&
path
,
NULL
,
NULL
,
NULL
);
g_object_set_data_full
(
G_OBJECT
(
friendlist
),
"hovered_row"
,
path
,
(
GDestroyNotify
)
gtk_tree_path_free
);
gtk_tree_view_get_path_at_pos
(
friendlist
,
x_bin
,
y_bin
,
&
new_path
,
NULL
,
NULL
,
NULL
);
if
((
new_path
==
NULL
&&
old_path
==
NULL
)
||
(
new_path
&&
old_path
&&
gtk_tree_path_compare
(
new_path
,
old_path
)
==
0
))
{
if
(
new_path
)
gtk_tree_path_free
(
new_path
);
return
FALSE
;
}
else
{
g_object_set_data_full
(
G_OBJECT
(
friendlist
),
"hovered_row"
,
new_path
,
(
GDestroyNotify
)
gtk_tree_path_free
);
return
TRUE
;
}
}
gboolean
linphone_gtk_friend_list_enter_event_handler
(
GtkTreeView
*
friendlist
,
GdkEventCrossing
*
event
)
{
update_hovered_row_path
(
friendlist
,
event
->
x
,
event
->
y
);
linphone_gtk_friend_list_update_button_display
(
friendlist
);
gboolean
path_has_changed
=
update_hovered_row_path
(
friendlist
,
event
->
x
,
event
->
y
);
if
(
path_has_changed
)
linphone_gtk_friend_list_update_button_display
(
friendlist
);
return
FALSE
;
}
gboolean
linphone_gtk_friend_list_leave_event_handler
(
GtkTreeView
*
friendlist
,
GdkEventCrossing
*
event
)
{
g_object_set_data
(
G_OBJECT
(
friendlist
),
"hovered_row"
,
NULL
);
linphone_gtk_friend_list_update_button_display
(
friendlist
);
GtkTreePath
*
hovered_row
=
(
GtkTreePath
*
)
g_object_get_data
(
G_OBJECT
(
friendlist
),
"hovered_row"
);
if
(
hovered_row
)
{
g_object_set_data
(
G_OBJECT
(
friendlist
),
"hovered_row"
,
NULL
);
linphone_gtk_friend_list_update_button_display
(
friendlist
);
}
return
FALSE
;
}
gboolean
linphone_gtk_friend_list_motion_event_handler
(
GtkTreeView
*
friendlist
,
GdkEventMotion
*
event
)
{
update_hovered_row_path
(
friendlist
,
event
->
x
,
event
->
y
);
linphone_gtk_friend_list_update_button_display
(
friendlist
);
gboolean
path_has_changed
=
update_hovered_row_path
(
friendlist
,
event
->
x
,
event
->
y
);
if
(
path_has_changed
)
linphone_gtk_friend_list_update_button_display
(
friendlist
);
return
FALSE
;
}
tester/multi_call_tester.c
View file @
6fab1343
...
...
@@ -621,8 +621,6 @@ static void eject_from_4_participants_conference(void) {
LinphoneCoreManager
*
laure
=
linphone_core_manager_new
(
"laure_rc"
);
LinphoneCoreManager
*
michelle
=
linphone_core_manager_new
(
"michelle_rc"
);
int
timeout_ms
=
5000
;
stats
initial_marie_stat
;
stats
initial_pauline_stat
;
stats
initial_laure_stat
;
stats
initial_michelle_stat
;
...
...
@@ -647,8 +645,6 @@ static void eject_from_4_participants_conference(void) {
BC_ASSERT_TRUE
(
pause_call_1
(
marie
,
marie_call_michelle
,
michelle
,
michelle_called_by_marie
));
BC_ASSERT_TRUE
(
call
(
marie
,
laure
));
initial_marie_stat
=
marie
->
stat
;
initial_pauline_stat
=
pauline
->
stat
;
initial_laure_stat
=
laure
->
stat
;
initial_michelle_stat
=
michelle
->
stat
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment