From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: ynyaaa@gmail.com Newsgroups: gmane.emacs.bugs Subject: bug#38705: 26.3; set-frame-size pixelwise makes frame larger Date: Tue, 24 Dec 2019 22:49:55 +0900 Message-ID: <86lfr1al4s.fsf@gmail.com> References: <8636dcr0yl.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="256106"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 38705@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Dec 24 14:51:20 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1ijkai-0014M9-OE for geb-bug-gnu-emacs@m.gmane.org; Tue, 24 Dec 2019 14:51:16 +0100 Original-Received: from localhost ([::1]:39292 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ijkac-00036F-3Y for geb-bug-gnu-emacs@m.gmane.org; Tue, 24 Dec 2019 08:51:10 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45152) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ijkaV-00033g-97 for bug-gnu-emacs@gnu.org; Tue, 24 Dec 2019 08:51:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ijkaU-0004Yo-1C for bug-gnu-emacs@gnu.org; Tue, 24 Dec 2019 08:51:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46044) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ijkaT-0004Yi-TE for bug-gnu-emacs@gnu.org; Tue, 24 Dec 2019 08:51:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ijkaT-00057t-Rp for bug-gnu-emacs@gnu.org; Tue, 24 Dec 2019 08:51:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: ynyaaa@gmail.com Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 24 Dec 2019 13:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 38705 X-GNU-PR-Package: emacs Original-Received: via spool by 38705-submit@debbugs.gnu.org id=B38705.157719542119652 (code B ref 38705); Tue, 24 Dec 2019 13:51:01 +0000 Original-Received: (at 38705) by debbugs.gnu.org; 24 Dec 2019 13:50:21 +0000 Original-Received: from localhost ([127.0.0.1]:52017 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ijkZp-00056u-CY for submit@debbugs.gnu.org; Tue, 24 Dec 2019 08:50:21 -0500 Original-Received: from mail-pl1-f175.google.com ([209.85.214.175]:45667) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ijkZn-00056f-G3 for 38705@debbugs.gnu.org; Tue, 24 Dec 2019 08:50:20 -0500 Original-Received: by mail-pl1-f175.google.com with SMTP id b22so8488361pls.12 for <38705@debbugs.gnu.org>; Tue, 24 Dec 2019 05:50:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:in-reply-to:date:message-id:mime-version; bh=/C9S2GSUF4EgIMxPrlosuvK2wWohTsx9hnx/esIG5mc=; b=sGQncRb5ri1czvt4ap8svCWCkCEaZ6FJMMd/uTFpFV+SJ2/9DSj/vVBnrJplk+mUUb ot6zlwvuGDx4JLELdS0zaDpZPGUZd/1phcFwtlbIuaRK7+KRoGOp6XEyZQBlbYlk4iBi /gkcu9d+fcjITTavbY+2QOca2kzTP5E4jfDfkdY1aAdzZpMrKbOQUptQXbgjP97J6r8W 41tPxY4fotwsTc57CML5z7WIYRR/uCGkyR/0F1Q6eVmyOBKVrCaubAVbc8hsu5wuGWxg dTA2dWJqRowJa3Vs5szyHNLlb1IDI23k/qXcb1I7O26I6LiBNC+iFaUmdX3mwmpKgzFm Q7tA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:date:message-id :mime-version; bh=/C9S2GSUF4EgIMxPrlosuvK2wWohTsx9hnx/esIG5mc=; b=mRA9CNn9JLryft8aSHvKDlnFiouuYHZZqe6u/45+18gq63Ag9CV+J55oiTMH96MiNP c7Us/Mb+cYTX6BnMR8kv4ePOzB+pCEOqSLgGsKi9kVEsaKq42vrB/PlKtXwYvJ34AT9o lndUx4jXFwJAVbr4aoogsVbPjaswPHOEguXuZrWaOSOwzpO8Rba66nGnDKH0fN88og4t jlOyTo821Rb1MTo2R4sggm3p/nxkZfT+9gC23PvDtq707Db/pzD1EtadKf4Q2WyhblXk 892j9BQH9/pllZb2GInJihPv4SvJOfhWCHO50ABVuFh3EOSHKSA/Nw26Xb8zQseuuijc ERJg== X-Gm-Message-State: APjAAAXRC/8h1kRGQLIvfNLgwcX3hYvw4AvemL8p9pCCN9M8Qg8MC/Ps GwUAaXSrH1g5ZGNZ9EbPo+0ipVuE X-Google-Smtp-Source: APXvYqz+J0GgcuqyDmDxvf6D3Bl/0qB2SkXbl0gedl6eR+ZXZ2K2hVeAN6VmwH7ax7oO9SH41/Ap6A== X-Received: by 2002:a17:902:7288:: with SMTP id d8mr34618264pll.341.1577195413230; Tue, 24 Dec 2019 05:50:13 -0800 (PST) Original-Received: from HP (east42-p111.eaccess.hi-ho.ne.jp. [219.121.173.112]) by smtp.gmail.com with ESMTPSA id x8sm29225504pfd.76.2019.12.24.05.50.11 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2019 05:50:12 -0800 (PST) In-Reply-To: <40c9e794-3873-a4a4-eaea-8a7d2f6bacc7@gmx.at> (martin rudalics's message of "Mon, 23 Dec 2019 11:08:14 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.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" Xref: news.gmane.org gmane.emacs.bugs:173705 Archived-At: martin rudalics writes: > Right. But here > > (progn (set-frame-size nil 500 500 t) > (list (list (frame-outer-width) > (frame-pixel-width) > (frame-inner-width) > (frame-text-width)) > (list (frame-outer-height) > (frame-pixel-height) > (frame-inner-height) > (frame-text-height)))) > =>((540 532 532 500) (583 536 536 500)) > > This is because 'set-frame-size' sets "the size of the text area of > FRAME" and the size of the text area is returned by 'frame-text-width' > and 'frame-text-height'. Just another Emacs idiosyncrasy ... > > martin I tried to set up the frame outer size like below. ;;; sample ~/.emacs.d/init.el (defun test-set-frame-outer-size (frame width height) (set-frame-size frame width height t) (set-frame-size frame (- width (- (frame-outer-width frame) width)) (- height (- (frame-outer-height frame) height)) t)) (setq frame-inhibit-implied-resize t) (test-set-frame-outer-size nil 500 500) ;;; sample ~/.emacs.d/init.el end But the function does not work well inside init.el. After emacs started, the size is: (list (frame-outer-width) (frame-outer-height)) =>(500 502) When user input is allowed, evaluating (test-set-frame-outer-size nil 500 500) works as expected. About another point. If the frame has no menu-bar, tool-bar, scroll-bar nor fringes, frame-pixel-width and frame-pixel-height can be set by set-frame-size. But if the frame is undecorated, the outer size is as large as the size of non-undecorated frame regardless of the value of frame-inhibit-implied-resize. The inner size is enlarged to the outer size after redisplay. The size can not be set as expected. (let ((width 500) (height 500) (params '((undecorated . t) (menu-bar-lines . 0) (tool-bar-lines . 0) (horizontal-scroll-bars . nil) (vertical-scroll-bars . nil) (left-fringe . 0) (right-fringe . 0))) (f (lambda () (list (list (frame-outer-width) (frame-inner-width)) (list (frame-outer-height) (frame-inner-height)))))) (setq frame-inhibit-implied-resize t) (modify-frame-parameters nil params) (set-frame-size nil width height t) (list (funcall f) (progn (redisplay) (funcall f)))) =>(((516 500) (539 500)) ((516 516) (539 539))) If the form above is evaluated twice, the frame outer size stays 516x539 pixels and the inner size shrinks to 500x500 pixels. The inner text area is displayed at the top-left, and there are blank areas at the right and the bottom.