bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#16430: 24.3.50; When fullscreen is triggered from the window manager


From: martin rudalics
Subject: bug#16430: 24.3.50; When fullscreen is triggered from the window manager, I can't resize window (via M-x org-export RET)
Date: Mon, 20 Jan 2014 19:18:44 +0100

> With the error (wm-fullscreened):
> =================================
...
> #<window 22 on bzg.org>   parent: #<window 23>
> pixel left: 0   top: 0   size: 1366 x 372   new: 372
> char left: 0   top: 0   size: 151 x 21   new: 21
> normal: 1.0 x 0.5   new: 0.5
> body pixel: 1348 x 353   char: 150 x 20
...

The bug is here:

> window #<window 24 on *Org Export Dispatcher*> height 17

Your buffer is too large to be fit to the window so
`fit-window-to-buffer' tries to get as much as it can.
`window-max-delta' in this case gives 17 because the minimum height of a
window is 4 and 21 - 4 = 17.  Unfortunately, the window above is not 21
lines high but only 372 / 18, that is, 20.666... lines.

Now all this wouldn't be a problem per se: Unfortunately,
`window-resize' (the routine that does the actual resizing) counts
pixelwise internally and is very meticulous wrt minimum sizes so it
complains about the missing 0.333... lines.

I'm not yet sure where precisely to handle this.  Meanwhile, try the
`window--max-delta-1' below and tell me whether it fixes the problem.

Thanks for your collaboration, martin


(defun window--max-delta-1 (window delta &optional horizontal ignore trail noup 
pixelwise)
  "Internal function of `window-max-delta'."
  (if (not (window-parent window))
      ;; Can't go up.  Return DELTA.
      delta
    (let* ((parent (window-parent window))
           (sub (window-child parent))
           (unit (if horizontal
                     (frame-char-width (window-frame window))
                   (frame-char-height (window-frame window)))))
      (catch 'fixed
        (if (window-combined-p sub horizontal)
            ;; For an iso-combination calculate how much we can get from
            ;; other child windows.
            (let ((skip (eq trail 'after)))
              (while sub
                (cond
                 ((eq sub window)
                  (setq skip (eq trail 'before)))
                 (skip)
                 (t
                  (setq delta
                        (+ delta
                           (- (let ((size (window-size sub horizontal t)))
                                ;; When not resizing pixelwise we can
                                ;; only get the bottom of sub's size
                                ;; (Bug#16430).
                                (if pixelwise size (/ size unit)))
                              (window-min-size
                               sub horizontal ignore pixelwise))))))
                (setq sub (window-right sub))))
          ;; For an ortho-combination throw DELTA when at least one
          ;; child window is fixed-size.
          (while sub
            (when (and (not (eq sub window))
                       (not (window--size-ignore-p sub ignore))
                       (window-size-fixed-p sub horizontal))
              (throw 'fixed delta))
            (setq sub (window-right sub))))
        (if noup
            ;; When NOUP is nil, DELTA is all we can get.
            delta
          ;; Else try with parent of WINDOW, passing the DELTA we
          ;; recovered so far.
          (window--max-delta-1
           parent delta horizontal ignore trail nil pixelwise))))))





reply via email to

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