-
Notifications
You must be signed in to change notification settings - Fork 72
--text and --text-info windows do not size properly #300
Description
I wrote most of the following as a reply to a similar, and possibly related, bug report. But while I thought this was reported long ago, when I looked I couldn't find it. So, maybe this is redundant, maybe not. These issues have been around a while and worked the same way on previous hardware setups and previous operating systems so it is not unique to a plain Openbox "DE" (if you want to call it that) under Ubuntu 18.04, nor to dual monitors or large monitors. But, for context:
$ xrandr |grep ''
1366x768 60.02+ 40.01
3840x2160 30.00*+ 25.00 24.00 29.97 23.98
The small monitor is built in to my laptop. The larger, on the second line, is primary, and where all of these examples are happening.
yad --width=3800 --posx=1 --posy=1 --text="sssss ssssss"
works exactly as it should
yad --width=3800 --posx=1 --posy=1 --text="sssss ssssss sss"
adds empty vertical space below the text, like additional blank lines or invisible space characters making the window bigger than it needs to be.
Constraining such invocations with the --height=n option has no effect. So
yad --width=3800 --height=15 --posx=1 --posy=1 --text="sssss ssssss sss"
still shows the extra vertical space.
The longer the text, the larger the amount of useless space added is and the larger the RATIO of empty space to text grows. This, with the --height option at 15 as shown, or at 1500, or with no height option, all have the same effect- the yad window will have far more empty space than text, so much that the buttons are below the bottom edge of my monitor and can only be seen or clicked by dragging the window up.:
yad --width=3800 --posx=1 --posy=1 --height=15 --text="sssssssssssss ssssssssssss sssssssssssssssss ssssssssssssssssssss sssssssssssssss sssssssssssssssssssss ssssssssssssssssssss sssssssssssssssss ssssssssssssssssss ssssssssssssssssssssss sssssssssssss ssssssssssss sssssssssssssssss ssssssssssssssssssss sssssssssssssss sssssssssssssssssssss ssssssssssssssssssss sssssssssssssssss ssssssssssssssssss ssssssssssssssssssssss sssssssssssss sssss sssss"
In contrast, using --text-info, also fails, but quite differently:
$ echo "sssssssssssss ssssssssssss sssssssssssssssss ssssssssssssssssssss sssssssssssssss sssssssssssssssssssss ssssssssssssssssssss sssssssssssssssss ssssssssssssssssss ssssssssssssssssssssss sssssssssssss ssssssssssss sssssssssssssssss ssssssssssssssssssss sssssssssssssss sssssssssssssssssssss ssssssssssssssssssss sssssssssssssssss ssssssssssssssssss ssssssssssssssssssssss sssssssssssss sssss sssss" > temp
$ yad --width=3800 --posx=1 --posy=1 --text-info --filename=temp
The resulting window is 3800 in width as specified but the there are TWO problems with it:
- It is collapsed vertically showing only the title bar and buttons and the text is completely invisible.
2.I can resize the window by dragging down the bottom edge until the beginning of the text is visible, BUT it runs out of the box on the right edge and there is no scroll bar.
Without the --width option,
yad --posx=1 --posy=1 --text-info --filename=temp
it's even worse. The window is collapsed vertically AND horizontally and is just big enough to show the default buttons.
If I use the --no-buttons option
yad --posx=1 --posy=1 --text-info --filename=temp --no-buttons
it collapses a bit less vertically, showing the beginning of the text and one empty line below it, but collapses EVEN MORE horizontally, and is rendered just wide enough to show the close and maximize buttons in the title bar.
If I add --undecorated
yad --posx=1 --posy=1 --text-info --filename=temp --no-buttons --undecorated
it doesn't shrink further though, apart from leaving off the title bar.
Adding the --wrap option
yad --width=3800 --posx=1 --posy=1 --text-info --filename=temp --wrap
does, indeed, make the text wrap, but the window is still collapsed vertically, showing no text area at all. To see the text you have to manually resize the window.
The only way around this is to force the height to a specified number, like this:
yad --width=3800 --posx=1 --posy=1 --text-info --filename=temp --wrap --height=1500
In summary "--text" doesn't work worth a hoot with long text strings even if they are broken up into short words with spaces. And --text-info, in addition to being a lot more trouble to use, still ain't right, although you can force it to be good enough to be useful. This has been broken for a LONG time.