[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Frame size changes
From: |
Chong Yidong |
Subject: |
Re: Frame size changes |
Date: |
Sun, 05 Oct 2008 14:35:09 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) |
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
- Re: Frame size changes, (continued)
- Re: Frame size changes, Jan Djärv, 2008/10/03
- Re: Frame size changes, Chong Yidong, 2008/10/03
- Re: Frame size changes, Jan Djärv, 2008/10/04
- Re: Frame size changes, Stefan Monnier, 2008/10/04
- Re: Frame size changes, Miles Bader, 2008/10/06
- Re: Frame size changes, Juanma Barranquero, 2008/10/06
- Re: Frame size changes, Miles Bader, 2008/10/06
- Re: Frame size changes, Juanma Barranquero, 2008/10/06
- Re: Frame size changes, Miles Bader, 2008/10/06
- Re: Frame size changes, Juanma Barranquero, 2008/10/06
- Re: Frame size changes,
Chong Yidong <=
- Re: Frame size changes, Eli Zaretskii, 2008/10/05
- Re: Frame size changes, Chong Yidong, 2008/10/05
- Re: Frame size changes, Eli Zaretskii, 2008/10/05
- Re: Frame size changes, Chong Yidong, 2008/10/05
- Re: Frame size changes, Lennart Borgman (gmail), 2008/10/05
- Re: Frame size changes, Jan Djärv, 2008/10/05