MessageArea messages can force odd window sizing
I've confirmed this still occurs even in the latest Meld development sources, built from the repo.
When a FileDiff tab is created that contains a message area banner (the MsgAreaController
widget is non-empty), it can cause the Meld window size to grow excessively, making it taller than the screen height. It will also prevent vertically resizing the window, until it is dismissed.
I noticed this specifically with the version of the "Files are identical" message that's shown when text filters are in use.
To reproduce
- Open a directory comparison that includes some identical files
- Set some default text filters in the preferences
- Double-click on one of the identical files (The files compared should be too long to fit entirely on the screen.)
What happens
- My previously 1340×1035 Meld window immediately resizes itself to 1340×1721 (always 1721!), taller than my 1920×1200 display
- The window cannot be resized vertically until I either "Hide" the message, or click "Show without filters".
- If I do the latter, even though that initial message is now replaced with the "Files are identical" message, the message no longer interferes with resizing the window.
I believe, based on the last observation, that the issue is caused by the bug-triggering message containing wrapped text.
Using the Gtk inspector, I observed that when a MsgAreaController
message is present on the screen, the entire FileDiff
object is given a size allocation mode of height-for-width
. When the MsgAreaController
's contents are removed, the allocation mode for the FileDiff
reverts to constant-size
.
I don't feel like it completely explains the behavior, because even when the "Files are identical" message is visible the FileDiff
still has height-for-width
allocation, but for some reason it no longer interferes with window resizing. (The entire Meld window also always has height-for-width
allocation.) Still, the wrapping of the text in the MsgAreaController
and the height-for-width
allocation method it propagates to the FileDiff
seem to be somehow implicated in this issue.