From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel Subject: Re: Frame size changes Date: Sun, 05 Oct 2008 14:35:09 -0400 Message-ID: <87od1y99gi.fsf@cyd.mit.edu> References: <877i8qvq5k.fsf@cyd.mit.edu> <48E5C4E5.9040400@swipnet.se> <873ajdtuhz.fsf@cyd.mit.edu> <48E7191F.7060407@swipnet.se> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1223231644 19593 80.91.229.12 (5 Oct 2008 18:34:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 5 Oct 2008 18:34:04 +0000 (UTC) Cc: emacs-devel@gnu.org To: Jan =?utf-8?Q?Dj=C3=A4rv?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Oct 05 20:35:01 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KmYRW-0005d8-92 for ged-emacs-devel@m.gmane.org; Sun, 05 Oct 2008 20:34:58 +0200 Original-Received: from localhost ([127.0.0.1]:57620 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KmYQS-0007sp-PF for ged-emacs-devel@m.gmane.org; Sun, 05 Oct 2008 14:33:52 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KmYQN-0007sO-JI for emacs-devel@gnu.org; Sun, 05 Oct 2008 14:33:47 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KmYQL-0007rw-O8 for emacs-devel@gnu.org; Sun, 05 Oct 2008 14:33:47 -0400 Original-Received: from [199.232.76.173] (port=55849 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KmYQL-0007rt-JQ for emacs-devel@gnu.org; Sun, 05 Oct 2008 14:33:45 -0400 Original-Received: from cyd.mit.edu ([18.115.2.24]:60313) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KmYQL-0008Ru-3v for emacs-devel@gnu.org; Sun, 05 Oct 2008 14:33:45 -0400 Original-Received: by cyd.mit.edu (Postfix, from userid 1000) id A7E2557E0B4; Sun, 5 Oct 2008 14:35:09 -0400 (EDT) In-Reply-To: <48E7191F.7060407@swipnet.se> ("Jan =?utf-8?Q?Dj=C3=A4rv=22's?= message of "Sat, 04 Oct 2008 09:19:59 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:104347 Archived-At: How about the proposed solution (patch included): The variable after-init-time (new to Emacs 23) is set to `current-time' after initialization. Since it's nil during initialization, we can use it to tell if Emacs is currently being initialized. Suppose we make after-init-time a built-in variable. Then, make x_wm_set_size_hint a no-op when after-init-time is nil. The result is that WM hints are not set during initialization. According to my (non-thorough) testing, this eliminates the erratic frame sizing during startup, without introducing any other ill effects. What do you think? *** trunk/lisp/startup.el.~1.507.~ 2008-10-02 16:21:54.000000000 -0400 --- trunk/lisp/startup.el 2008-10-05 14:17:47.000000000 -0400 *************** *** 257,268 **** therefore, if you set `debug-on-error' non-nil in `.emacs', an error in one of these functions will invoke the debugger.") - (defvar before-init-time nil - "Value of `current-time' before Emacs begins initialization.") - - (defvar after-init-time nil - "Value of `current-time' after loading the init files.") - (defvar emacs-startup-hook nil "Normal hook run after loading init files and handling the command line.") --- 257,262 ---- *** trunk/src/lisp.h.~1.644.~ 2008-09-24 16:14:33.000000000 -0400 --- trunk/src/lisp.h 2008-10-05 14:23:45.000000000 -0400 *************** *** 3102,3107 **** --- 3102,3108 ---- /* defined in emacs.c */ extern Lisp_Object decode_env_path P_ ((char *, char *)); extern Lisp_Object Vinvocation_name, Vinvocation_directory; + extern Lisp_Object Vbefore_init_time, Vafter_init_time; extern Lisp_Object Vinstallation_directory; extern Lisp_Object empty_unibyte_string, empty_multibyte_string; EXFUN (Fkill_emacs, 1); *** trunk/src/emacs.c.~1.447.~ 2008-10-05 14:07:06.000000000 -0400 --- trunk/src/emacs.c 2008-10-05 14:27:01.000000000 -0400 *************** *** 131,136 **** --- 131,139 ---- nil means get them only from PATH_LOADSEARCH. */ Lisp_Object Vinstallation_directory; + /* The values of `current-time' before and after Emacs initialization. */ + Lisp_Object Vbefore_init_time, Vafter_init_time; + /* Hook run by `kill-emacs' before it does really anything. */ Lisp_Object Vkill_emacs_hook; *************** *** 2497,2502 **** --- 2500,2513 ---- DEFVAR_LISP ("previous-system-time-locale", &Vprevious_system_time_locale, doc: /* Most recently used system locale for time. */); Vprevious_system_time_locale = Qnil; + + DEFVAR_LISP ("before-init-time", &Vbefore_init_time, + doc: /* Value of `current-time' before Emacs begins initialization. */); + Vbefore_init_time = Qnil; + + DEFVAR_LISP ("after-init-time", &Vafter_init_time, + doc: /* Value of `current-time' after loading the init files. */); + Vafter_init_time = Qnil; } /* arch-tag: 7bfd356a-c720-4612-8ab6-aa4222931c2e *** trunk/src/gtkutil.c.~1.138.~ 2008-07-29 12:15:41.000000000 -0400 --- trunk/src/gtkutil.c 2008-10-05 14:22:01.000000000 -0400 *************** *** 934,939 **** --- 934,942 ---- long flags; int user_position; { + if (NILP (Vafter_init_time)) + return; + if (FRAME_GTK_OUTER_WIDGET (f)) { /* Must use GTK routines here, otherwise GTK resets the size hints