diff --git a/src/conversationsview.cpp b/src/conversationsview.cpp index 7cffdafa4b37638411377e8528ab4165fb84aa1f..856ce28a4373fbf1573655e25124e2169a100024 100644 --- a/src/conversationsview.cpp +++ b/src/conversationsview.cpp @@ -563,6 +563,8 @@ build_conversations_view(ConversationsView *self) gtk_tree_view_set_model(GTK_TREE_VIEW(self), GTK_TREE_MODEL(model)); + gtk_tree_view_set_enable_search(GTK_TREE_VIEW(self), false); + // ringId method column auto area = gtk_cell_area_box_new(); auto column = gtk_tree_view_column_new_with_area(area); diff --git a/src/currentcallview.cpp b/src/currentcallview.cpp index 9f223b5599a4fb27a38a02e23202fc9e6e7c803f..01ce17b9c74d6ea1d6a68901b0a65609c3deab7c 100644 --- a/src/currentcallview.cpp +++ b/src/currentcallview.cpp @@ -1294,3 +1294,11 @@ current_call_view_new(WebKitChatContainer* chat_widget, priv->cpp->setup(chat_widget, accountInfo, conversation, avModel); return GTK_WIDGET(self); } + +void +current_call_view_handup_focus(GtkWidget *current_call_view) +{ + auto* priv = CURRENT_CALL_VIEW_GET_PRIVATE(current_call_view); + gtk_widget_set_can_focus (priv->button_hangup, true); + gtk_widget_grab_focus(priv->button_hangup); +} diff --git a/src/currentcallview.h b/src/currentcallview.h index 5347561269a859cca7b1340deb852480b7824b7c..58568412c63c7c07aa769fda5cdd5ea9c7636492 100644 --- a/src/currentcallview.h +++ b/src/currentcallview.h @@ -58,5 +58,6 @@ GtkWidget *current_call_view_new (WebKitChatContainer* view, lrc::api::conversation::Info current_call_view_get_conversation(CurrentCallView*); GtkWidget *current_call_view_get_chat_view(CurrentCallView*); void current_call_view_show_chat(CurrentCallView*); +void current_call_view_handup_focus(GtkWidget *current_call_view); G_END_DECLS diff --git a/src/ringmainwindow.cpp b/src/ringmainwindow.cpp index 0d63bd37be5a763990470c10e4446e6425d352a7..26bfe49abd07c647650979bba551a25ae48f0bee 100644 --- a/src/ringmainwindow.cpp +++ b/src/ringmainwindow.cpp @@ -604,6 +604,15 @@ on_search_entry_key_released(G_GNUC_UNUSED GtkEntry* search_entry, GdkEventKey* return GDK_EVENT_PROPAGATE; } +static gboolean +on_current_call_clicked(GtkWidget *widget, G_GNUC_UNUSED GdkEventButton *event) +{ + // once mouse is clicked, grab the focus + gtk_widget_set_can_focus (widget, true); + gtk_widget_grab_focus(widget); + return GDK_EVENT_PROPAGATE; +} + static gboolean on_dtmf_pressed(RingMainWindow* self, GdkEventKey* event, gpointer user_data) { @@ -1347,6 +1356,11 @@ CppImpl::changeView(GType type, lrc::api::conversation::Info conversation) conversations_view_select_conversation( CONVERSATIONS_VIEW(widgets->treeview_conversations), conversation.uid); + + // grab focus for handup button for current call view + if (g_type_is_a(CURRENT_CALL_VIEW_TYPE, type)){ + current_call_view_handup_focus(new_view); + } } GtkWidget* @@ -1388,6 +1402,7 @@ CppImpl::displayCurrentCallView(lrc::api::conversation::Info conversation, bool g_signal_connect_swapped(new_view, "video-double-clicked", G_CALLBACK(on_video_double_clicked), self); + g_signal_connect(new_view, "button-press-event", G_CALLBACK(on_current_call_clicked), nullptr); return new_view; }