From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: YAMAMOTO Mitsuharu Newsgroups: gmane.emacs.bugs Subject: bug#2401: 23.0.90; set-frame-width does not take effect immediately? Date: Sun, 03 May 2009 16:07:23 +0900 Organization: Faculty of Science, Chiba University Message-ID: References: <20090220040553.77C342544F0@localhost> Reply-To: YAMAMOTO Mitsuharu , 2401@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Trace: ger.gmane.org 1241335943 17991 80.91.229.12 (3 May 2009 07:32:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 3 May 2009 07:32:23 +0000 (UTC) To: Alex Khesin , 2401@emacsbugs.donarmstrong.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun May 03 09:32:15 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1M0WBK-0001Qf-5y for geb-bug-gnu-emacs@m.gmane.org; Sun, 03 May 2009 09:32:15 +0200 Original-Received: from localhost ([127.0.0.1]:46495 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M0WBJ-00056h-H8 for geb-bug-gnu-emacs@m.gmane.org; Sun, 03 May 2009 03:32:13 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M0WBF-00056M-St for bug-gnu-emacs@gnu.org; Sun, 03 May 2009 03:32:09 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M0WB9-00054T-Oz for bug-gnu-emacs@gnu.org; Sun, 03 May 2009 03:32:09 -0400 Original-Received: from [199.232.76.173] (port=52056 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M0WB8-00054H-26 for bug-gnu-emacs@gnu.org; Sun, 03 May 2009 03:32:02 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:34702) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1M0WB6-0005cM-Kr for bug-gnu-emacs@gnu.org; Sun, 03 May 2009 03:32:01 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n437Vq4J021176; Sun, 3 May 2009 00:31:58 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id n437F4d5015859; Sun, 3 May 2009 00:15:04 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: YAMAMOTO Mitsuharu Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Sun, 03 May 2009 07:15:04 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 2401 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 2401-submit@emacsbugs.donarmstrong.com id=B2401.124133445014263 (code B ref 2401); Sun, 03 May 2009 07:15:04 +0000 Original-Received: (at 2401) by emacsbugs.donarmstrong.com; 3 May 2009 07:07:30 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from mathmail.math.s.chiba-u.ac.jp (ntp.math.s.chiba-u.ac.jp [133.82.132.2]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n4377P5E014248 for <2401@emacsbugs.donarmstrong.com>; Sun, 3 May 2009 00:07:27 -0700 Original-Received: from church.math.s.chiba-u.ac.jp (church [133.82.132.36]) by mathmail.math.s.chiba-u.ac.jp (Postfix) with ESMTP id 431852C40; Sun, 3 May 2009 16:07:23 +0900 (JST) In-Reply-To: <20090220040553.77C342544F0@localhost> User-Agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 =?UTF-8?Q?(Shij=C5=8D)?= APEL/10.6 Emacs/22.3 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Sun, 03 May 2009 03:32:09 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:27641 Archived-At: >>>>> On Thu, 19 Feb 2009 23:05:53 -0500 (EST), Alex Khesin said: > Consider the following function > (defun test-split-window () > (interactive) > (delete-other-windows) > (set-frame-width (selected-frame) 80) > (set-frame-width (selected-frame) 163) > (split-window-horizontally -80)) > Up to about a month ago, CVS emacs used to end up with a frame > containing two 80-characters-wide windows after executing > test-split-window. I updated to the latest CVS earlier today, and I > now get one of two behaviors: either the frame is made 80 wide but > split in two, or the frame becomes 163 wide, but not split at all, > with "Window width 0 (after splitting)" error message. Adding short > sleeps after set-frame-width fixes it: > (defun test-split-window () > (interactive) > (delete-other-windows) > (set-frame-width (selected-frame) 80) > (sleep-for 0 500) > (set-frame-width (selected-frame) 163) > (sleep-for 0 500) > (split-window-horizontally -80)) > Executing the set-frame-window and split-window-horizontally by > hand, one after another, also has the desirable effect. > It looks like set-frame-width does not take effect immediately anymore. This seems to be related to Bug#2980(*1) and both can only be observable with GTK+ frames for me. Below is my experimental change for Bug#2980, and it is included in an (also experimental) GTK+ print dialog support (*2). Because the printing support measures page boundary with pos-visible-in-window-p in an invisible frame, it needs to know its size before receiving ConfigureNotify and calling xg_frame_resized. As far as I tested, this patch also works for this bug. *1: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=2980 *2: http://lists.gnu.org/archive/html/emacs-devel/2009-04/msg00390.html YAMAMOTO Mitsuharu mituharu@math.s.chiba-u.ac.jp RCS file: /cvsroot/emacs/emacs/src/gtkutil.c,v retrieving revision 1.150 diff -c -p -r1.150 gtkutil.c *** src/gtkutil.c 19 Apr 2009 10:53:19 -0000 1.150 --- src/gtkutil.c 3 May 2009 06:40:58 -0000 *************** xg_frame_set_char_size (f, cols, rows) *** 736,741 **** --- 736,767 ---- x_wm_size_hint_off (f); gtk_window_resize (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), pixelwidth, pixelheight); + + #if 1 /* XXX: experimental change for Bug#2980 */ + /* Now, strictly speaking, we can't be sure that this is accurate, + but the window manager will get around to dealing with the size + change request eventually, and we'll hear how it went when the + ConfigureNotify event gets here. + + We could just not bother storing any of this information here, + and let the ConfigureNotify event set everything up, but that + might be kind of confusing to the Lisp code, since size changes + wouldn't be reported in the frame parameters until some random + point in the future when the ConfigureNotify event arrives. + + We pass 1 for DELAY since we can't run Lisp code inside of + a BLOCK_INPUT. */ + change_frame_size (f, rows, cols, 0, 1, 0); + FRAME_PIXEL_WIDTH (f) = pixelwidth; + FRAME_PIXEL_HEIGHT (f) = pixelheight; + + /* We've set {FRAME,PIXEL}_{WIDTH,HEIGHT} to the values we hope to + receive in the ConfigureNotify event; if we get what we asked + for, then the event won't cause the screen to become garbaged, so + we have to make sure to do it here. */ + SET_FRAME_GARBAGED (f); + #endif + flush_and_sync (f); x_wm_set_size_hint (f, 0, 0); }