Skip to content

Commit

Permalink
Protect all text entries from single-key shortcuts/accels
Browse files Browse the repository at this point in the history
Disable shortcuts when grabing focus, re-enable them when loosing it.
  • Loading branch information
aurelienpierre committed Jan 30, 2025
1 parent 8c1403c commit d3c8934
Show file tree
Hide file tree
Showing 25 changed files with 109 additions and 23 deletions.
4 changes: 4 additions & 0 deletions src/common/import.c
Original file line number Diff line number Diff line change
Expand Up @@ -1068,6 +1068,7 @@ static void gui_init(dt_lib_import_t *d)
GtkWidget *calendar_label = gtk_label_new(_("Project date"));
gtk_widget_set_halign(calendar_label, GTK_ALIGN_START);
d->datetime = gtk_entry_new();
dt_accels_disconnect_on_text_input(d->datetime);
gtk_entry_set_width_chars(GTK_ENTRY(d->datetime), 20);
g_signal_connect(G_OBJECT(d->datetime), "changed", G_CALLBACK(_datetime_changed_callback), d);

Expand All @@ -1090,6 +1091,7 @@ static void gui_init(dt_lib_import_t *d)

// Base directory of projects
GtkWidget *jobcode = gtk_entry_new();
dt_accels_disconnect_on_text_input(jobcode);
gtk_entry_set_text(GTK_ENTRY(jobcode), dt_conf_get_string("ui_last/import_jobcode"));
gtk_widget_set_hexpand(jobcode, TRUE);
g_signal_connect(G_OBJECT(jobcode), "changed", G_CALLBACK(_jobcode_changed), d);
Expand All @@ -1116,13 +1118,15 @@ static void gui_init(dt_lib_import_t *d)
GtkWidget *sep2 = gtk_label_new(G_DIR_SEPARATOR_S);

GtkWidget *project_dir = gtk_entry_new();
dt_accels_disconnect_on_text_input(project_dir);
gtk_entry_set_text(GTK_ENTRY(project_dir), dt_conf_get_string("session/sub_directory_pattern"));
gtk_widget_set_hexpand(project_dir, TRUE);
dt_gtkentry_setup_completion(GTK_ENTRY(project_dir), dt_gtkentry_get_default_path_compl_list());
gtk_widget_set_tooltip_text(project_dir, _("Start typing `$(` to see available variables through auto-completion"));
g_signal_connect(G_OBJECT(project_dir), "changed", G_CALLBACK(_project_dir_changed), d);

GtkWidget *file = gtk_entry_new();
dt_accels_disconnect_on_text_input(file);
gtk_entry_set_text(GTK_ENTRY(file), dt_conf_get_string("session/filename_pattern"));
gtk_widget_set_hexpand(file, TRUE);
dt_gtkentry_setup_completion(GTK_ENTRY(file), dt_gtkentry_get_default_path_compl_list());
Expand Down
1 change: 1 addition & 0 deletions src/develop/imageop.c
Original file line number Diff line number Diff line change
Expand Up @@ -803,6 +803,7 @@ void dt_iop_gui_rename_module(dt_iop_module_t *module)
if(focused && GTK_IS_ENTRY(focused)) return;

GtkWidget *entry = gtk_entry_new();
dt_accels_disconnect_on_text_input(entry);

gtk_widget_set_name(entry, "iop-panel-label");
gtk_entry_set_width_chars(GTK_ENTRY(entry), 0);
Expand Down
28 changes: 28 additions & 0 deletions src/gui/gtk.c
Original file line number Diff line number Diff line change
Expand Up @@ -1191,6 +1191,8 @@ char *dt_gui_show_standalone_string_dialog(const char *title, const char *markup
gtk_box_pack_start(GTK_BOX(vbox), label, TRUE, TRUE, 0);

GtkWidget *entry = gtk_entry_new();
dt_accels_disconnect_on_text_input(entry);

g_object_ref(entry);
if(placeholder)
gtk_entry_set_placeholder_text(GTK_ENTRY(entry), placeholder);
Expand Down Expand Up @@ -1890,6 +1892,32 @@ GtkBox * attach_help_popover(GtkWidget *widget, const char *label)
return attach_popover(widget, "help-about", popover_label);
}

static gboolean _text_entry_focus_in_event(GtkWidget *self, GdkEventFocus event, gpointer user_data)
{
gtk_window_remove_accel_group(GTK_WINDOW(dt_ui_main_window(darktable.gui->ui)), darktable.gui->accels->global_accels);
return FALSE;
}

static gboolean _text_entry_focus_out_event(GtkWidget *self, GdkEventFocus event, gpointer user_data)
{
gtk_window_add_accel_group(GTK_WINDOW(dt_ui_main_window(darktable.gui->ui)), darktable.gui->accels->global_accels);
return FALSE;
}

static gboolean _text_entry_key_pressed(GtkWidget *widget, GdkEventKey *event, gpointer user_data)
{
if(event->keyval == GDK_KEY_Escape) gtk_widget_grab_focus(dt_ui_center(darktable.gui->ui));
return FALSE;
}

void dt_accels_disconnect_on_text_input(GtkWidget *widget)
{
gtk_widget_add_events(widget, GDK_FOCUS_CHANGE_MASK);
g_signal_connect(G_OBJECT(widget), "focus-in-event", G_CALLBACK(_text_entry_focus_in_event), NULL);
g_signal_connect(G_OBJECT(widget), "focus-out-event", G_CALLBACK(_text_entry_focus_out_event), NULL);
g_signal_connect(G_OBJECT(widget), "key-press-event", G_CALLBACK(_text_entry_key_pressed), NULL);
}

// clang-format off
// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
// vim: shiftwidth=2 expandtab tabstop=2 cindent
Expand Down
9 changes: 9 additions & 0 deletions src/gui/gtk.h
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,15 @@ GtkBox *attach_popover(GtkWidget *widget, const char *icon, GtkWidget *content);
GtkBox *attach_help_popover(GtkWidget *widget, const char *label);


/**
* @brief Disconnects accels when a text or search entry gets the focus,
* and reconnects them when it looses it. This helps dealing with one-key shortcuts.
*
* @param widget
*/
void dt_accels_disconnect_on_text_input(GtkWidget *widget);


// clang-format off
// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
// vim: shiftwidth=2 expandtab tabstop=2 cindent
Expand Down
4 changes: 4 additions & 0 deletions src/gui/import_metadata.c
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,8 @@ void dt_import_metadata_init(dt_import_metadata_t *metadata)
labelev = _set_up_label(metadata_label, GTK_ALIGN_START, i + DT_META_META_VALUE, metadata);

GtkWidget *metadata_entry = gtk_entry_new();
dt_accels_disconnect_on_text_input(metadata_entry);

setting = g_strdup_printf("ui_last/import_last_%s", metadata_name);
const char *str = dt_conf_get_string_const(setting);
_set_up_entry(metadata_entry, str, metadata_name, i + DT_META_META_VALUE, metadata);
Expand Down Expand Up @@ -477,6 +479,8 @@ void dt_import_metadata_init(dt_import_metadata_t *metadata)
labelev = _set_up_label(label, GTK_ALIGN_START, DT_META_TAGS_VALUE, metadata);

GtkWidget *entry = gtk_entry_new();
dt_accels_disconnect_on_text_input(entry);

gtk_widget_set_visible(entry, TRUE);
const char *str = dt_conf_get_string_const("ui_last/import_last_tags");
_set_up_entry(entry, str, "tags", DT_META_TAGS_VALUE, metadata);
Expand Down
3 changes: 3 additions & 0 deletions src/gui/preferences.c
Original file line number Diff line number Diff line change
Expand Up @@ -831,6 +831,8 @@ static void init_tab_presets(GtkWidget *stack)
gtk_widget_set_name(hbox, "preset_controls");

GtkWidget *search_presets = gtk_search_entry_new();
dt_accels_disconnect_on_text_input(search_presets);

gtk_box_pack_start(GTK_BOX(hbox), search_presets, FALSE, TRUE, 0);
gtk_entry_set_placeholder_text(GTK_ENTRY(search_presets), _("search presets list"));
gtk_widget_set_tooltip_text(GTK_WIDGET(search_presets), _("incrementally search the list of presets\npress up or down keys to cycle through matches"));
Expand Down Expand Up @@ -1358,6 +1360,7 @@ GtkWidget *dt_gui_preferences_string(GtkGrid *grid, const char *key, const guint
gtk_container_add(GTK_CONTAINER(labelev), w_label);

GtkWidget *w = gtk_entry_new();
dt_accels_disconnect_on_text_input(w);
const char *str = dt_conf_get_string_const(key);
gtk_entry_set_text(GTK_ENTRY(w), str);
gtk_widget_set_hexpand(w, TRUE);
Expand Down
5 changes: 5 additions & 0 deletions src/gui/presets.c
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@ static void _presets_show_edit_dialog(dt_gui_presets_edit_dialog_t *g, gboolean
gtk_container_add(content_area, GTK_WIDGET(box));

g->name = GTK_ENTRY(gtk_entry_new());
dt_accels_disconnect_on_text_input(GTK_WIDGET(g->name));
gtk_entry_set_text(g->name, g->original_name);
if(allow_name_change)
gtk_entry_set_activates_default(g->name, TRUE);
Expand All @@ -462,6 +463,7 @@ static void _presets_show_edit_dialog(dt_gui_presets_edit_dialog_t *g, gboolean
gtk_widget_set_tooltip_text(GTK_WIDGET(g->name), _("name of the preset"));

g->description = GTK_ENTRY(gtk_entry_new());
dt_accels_disconnect_on_text_input(GTK_WIDGET(g->description));
if(allow_desc_change)
gtk_entry_set_activates_default(g->description, TRUE);
else
Expand Down Expand Up @@ -497,6 +499,7 @@ static void _presets_show_edit_dialog(dt_gui_presets_edit_dialog_t *g, gboolean

// model, maker, lens
g->model = gtk_entry_new();
dt_accels_disconnect_on_text_input(g->model);
gtk_widget_set_hexpand(GTK_WIDGET(g->model), TRUE);
/* xgettext:no-c-format */
gtk_widget_set_tooltip_text(g->model, _("string to match model (use % as wildcard)"));
Expand All @@ -506,6 +509,7 @@ static void _presets_show_edit_dialog(dt_gui_presets_edit_dialog_t *g, gboolean
gtk_grid_attach_next_to(GTK_GRID(g->details), g->model, label, GTK_POS_RIGHT, 2, 1);

g->maker = gtk_entry_new();
dt_accels_disconnect_on_text_input(g->maker);
/* xgettext:no-c-format */
gtk_widget_set_tooltip_text(g->maker, _("string to match maker (use % as wildcard)"));
label = gtk_label_new(_("maker"));
Expand All @@ -514,6 +518,7 @@ static void _presets_show_edit_dialog(dt_gui_presets_edit_dialog_t *g, gboolean
gtk_grid_attach_next_to(GTK_GRID(g->details), g->maker, label, GTK_POS_RIGHT, 2, 1);

g->lens = gtk_entry_new();
dt_accels_disconnect_on_text_input(g->lens);
/* xgettext:no-c-format */
gtk_widget_set_tooltip_text(g->lens, _("string to match lens (use % as wildcard)"));
label = gtk_label_new(_("lens"));
Expand Down
2 changes: 2 additions & 0 deletions src/gui/styles_dialog.c
Original file line number Diff line number Diff line change
Expand Up @@ -444,10 +444,12 @@ static void _gui_styles_dialog_run(gboolean edit, const char *name, int imgid)
gtk_container_add(GTK_CONTAINER(scroll), GTK_WIDGET(sbox));

sd->name = gtk_entry_new();
dt_accels_disconnect_on_text_input(sd->name);
gtk_entry_set_placeholder_text(GTK_ENTRY(sd->name), _("name"));
gtk_widget_set_tooltip_text(sd->name, _("enter a name for the new style"));

sd->description = gtk_entry_new();
dt_accels_disconnect_on_text_input(sd->description);
gtk_entry_set_placeholder_text(GTK_ENTRY(sd->description), _("description"));
gtk_widget_set_tooltip_text(sd->description,
_("enter a description for the new style, this description is searchable"));
Expand Down
2 changes: 2 additions & 0 deletions src/imageio/format/pdf.c
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,7 @@ void gui_init(dt_imageio_module_format_t *self)
gtk_grid_attach(grid, dt_ui_label_new(_("title")), 0, ++line, 1, 1);

d->title = GTK_ENTRY(gtk_entry_new());
dt_accels_disconnect_on_text_input(GTK_WIDGET(d->title));
gtk_entry_set_placeholder_text(d->title, "untitled");
gtk_entry_set_width_chars(d->title, 5);
gtk_widget_set_hexpand(GTK_WIDGET(d->title), TRUE);
Expand Down Expand Up @@ -617,6 +618,7 @@ void gui_init(dt_imageio_module_format_t *self)
gtk_grid_attach(grid, dt_ui_label_new(_("border")), 0, ++line, 1, 1);

d->border = GTK_ENTRY(gtk_entry_new());
dt_accels_disconnect_on_text_input(GTK_WIDGET(d->border));
gtk_entry_set_width_chars(d->border, 5);
gtk_entry_set_max_length(d->border, sizeof(((dt_imageio_pdf_params_t *)NULL)->border) - 1);
gtk_entry_set_placeholder_text(d->border, "0 mm");
Expand Down
1 change: 1 addition & 0 deletions src/imageio/storage/disk.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ void gui_init(dt_imageio_module_storage_t *self)
gtk_box_pack_start(GTK_BOX(self->widget), GTK_WIDGET(hbox), TRUE, FALSE, 0);

widget = gtk_entry_new();
dt_accels_disconnect_on_text_input(widget);
gtk_box_pack_start(GTK_BOX(hbox), widget, TRUE, TRUE, 0);
const char *dir = dt_conf_get_string_const("plugins/imageio/storage/disk/file_directory");
if(dir)
Expand Down
2 changes: 2 additions & 0 deletions src/imageio/storage/gallery.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ void gui_init(dt_imageio_module_storage_t *self)
GtkWidget *widget;

widget = gtk_entry_new();
dt_accels_disconnect_on_text_input(widget);
gtk_entry_set_width_chars(GTK_ENTRY(widget), 0);
gtk_box_pack_start(GTK_BOX(hbox), widget, TRUE, TRUE, 0);
const char *dir = dt_conf_get_string_const("plugins/imageio/storage/gallery/file_directory");
Expand All @@ -177,6 +178,7 @@ void gui_init(dt_imageio_module_storage_t *self)
gtk_box_pack_start(GTK_BOX(self->widget), hbox, TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(hbox), dt_ui_label_new(_("title")), FALSE, FALSE, 0);
d->title_entry = GTK_ENTRY(gtk_entry_new());
dt_accels_disconnect_on_text_input(GTK_WIDGET(d->title_entry));
gtk_entry_set_width_chars(d->title_entry, 0);
gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(d->title_entry), TRUE, TRUE, 0);
gtk_widget_set_tooltip_text(GTK_WIDGET(d->title_entry), _("enter the title of the website"));
Expand Down
4 changes: 4 additions & 0 deletions src/imageio/storage/piwigo.c
Original file line number Diff line number Diff line change
Expand Up @@ -807,6 +807,7 @@ void gui_init(dt_imageio_module_storage_t *self)
// server
hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
ui->server_entry = GTK_ENTRY(gtk_entry_new());
dt_accels_disconnect_on_text_input(GTK_WIDGET(ui->server_entry));
gtk_widget_set_tooltip_text(GTK_WIDGET(ui->server_entry),
_("the server name\ndefault protocol is https\nspecify http:// if non secure server"));
gtk_widget_set_hexpand(GTK_WIDGET(ui->server_entry), TRUE);
Expand All @@ -821,6 +822,7 @@ void gui_init(dt_imageio_module_storage_t *self)
// login
hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
ui->user_entry = GTK_ENTRY(gtk_entry_new());
dt_accels_disconnect_on_text_input(GTK_WIDGET(ui->user_entry));
gtk_widget_set_hexpand(GTK_WIDGET(ui->user_entry), TRUE);
gtk_entry_set_text(ui->user_entry, last_account?last_account->username:"");
g_signal_connect(G_OBJECT(ui->user_entry), "changed", G_CALLBACK(_piwigo_entry_changed), (gpointer)ui);
Expand All @@ -832,6 +834,7 @@ void gui_init(dt_imageio_module_storage_t *self)
// password
hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
ui->pwd_entry = GTK_ENTRY(gtk_entry_new());
dt_accels_disconnect_on_text_input(GTK_WIDGET(ui->pwd_entry));
gtk_entry_set_visibility(GTK_ENTRY(ui->pwd_entry), FALSE);
gtk_widget_set_hexpand(GTK_WIDGET(ui->pwd_entry), TRUE);
gtk_entry_set_text(ui->pwd_entry, last_account?last_account->password:"");
Expand Down Expand Up @@ -895,6 +898,7 @@ void gui_init(dt_imageio_module_storage_t *self)
gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);

ui->new_album_entry = GTK_ENTRY(gtk_entry_new()); // Album title
dt_accels_disconnect_on_text_input(GTK_WIDGET(ui->new_album_entry));
gtk_entry_set_text(ui->new_album_entry, _("new album"));
gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(ui->new_album_entry), TRUE, TRUE, 0);
gtk_entry_set_width_chars(GTK_ENTRY(ui->new_album_entry), 0);
Expand Down
1 change: 1 addition & 0 deletions src/iop/lut3d.c
Original file line number Diff line number Diff line change
Expand Up @@ -1707,6 +1707,7 @@ void gui_init(dt_iop_module_t *self)
#ifdef HAVE_GMIC
// text entry
GtkWidget *entry = gtk_entry_new();
dt_accels_disconnect_on_text_input(entry);
gtk_widget_set_tooltip_text(entry, _("enter lut name"));
gtk_box_pack_start((GtkBox *)self->widget,entry, TRUE, TRUE, 0);
gtk_widget_add_events(entry, GDK_KEY_RELEASE_MASK);
Expand Down
1 change: 1 addition & 0 deletions src/iop/watermark.c
Original file line number Diff line number Diff line change
Expand Up @@ -1078,6 +1078,7 @@ void gui_init(struct dt_iop_module_t *self)
// Simple text
label = dt_ui_label_new(_("text"));
g->text = gtk_entry_new();
dt_accels_disconnect_on_text_input(g->text);
gtk_entry_set_width_chars(GTK_ENTRY(g->text), 1);
gtk_widget_set_tooltip_text(g->text, _("text string, tag:\n$(WATERMARK_TEXT)"));
const char *str = dt_conf_get_string_const("plugins/darkroom/watermark/text");
Expand Down
1 change: 1 addition & 0 deletions src/libs/collect.c
Original file line number Diff line number Diff line change
Expand Up @@ -3239,6 +3239,7 @@ void gui_init(dt_lib_module_t *self)
gtk_box_pack_start(box, GTK_WIDGET(hbox), FALSE, FALSE, 0);

w = gtk_search_entry_new();
dt_accels_disconnect_on_text_input(w);
d->rule[i].text = w;
gtk_widget_add_events(w, GDK_FOCUS_CHANGE_MASK);
gtk_entry_set_placeholder_text(GTK_ENTRY(d->rule[i].text), _("Search..."));
Expand Down
1 change: 1 addition & 0 deletions src/libs/duplicate.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,7 @@ static void _lib_duplicate_init_callback(gpointer instance, dt_lib_module_t *sel
g_snprintf(chl, sizeof(chl), "%d", sqlite3_column_int(stmt, 0));

GtkWidget *tb = gtk_entry_new();
dt_accels_disconnect_on_text_input(tb);
if(path) gtk_entry_set_text(GTK_ENTRY(tb), path);
gtk_entry_set_width_chars(GTK_ENTRY(tb), 0);
gtk_widget_set_hexpand(tb, TRUE);
Expand Down
6 changes: 6 additions & 0 deletions src/libs/export.c
Original file line number Diff line number Diff line change
Expand Up @@ -1110,25 +1110,30 @@ void gui_init(dt_lib_module_t *self)
N_("original resolution"));

d->print_width = gtk_entry_new();
dt_accels_disconnect_on_text_input(d->print_width);
gtk_widget_set_tooltip_text(d->print_width, _("maximum output width limit.\n"
"click middle mouse button to reset to 0."));
gtk_entry_set_width_chars(GTK_ENTRY(d->print_width), 5);
d->print_height = gtk_entry_new();
dt_accels_disconnect_on_text_input(d->print_height);
gtk_widget_set_tooltip_text(d->print_height, _("maximum output height limit.\n"
"click middle mouse button to reset to 0."));
gtk_entry_set_width_chars(GTK_ENTRY(d->print_height), 5);
d->print_dpi = gtk_entry_new();
dt_accels_disconnect_on_text_input(d->print_dpi);
gtk_widget_set_tooltip_text(d->print_dpi, _("resolution in dot per inch"));
gtk_entry_set_width_chars(GTK_ENTRY(d->print_dpi), 4);
const char *dpi = dt_conf_get_string_const(CONFIG_PREFIX "print_dpi");
gtk_entry_set_text(GTK_ENTRY(d->print_dpi), dpi);


d->width = gtk_entry_new();
dt_accels_disconnect_on_text_input(d->width);
gtk_widget_set_tooltip_text(d->width, _("maximum output width limit.\n"
"click middle mouse button to reset to 0."));
gtk_entry_set_width_chars(GTK_ENTRY(d->width), 5);
d->height = gtk_entry_new();
dt_accels_disconnect_on_text_input(d->height);
gtk_widget_set_tooltip_text(d->height, _("maximum output height limit.\n"
"click middle mouse button to reset to 0."));
gtk_entry_set_width_chars(GTK_ENTRY(d->height), 5);
Expand Down Expand Up @@ -1164,6 +1169,7 @@ void gui_init(dt_lib_module_t *self)
gtk_container_foreach(GTK_CONTAINER(d->px_size), (GtkCallback)gtk_widget_set_can_focus, GINT_TO_POINTER(FALSE));

d->scale = gtk_entry_new();
dt_accels_disconnect_on_text_input(d->scale);
gtk_entry_set_width_chars(GTK_ENTRY(d->scale), 5);
gtk_entry_set_text (GTK_ENTRY(d->scale), dt_conf_get_string_const(CONFIG_PREFIX "resizing_factor"));
gtk_widget_set_tooltip_text(d->scale, _("it can be an integer, decimal number or simple fraction.\n"
Expand Down
1 change: 1 addition & 0 deletions src/libs/export_metadata.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ static void _add_tag_button_clicked(GtkButton *button, dt_lib_export_metadata_t
gtk_container_add(GTK_CONTAINER(area), vbox);

GtkWidget *entry = gtk_entry_new();
dt_accels_disconnect_on_text_input(entry);
d->sel_entry = entry;
gtk_entry_set_text(GTK_ENTRY(entry), "");
gtk_widget_set_tooltip_text(entry, _("list filter"));
Expand Down
2 changes: 2 additions & 0 deletions src/libs/geotagging.c
Original file line number Diff line number Diff line change
Expand Up @@ -1480,6 +1480,7 @@ static GtkWidget *_gui_init_datetime(dt_lib_datetime_t *dt, const int type, dt_l
if(i >= 2 || type != 2)
{
dt->widget[i] = gtk_entry_new();
dt_accels_disconnect_on_text_input(dt->widget[i]);
gtk_entry_set_width_chars(GTK_ENTRY(dt->widget[i]), i == 0 ? 4 : i == 6 ? 3 : 2);
gtk_entry_set_alignment(GTK_ENTRY(dt->widget[i]), 0.5);
gtk_box_pack_start(box, dt->widget[i], FALSE, FALSE, 0);
Expand Down Expand Up @@ -1763,6 +1764,7 @@ void gui_init(dt_lib_module_t *self)
gtk_grid_attach(grid, label, 0, line, 2, 1);

d->timezone = gtk_entry_new();
dt_accels_disconnect_on_text_input(d->timezone);
gtk_widget_set_tooltip_text(d->timezone, _("start typing to show a list of permitted values and select your timezone.\npress enter to confirm, so that the asterisk * disappears"));
d->timezone_changed = dt_ui_label_new("");

Expand Down
2 changes: 1 addition & 1 deletion src/libs/location.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ void gui_init(dt_lib_module_t *self)

/* add search box */
lib->search = GTK_ENTRY(gtk_entry_new());
dt_accels_disconnect_on_text_input(GTK_WIDGET(lib->search));
gtk_box_pack_start(GTK_BOX(self->widget), GTK_WIDGET(lib->search), FALSE, FALSE, 0);

g_signal_connect(G_OBJECT(lib->search), "activate", G_CALLBACK(_lib_location_entry_activated),
Expand Down Expand Up @@ -742,4 +743,3 @@ int set_params(dt_lib_module_t *self, const void *params, int size)
// vim: shiftwidth=2 expandtab tabstop=2 cindent
// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
// clang-format on

Loading

0 comments on commit d3c8934

Please sign in to comment.