Actions
Bug #2186
openGTK4 Client consumme 100% CPU (at least on debian with GTK 4.18)
Start date:
08/30/2026
Due date:
% Done:
0%
Estimated time:
Description
I found that among other issues, the GTK4 client was eating 100% of the CPU.
Digging around with GDB pinpoint to a cascade of events. I solve it by blocking/unblocking them in plrdlg.c (from code version 3.2.5) :
866 void real_players_dialog_update(void *unused)
867 {
868 GtkTreeModel *model;
869 GtkTreeIter iter;
870 int selected;
871
872 if (NULL == players_dialog_shell) {
873 return;
874 }
875
876 /* Save the selection. */
877 if (gtk_tree_selection_get_selected(players_selection, &model, &iter)) {
878 gtk_tree_model_get(model, &iter, PLR_DLG_COL_ID, &selected, -1);
879 } else {
880 selected = -1;
881 }
882
883 g_signal_handlers_block_by_func(players_selection, G_CALLBACK(selection_callback), NULL);
884 gtk_list_store_clear(players_dialog_store);
885 players_iterate(pplayer) {
886 if (!player_should_be_shown(pplayer)) {
887 continue;
888 }
889 gtk_list_store_append(players_dialog_store, &iter);
890 fill_row(players_dialog_store, &iter, pplayer);
891 if (player_number(pplayer) == selected) {
892 /* Restore the selection. */
893 gtk_tree_selection_select_iter(players_selection, &iter);
894 }
895 } players_iterate_end;
896
897 update_views();
898 g_signal_handlers_unblock_by_func(players_selection, G_CALLBACK(selection_callback), NULL);
899 }
running the new version so CPU back to normal ...
As I am not an expert in GUI, I let you decide if this is the right fix or not :).
Best regards.
Actions