Commit 71cf2820 authored by Erwan Croze's avatar Erwan Croze 👋🏻
Browse files

Set focus on textfield when loading a chatroom

parent d1f2b1d2
......@@ -1031,6 +1031,21 @@ void on_proxy_refresh_button_clicked(GtkWidget *w){
}
}
static gboolean grab_focus(GtkWidget *w){
gtk_widget_grab_focus(w);
return FALSE;
}
void linphone_gtk_viewswitch_changed(GtkNotebook *notebook, GtkWidget *page, guint page_num, gpointer user_data){
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");
if (page_num == gtk_notebook_page_num(GTK_NOTEBOOK(notebook),w)) {
g_idle_add((GSourceFunc)grab_focus,linphone_gtk_get_widget(page,"text_entry"));
}
}
static void linphone_gtk_notify_recv(LinphoneCore *lc, LinphoneFriend * fid){
linphone_gtk_show_friends();
}
......
......@@ -167,8 +167,8 @@
<property name="can_focus">False</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
<signal name="activate" handler="linphone_gtk_show_parameters" swapped="no"/>
<accelerator key="p" signal="activate" modifiers="GDK_CONTROL_MASK"/>
<signal name="activate" handler="linphone_gtk_show_parameters" swapped="no"/>
</object>
</child>
<child>
......@@ -650,6 +650,7 @@
<object class="GtkNotebook" id="viewswitch">
<property name="visible">True</property>
<property name="can_focus">True</property>
<signal name="switch-page" handler="linphone_gtk_viewswitch_changed" swapped="no"/>
<child>
<placeholder/>
</child>
......
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