Resizing an XTerm with command `Resize 80c 20c` after changing the font size in the XTerm shrinks the XTerm to a 6x1 window
Closed this issue · 3 comments
Upfront Information
- Fvwm3 version (run:
fvwm3 --version
)
fvwm3 1.0.5 (released)
with support for: ReadLine, XPM, PNG, SVG, Shape, XShm, SM, Bidi text, XRandR, XRender, XCursor, XFT, NLS
fvwm3 comes with NO WARRANTY, to the extent permitted by law. You may
redistribute copies of fvwm under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.
- Linux distribution or BSD name/version
Debian testing
- Platform (run:
uname -sp
)
Linux unknown
Expected Behaviour
Resize an XTerm with fvwm command Resize 80c 20c
after changing the font size in the XTerm: The XTerm has size 80x20 (in characters).
Actual Behaviour
The window shrinks to a 6x1 window (in characters).
Enabling logging
Logging goes to the journal for me. Here is the relevant part for above session:
Nov 26 16:57:21 sappc1 xsession[31365]: [1669478241.743662] FScreenInit: Using RandR 1.6
Nov 26 16:57:21 sappc1 xsession[31365]: [1669478241.952628] main: Loading window states via (null)
Nov 26 16:57:21 sappc1 xsession[31365]: loaded [0]: /home/jschmidt/.fvwm/config
Nov 26 16:57:22 sappc1 xsession[31365]: [1669478242.017570] setup_window_placement: Expanding screen from 'null' -> ''
Nov 26 16:57:22 sappc1 xsession[31365]: [1669478242.019038] setup_window_placement: Expanding screen from 'null' -> ''
Nov 26 16:59:03 sappc1 xsession[31365]: [1669478343.277117] CMD_Echo: 90 56
Nov 26 16:59:17 sappc1 xsession[31365]: [1669478357.132930] CMD_Echo: 738 417
Steps to Reproduce
Execute below test case with the following minimal .Xresources
XTerm.vt100.background: white
XTerm.vt100.foreground: black
XTerm.vt100.faceName: Inconsolata
XTerm.vt100.faceSize: 12
XTerm.vt100.faceSize1: 9
XTerm.vt100.faceSize2: 10
XTerm.vt100.faceSize3: 11
XTerm.vt100.faceSize4: 12
XTerm.vt100.faceSize5: 13
XTerm.vt100.faceSize6: 13.75
XTerm.vt100.faceSize7: 15
and .fvwm/config
DestroyFunc StartFunction
AddToFunc StartFunction
+ I Module FvwmMFL
+ I Exec exec xterm -name testwindow
+ I Exec exec xterm -name mflwindow -e nc -U /tmp/fvwm_mfl.sock
-
Restart the X session.
-
Then execute the commands and additional actions from the MFL window below:
set echo set configure_window [[[Select font "Large" in XTerm "testwindow"]]] {"configure_window":{"window":"0x80000e","title_height":19,"border_width":7,"frame":{"window":6292077,"x":0,"y":445,"width":738,"height":493},"hints":{"base_width":0,"base_height":0,"inc_width":1,"inc_height":1,"orig_inc_width":1,"orig_inc_height":1,"min_width":1,"min_height":1,"max_width":32767,"max_height":32767},"ewmh":{"layer":0,"desktop":0,"window_type":0}}} Next (testwindow) Resize 80c 20c [[[XTerm "testwindow" shrinks to almost naught here!]]] {"configure_window":{"window":"0x80000e","title_height":19,"border_width":7,"frame":{"window":6292077,"x":0,"y":445,"width":90,"height":56},"hints":{"base_width":4,"base_height":4,"inc_width":9,"inc_height":19,"orig_inc_width":9,"orig_inc_height":19,"min_width":13,"min_height":23,"max_width":32767,"max_height":32767},"ewmh":{"layer":0,"desktop":0,"window_type":0}}} Next (testwindow) Echo $[w.width] $[w.height] {"echo":{"message":"90 56"}} Next (testwindow) Resize 80c 20c [[[This restores XTerm "teswindow" to the intended size]]] {"configure_window":{"window":"0x80000e","title_height":19,"border_width":7,"frame":{"window":6292077,"x":0,"y":445,"width":738,"height":417},"hints":{"base_width":4,"base_height":4,"inc_width":9,"inc_height":19,"orig_inc_width":9,"orig_inc_height":19,"min_width":13,"min_height":23,"max_width":32767,"max_height":32767},"ewmh":{"layer":0,"desktop":0,"window_type":0}}} Next (testwindow) Echo $[w.width] $[w.height] {"echo":{"message":"738 417"}}
Educated Guess
After the font change in the XTerm the following properties look wrong in the JSON generated by configure_window
:
"inc_width":1,"inc_height":1
Seems that XTerm or fvwm loose the information on the character dimensions. I hope it's fvwm ... similar things happen for Emacs, BTW.
Workaround
I haven't tested that as well as the test case above, but it seems that resizing the target window with Resize $[w.width] $[w.height]
before the real, character-based resize helps.
[Update]
Swapped actual and expected behavior.
Changed name of second XTerm in sample .fvwm
.
Hi @farblos
Please take a look at ta/gh-775
and let me know if this fixes your problem.
Hi @ThomasAdam,
Please take a look at ta/gh-775 and let me know if this fixes your problem.
It does, thanks a lot!
Thanks, merged.