After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 793407 - GtkTextView does not allow width shrink and textwrap if left or right margin is set
GtkTextView does not allow width shrink and textwrap if left or right margin ...
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Widget: GtkTextView
3.22.x
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2018-02-12 23:31 UTC by Andrej Kacian
Modified: 2018-05-02 19:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
A minimal test case program (1.59 KB, text/plain)
2018-02-12 23:31 UTC, Andrej Kacian
Details

Description Andrej Kacian 2018-02-12 23:31:20 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.
Comment 1 Timm Bäder 2018-02-16 17:13:17 UTC
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 .
Comment 2 Daniel Boles 2018-02-16 19:29:30 UTC
(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.
Comment 3 Andrej Kacian 2018-02-16 19:36:40 UTC
(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?
Comment 4 Timm Bäder 2018-02-16 19:46:20 UTC
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.
Comment 5 GNOME Infrastructure Team 2018-05-02 19:52:03 UTC
-- 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.