Skip to content

Commit

Permalink
Show also the engine name in the title of the setup tool window
Browse files Browse the repository at this point in the history
I.e. instead of just “Preferences” show something like “Preferences
m17n:t:latn-post”.
  • Loading branch information
mike-fabian committed Aug 5, 2022
1 parent 22546a7 commit cbb6e79
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -658,11 +658,15 @@ setup_dialog_free (SetupDialog *dialog)
g_slice_free (SetupDialog, dialog);
}

#define WINDOW_TITLE_SIZE 500

static void
start (const gchar *engine_name)
{
gchar **strv;
SetupDialog *dialog;
const gchar *base_window_title;
gchar full_window_title[WINDOW_TITLE_SIZE] = "";

ibus_init ();
ibus_m17n_init_common ();
Expand All @@ -677,6 +681,14 @@ start (const gchar *engine_name)

setup_dialog_load_config (dialog);

base_window_title = gtk_window_get_title(GTK_WINDOW (dialog->dialog));
strncat(full_window_title, base_window_title,
WINDOW_TITLE_SIZE - 1);
strncat(full_window_title, " ",
WINDOW_TITLE_SIZE - strlen(base_window_title) - 1);
strncat(full_window_title, engine_name,
WINDOW_TITLE_SIZE - strlen(base_window_title) - 2);
gtk_window_set_title(GTK_WINDOW (dialog->dialog), full_window_title);
gtk_window_present (GTK_WINDOW (dialog->dialog));
gtk_dialog_run (GTK_DIALOG (dialog->dialog));

Expand Down

0 comments on commit cbb6e79

Please sign in to comment.