Alexander-Miller / treemacs

GNU General Public License v3.0
2.09k stars 153 forks source link

treemacs loses its aspect ratio when toggling frame maximization/fullscreen #1023

Closed dmvianna closed 1 year ago

dmvianna commented 1 year ago

Steps to reproduce:

M-x treemacs M-x fulscreen-frame or M-x toggle-frame-maximized

Repeat the last step to return to the previous state. Treemacs does not.

Alexander-Miller commented 1 year ago

Treemacs' default behaviour is to keep its width fixed. It does so by locally setting window-size-fixed to 'fixed. You can check in your own buffer if this is the case.

There's of course a few ways around that. You can set treemacs-width-is-initially-locked to nil. Or you can call interactively treemacs-toggle-fixed-width. My guess is that either your config does that, or maybe one of your packages.

Repeat the last step to return to the previous state. Treemacs does not.

I use a tiling window manager, so these commands do nothing for me, however neither does e.g. balance-windows. As far as I can tell the default setup works just as expected.

dmvianna commented 1 year ago

I'm working out going fullscreen on startup, and the new frame starts tiny before 'after-make-frame-functions runs. So treemacs ends up like a really thin window. Setting treemacs-width-is-initially-locked to nil, resizing and then setting it to t again does fix the problem.

Thank you!