Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resizing an XTerm with command Resize 80c 20c after changing the font size in the XTerm shrinks the XTerm to a 6x1 window #775

Closed
farblos opened this issue Nov 26, 2022 · 3 comments · Fixed by #888
Assignees
Labels
type:bug Something's broken!
Milestone

Comments

@farblos
Copy link
Contributor

farblos commented Nov 26, 2022

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
  1. Restart the X session.

  2. 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.

@farblos farblos added the type:bug Something's broken! label Nov 26, 2022
@ThomasAdam ThomasAdam removed the type:bug Something's broken! label Nov 27, 2022
@ThomasAdam ThomasAdam self-assigned this Aug 29, 2023
@ThomasAdam ThomasAdam added this to FVWM3 Aug 29, 2023
@github-project-automation github-project-automation bot moved this to To do in FVWM3 Aug 29, 2023
@ThomasAdam ThomasAdam added the type:bug Something's broken! label Aug 29, 2023
@ThomasAdam ThomasAdam added this to the 1.0.8 milestone Aug 29, 2023
ThomasAdam added a commit that referenced this issue Aug 29, 2023
When dealing with WM_NORMAL_HINTS, don't always assume that the size
hints need to be strictly-checked, and instead go based on those values
read; even if they might be considered "erroneous".

Fixes #775
@ThomasAdam
Copy link
Member

Hi @farblos

Please take a look at ta/gh-775 and let me know if this fixes your problem.

@ThomasAdam ThomasAdam moved this from To do to PRs in FVWM3 Aug 30, 2023
@farblos
Copy link
Contributor Author

farblos commented Sep 1, 2023

Hi @ThomasAdam,

Please take a look at ta/gh-775 and let me know if this fixes your problem.

It does, thanks a lot!

ThomasAdam added a commit that referenced this issue Sep 1, 2023
When dealing with WM_NORMAL_HINTS, don't always assume that the size
hints need to be strictly-checked, and instead go based on those values
read; even if they might be considered "erroneous".

Fixes #775
@github-project-automation github-project-automation bot moved this from PRs to Done in FVWM3 Sep 1, 2023
@ThomasAdam
Copy link
Member

Thanks, merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something's broken!
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants