TextView does not show if contained text is not terminated with \n
C source included - test_testview.zip
Although I'm new to GTK, I consider it a bug because:
- I could not find any info about this behaviour in documentation
- Sometimes, on the first compilation this bug does not occur
- I tried the same in GTK3 and this bug did not occur
Steps to reproduce
(make the attached program and run it)
- Create a GtkTextView by gtk_text_view_new()
- Obtain it's GtkTextBuffer
- Set the text in the buffer to something without \n
- Append the GtkTextView to some container
- Run the app (or run it twice if needed)
Current behavior
As long as the text in buffer is not terminated by \n, the GtkTextView does not show up. If user navigates to it (e.g. using tab), and writes \n, the GtkTextView shows up.
In the attached program, the GtkTextView shows up if the enter is hit, since the GtkTextView has focus by default.
Expected outcome
Visible empty GtkTextView widget expected.
Version information
- GTK 4.0.1, downloaded from https://download.gnome.org/sources/gtk/4.0/
- Linux Mint 20 Ulyana 64-bit, Kernel Linux 5.4.0-62-generic x86_64
- I builded the library myself; Build Options: -Dprefix=/opt/gtk (this is from meson-log.txt)