all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Bastien <bzg@altern.org>
Cc: 16430@debbugs.gnu.org
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	[thread overview]
Message-ID: <52DD6884.2070301@gmx.at> (raw)
In-Reply-To: <87zjmqu46w.fsf@bzg.ath.cx>

 > 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	other threads:[~2014-01-20 18:18 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-13 11:39 bug#16430: 24.3.50; When fullscreen is triggered from the window manager, I can't resize window (via M-x org-export RET) Bastien Guerry
2014-01-13 17:52 ` martin rudalics
2014-01-13 19:13   ` Bastien
2014-01-13 19:35     ` martin rudalics
2014-01-13 20:55       ` Bastien
2014-01-14  7:47         ` martin rudalics
2014-01-14  9:50           ` Bastien
2014-01-14 10:45             ` martin rudalics
2014-01-14 16:30               ` Bastien
2014-01-14 18:09                 ` martin rudalics
2014-01-14 20:18                   ` Bastien
2014-01-15  8:08                     ` martin rudalics
2014-01-17 14:19                       ` Bastien
2014-01-17 19:07                         ` martin rudalics
2014-01-18 12:19                         ` martin rudalics
2014-01-19 16:31                           ` Bastien
2014-01-19 17:31                             ` martin rudalics
2014-01-20 14:18                               ` Bastien
2014-01-20 18:18                                 ` martin rudalics [this message]
2014-01-20 18:25                                   ` Bastien
2014-01-22 10:35                                     ` martin rudalics
2014-01-22 11:06                                       ` Bastien
2014-01-14 20:22                   ` Bastien
2014-01-15  8:09                     ` martin rudalics
2014-01-17 14:44                       ` Bastien
2014-01-14 16:34             ` Bastien
2014-01-14 18:09               ` martin rudalics
2014-01-14 20:32                 ` Bastien
2014-01-15  8:09                   ` martin rudalics
2014-01-17 14:48                     ` Bastien
2014-01-13 20:56       ` Bastien
2014-01-14  7:48         ` martin rudalics
2014-01-14  9:45           ` Bastien
2014-01-22 11:07   ` Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52DD6884.2070301@gmx.at \
    --to=rudalics@gmx.at \
    --cc=16430@debbugs.gnu.org \
    --cc=bzg@altern.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.