mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-05-07 05:53:06 +00:00
gtk: mark current chat as read when application gains focus
This commit is contained in:
parent
b711888ac0
commit
743f1a619b
1 changed files with 14 additions and 0 deletions
14
gtk/chat.c
14
gtk/chat.c
|
|
@ -460,6 +460,17 @@ static gboolean copy_uri_into_clipboard_handler(GtkMenuItem *menuitem, gpointer
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
static void linphone_gtk_window_focused(void) {
|
||||
// if we are in a chat, mark it as read
|
||||
GtkWidget *main_window=linphone_gtk_get_main_window();
|
||||
GtkWidget *friendlist=linphone_gtk_get_widget(main_window,"contact_list");
|
||||
GtkWidget *w=(GtkWidget*)g_object_get_data(G_OBJECT(friendlist),"chatview");
|
||||
LinphoneChatRoom *cr=w?g_object_get_data(G_OBJECT(w),"cr"):NULL;
|
||||
if (cr) {
|
||||
linphone_gtk_mark_chat_read(cr);
|
||||
}
|
||||
}
|
||||
|
||||
GtkWidget* linphone_gtk_init_chatroom(LinphoneChatRoom *cr, const LinphoneAddress *with){
|
||||
GtkWidget *chat_view=linphone_gtk_create_widget("chatroom_frame");
|
||||
GtkWidget *main_window=linphone_gtk_get_main_window();
|
||||
|
|
@ -536,6 +547,9 @@ GtkWidget* linphone_gtk_init_chatroom(LinphoneChatRoom *cr, const LinphoneAddres
|
|||
g_signal_connect_swapped(G_OBJECT(entry),"activate",(GCallback)linphone_gtk_send_text,NULL);
|
||||
g_signal_connect_swapped(G_OBJECT(entry),"changed",(GCallback)linphone_gtk_compose_text,NULL);
|
||||
g_signal_connect(G_OBJECT(notebook),"switch_page",(GCallback)linphone_gtk_notebook_tab_select,NULL);
|
||||
|
||||
g_signal_connect(G_OBJECT(main_window), "focus-in-event", G_CALLBACK(linphone_gtk_window_focused), NULL);
|
||||
|
||||
return chat_view;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue