Add a preference to zoom only the focused terminal - #2347
Open
dbolser wants to merge 1 commit into
Open
Conversation
The zoom in/out shortcuts changed the configured font size and applied it to every terminal, so terminals could not be sized individually. Add a "Zoom in/out affects only the focused terminal" preference: when enabled, each terminal keeps its own zoom level, as a scale on top of the configured font size. It is off by default, keeping the current behaviour. Addresses the first point of Guake#1568. Terminal already had increase_font_size() and decrease_font_size() for this, but nothing called them. When zooming every terminal, start from the size the focused terminal shows, so terminals that were zoomed individually snap to it rather than keeping their offset, and drop their own zoom levels. Zooming every terminal also applied the change twice, as a font size and as a Vte font scale, making a step larger than intended and zoom out a different size than zoom in; and it could reach a font size of zero. Apply the font size alone, and stop at 1. sem-ver: feature Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a preference, Appearance → "Zoom in/out affects only the focused terminal", so
each terminal can keep its own zoom level. It is off by default, so nothing changes
for existing users.
This addresses the first point of #1568 ("These font size changes apply to all the tabs,
not just the current one").
Terminalalready hadincrease_font_size()/decrease_font_size()and a per-terminalfont_scaleindex for exactly this, but nothing called them — the accelerators wentstraight to the configured font size instead. The preference wires them up.
Behaviour
When zooming every terminal, the new size is now taken from the size the focused
terminal is showing, so terminals that had been zoomed individually snap to it instead of
keeping their offsets. Without that, switching the preference off left terminals
permanently different sizes.
Fixes noticed along the way
Both in the zoom-everything path:
Vtefont scale(
set_font_scale(new_size / (new_size - 1))). A step was larger than intended, andzoom out did not undo zoom in —
10 → 13 → 10came back as10 → 13 → 11.0. It now stops at1.Dropping the
Vtefont scale means the zoom-everything path no longer works bymultiplying the displayed font, so when
use-default-fontis set (the schema default)— where
fstyle_changedignores the configured size and follows the desktop font — itnow zooms every terminal by the same
font_scalelevel instead. Same visible result,one mechanism.
Testing
Manually, in a nested X server, for both
use-default-fontvalues:(
10 → 13 → 10)splits and other tabs keep their own levels; new tabs open at the configured size
snap to the focused tab's size
black,flake8and the glade/gschema parse are clean; the release note is inreleasenotes/notes/.