[205_2009] Fix inconsistent document rendering when closing tabs#2915
Open
Utkal059 wants to merge 1 commit intoMoganLab:mainfrom
Open
[205_2009] Fix inconsistent document rendering when closing tabs#2915Utkal059 wants to merge 1 commit intoMoganLab:mainfrom
Utkal059 wants to merge 1 commit intoMoganLab:mainfrom
Conversation
When closing the last tab in a window (kill_tabpage -> kill_window), the surviving window's editor was not properly resumed. set_current_view only updates the active view pointer without triggering rendering recalculation. Adding resume() ensures notify_change(THE_FOCUS + THE_EXTENTS) is called, which forces proper font environment and layout recalculation. Fixes MoganLab#2009
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.
Problem
Fixes #2009
When using "Documents in separate windows" mode with the Tab bar enabled,
closing a newly created tab causes the original document's rendering to
become inconsistent — the same text appears with different font metrics
and spacing than before.
Root Cause
In
kill_window()insidesrc/Texmacs/Data/new_window.cpp, when thelast tab in a window is closed,
set_current_view()switches to thesurviving window's view. But
set_current_view()only updates the viewpointer — it never calls
resume()on the editor.Without
resume(),notify_change(THE_FOCUS + THE_EXTENTS)is nevertriggered, so the font environment and page layout are not recalculated.
This leaves the editor in a stale state, producing the visual mismatch.
There was already a FIXME comment at this location noting that GUI focus
was not properly transferred.
Fix
Added
resume()andsend_keyboard_focus()afterset_current_view()in
kill_window(), matching the pattern already used byvar_focus_on_buffer()innew_view.cpp.Developer Doc
See
devel/205_2009.md