From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs 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 Message-ID: <52DD6884.2070301@gmx.at> References: <87mwj0glf4.fsf@bzg.ath.cx> <52D427EA.5090609@gmx.at> <87txd7g0ew.fsf@bzg.ath.cx> <52D43FEA.7010602@gmx.at> <87y52jy52o.fsf@bzg.ath.cx> <52D4EBAE.2060903@gmx.at> <87iotmao4l.fsf@bzg.ath.cx> <52D51541.6040708@gmx.at> <87r48afrul.fsf@bzg.ath.cx> <52D57D3F.7090809@gmx.at> <877ga2iafk.fsf@bzg.ath.cx> <52D64215.7080805@gmx.at> <87sismherx.fsf@bzg.ath.cx> <52DA7149.60102@gmx.at> <878uucgcgc.fsf@bzg.ath.cx> <52DC0BDF.5020602@gmx.at> <87zjmqu46w.fsf@bzg.ath.cx> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1390241956 13443 80.91.229.3 (20 Jan 2014 18:19:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 20 Jan 2014 18:19:16 +0000 (UTC) Cc: 16430@debbugs.gnu.org To: Bastien Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jan 20 19:19:23 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1W5JRR-0004jz-4j for geb-bug-gnu-emacs@m.gmane.org; Mon, 20 Jan 2014 19:19:21 +0100 Original-Received: from localhost ([::1]:54037 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W5JRQ-00081r-Kz for geb-bug-gnu-emacs@m.gmane.org; Mon, 20 Jan 2014 13:19:20 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60630) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W5JRI-00081m-KF for bug-gnu-emacs@gnu.org; Mon, 20 Jan 2014 13:19:18 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W5JR8-0007jr-GF for bug-gnu-emacs@gnu.org; Mon, 20 Jan 2014 13:19:12 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:44631) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W5JR8-0007jj-CR for bug-gnu-emacs@gnu.org; Mon, 20 Jan 2014 13:19:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1W5JR7-00032f-Rc for bug-gnu-emacs@gnu.org; Mon, 20 Jan 2014 13:19:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 20 Jan 2014 18:19:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16430 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 16430-submit@debbugs.gnu.org id=B16430.139024193511667 (code B ref 16430); Mon, 20 Jan 2014 18:19:01 +0000 Original-Received: (at 16430) by debbugs.gnu.org; 20 Jan 2014 18:18:55 +0000 Original-Received: from localhost ([127.0.0.1]:58649 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W5JR1-000320-1f for submit@debbugs.gnu.org; Mon, 20 Jan 2014 13:18:55 -0500 Original-Received: from mout.gmx.net ([212.227.15.19]:61476) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W5JQz-00031o-8D for 16430@debbugs.gnu.org; Mon, 20 Jan 2014 13:18:54 -0500 Original-Received: from [62.47.33.4] ([62.47.33.4]) by mail.gmx.com (mrgmx003) with ESMTPSA (Nemesis) id 0MBFUT-1WChxu2mlJ-00AGP0 for <16430@debbugs.gnu.org>; Mon, 20 Jan 2014 19:18:51 +0100 In-Reply-To: <87zjmqu46w.fsf@bzg.ath.cx> X-Provags-ID: V03:K0:jMfTwVmboraERpu1PsdZrVIWanFcSWURcMFZuc5xKSm/h59JY6C bCWIbf8sivL5pPECpJE4Q+A2jwSFpTa3xYY+fu3+LebsFNXEJF54AswzY2N8rIWBSynUw/N kT50OqBXfxnoWmee7KtMBJyyatbR2w+g9KPoAPQyJmPUt2sU8KVVleKEbJ4nADMRHQyqMUN dNMWQdjysVAPLA2bahiPg== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:83804 Archived-At: > With the error (wm-fullscreened): > ================================= ... > # parent: # > 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 # 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))))))