[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Tabs

From: martin rudalics
Subject: Re: Tabs
Date: Mon, 14 Oct 2019 20:02:57 +0200

> This will require some surgery, so don't expect a fix in a few days.
> And I have no idea yet whether and how this could affect GTK builds.

The forensics (informal):

(1) Suppose you have a frame with a visible tab-bar (and no other
    pseudo window) and save its window configuration.  In the saved
    configuration, the root window is at a line 3.

(2) You disable the tab-bar.  The root window is now at line 0.

(3) You restore the configuration saved in (1).  The root window is at
    line 2 again.  Now adjust_frame_size kicks in.  And this one had
    the optimization to do almost nothing in the most frequent case

      && new_text_width == old_text_width
      && new_text_height == old_text_height
      && new_windows_width == old_windows_width
      && new_windows_height == old_windows_height
      && new_pixel_width == old_pixel_width
      && new_pixel_height == old_pixel_height
      && new_cols == old_cols
      && new_lines == old_lines)
    /* No change.  Sanitize window sizes and return.  */

   hold.  Unfortunately, in our case all of these miraculously do
   hold, apparently nothing changed.

The reason for this is the 'frame-inhibit-implied-resize' nil setting.
When (2) removes the tab bar from the frame this sets all these sizes
(which later here appear as old_...) to the sizes of the saved window
configuration (which appear here as new_...) and we have a frame where
the root window remains at line 3 and its bottom is cut off.

I attach a patch for this.  Please carefully check all builds with
'frame-inhibit-implied-resize' nil for whether they DTRT now (and
obviously the GTK build is affected too since the tab-bar is now its
first internal window).


PS: I noticed two annoying things about tab-bar - it (1) usurpates my
private <C-tab> binding even after I turned it off and (2) apparently
turns off 'truncate-lines' (always t here) in the buffer from where I
invoked it.  Finally, I can't make tab-bar work on Windows any more
always getting something like

Debugger entered--Lisp error: (wrong-type-argument sequencep #<buffer 
  #f(compiled-function (tab) #<bytecode 0x1d723d1>)((current-tab (name . #<buffer 
  mapcan(#f(compiled-function (tab) #<bytecode 0x1d723d1>) ((current-tab (name . 
#<buffer *Messages*>))))
  redisplay_internal\ \(C\ function\)()
  execute-extended-command(nil "tab-bar-mode" "tab-bar-mode")
  funcall-interactively(execute-extended-command nil "tab-bar-mode" 
  call-interactively(execute-extended-command nil nil)

Any ideas?

Attachment: adjust_frame_size.diffs
Description: Text document

reply via email to

[Prev in Thread] Current Thread [Next in Thread]