libgimp: fix #15877 crash in export dialog with long comment line

Our export dialog resizes the width of the dialog based on the size
of the longest comment line. Apparently certain programs save data
that can be very long. On Windows I did not experience a crash, but
the dialog is many screens wide and unusable in that state.

To fix this we change the horizontal scroll policy to
GTK_POLICY_EXTERNAL because GTK_POLICY_NEVER apparently stops GTK
from resizing the window at a reasonable size.

We also set wrap mode of the comment field to GTK_WRAP_WORD_CHAR
to make sure the lines that consist of only numbers without spaces
get wrapped at a reasonable length.
This commit is contained in:
Jacob Boerema 2026-02-17 18:53:01 -05:00
parent 90a91c1395
commit bffa26d995

View file

@ -285,7 +285,7 @@ gimp_export_procedure_dialog_fill_end (GimpProcedureDialog *dialog,
gtk_text_view_set_bottom_margin (GTK_TEXT_VIEW (widget), 3);
gtk_text_view_set_left_margin (GTK_TEXT_VIEW (widget), 3);
gtk_text_view_set_right_margin (GTK_TEXT_VIEW (widget), 3);
gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (widget), GTK_WRAP_WORD);
gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (widget), GTK_WRAP_WORD_CHAR);
g_object_unref (buffer);
tooltip = g_param_spec_get_blurb (pspec);
@ -296,7 +296,7 @@ gimp_export_procedure_dialog_fill_end (GimpProcedureDialog *dialog,
gtk_widget_set_size_request (scrolled_window, -1, 100);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_window), GTK_SHADOW_OUT);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
GTK_POLICY_NEVER,
GTK_POLICY_EXTERNAL,
GTK_POLICY_AUTOMATIC);
gtk_container_add (GTK_CONTAINER (frame2), scrolled_window);
gtk_widget_show (scrolled_window);