GNOME Bugzilla – Bug 793407
GtkTextView does not allow width shrink and textwrap if left or right margin is set
Last modified: 2018-05-02 19:52:03 UTC
Created attachment 368281 [details] A minimal test case program When a textview with hexpand enabled and left or right margin is resized, it will increase its size, but never decrease if it would mean breaking up a line of text to wrap it. Attached test case creates two toplevel windows, each with the its own textview. Each textview has minimum size of 200px requested. The only difference is that window #1 textview has left&right margins set. To see the issue, just pull right or left window edge to change the windows' width. Window #1 will not allow you to shrink, while window #2 will allow you to shrink the textview all the way back to 200px. It is possible that top&bottom margin have the same effect on height. I haven't tested that.
FWIW this is fixed by https://gitlab.gnome.org/GNOME/gtk/commit/78c6f713ddf4cb756bd4c060d61f8b0153429928 in master/gtk4, at least as far as I understand what the old size_request function was trying to do. This bug is also a potential duplicate of https://bugzilla.gnome.org/show_bug.cgi?id=766822 .
(In reply to Andrej Kacian from comment #0) > It is possible that top&bottom margin have the same effect on height. I > haven't tested that. I'm not sure how we could test/have the same effect? We can't write/wrap text vertically.
(In reply to Daniel Boles from comment #2) > I'm not sure how we could test/have the same effect? We can't write/wrap > text vertically. Yes, those margins are probably not an issue. (In reply to Timm Bäder from comment #1) > FWIW this is fixed by > https://gitlab.gnome.org/GNOME/gtk/commit/ > 78c6f713ddf4cb756bd4c060d61f8b0153429928 in master/gtk4, at least as far as > I understand what the old size_request function was trying to do. > > This bug is also a potential duplicate of > https://bugzilla.gnome.org/show_bug.cgi?id=766822 . If it is fixed, great! Any chance that this could be backported to GTK3?
I'm not sure if the fix here is 100% correct, especially not in gtk3 (it removes the priv->cached_size_request completely for example), and I don't want to break a stable version. You can try to "backport" it of course, but test it properly.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gtk/issues/1030.