From 386b094e3f6351d4c81eaffa3e7f385291ae5fad Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Thu, 12 May 2022 19:57:10 +0100 Subject: [PATCH] Fix GTK1 build. Commit 5390aef3fc7deca broke it, because GTK1 has neither gtk_label_set_selectable nor gtk_widget_set_can_focus. Happily, those are both more or less optional (only a minor UI awkwardness arises from not having them), so I'll just condition them out. --- unix/dialog.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/unix/dialog.c b/unix/dialog.c index 9f1d061d..35c912e7 100644 --- a/unix/dialog.c +++ b/unix/dialog.c @@ -2506,8 +2506,10 @@ GtkWidget *layout_ctrls( */ uc->text = w = gtk_label_new(uc->ctrl->label); #endif +#if GTK_CHECK_VERSION(2,0,0) gtk_label_set_selectable(GTK_LABEL(w), true); gtk_widget_set_can_focus(w, false); +#endif align_label_left(GTK_LABEL(w)); gtk_label_set_line_wrap(GTK_LABEL(w), ctrl->text.wrap); if (!ctrl->text.wrap) { @@ -2518,7 +2520,9 @@ GtkWidget *layout_ctrls( gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(w), GTK_POLICY_AUTOMATIC, GTK_POLICY_NEVER); +#if GTK_CHECK_VERSION(2,0,0) gtk_widget_set_can_focus(w, false); +#endif } break; }