Since last November, 21.5 has contained a problem where starting a
cygwin XEmacs via the cygwin run command brought up the initial window
unmapped. See this posting for details:
http://calypso.tux.org/pipermail/xemacs-patches/2006-November/000041.html
Here are the basic steps needed to observe the problem:
1. In a cmd window (not a cygwin shell), use the cygwin run command to
start a 21.5 xemacs. On my system, I can do this like so:
run /usr/local/bin/xemacs
2. The XEmacs window will not appear on the screen or on the taskbar,
although the XEmacs process will start, as you can verify with the
Task Manager. You can connect to the process with gnuclient
if you have started gnuserv in your XEmacs startup. Otherwise,
the XEmacs is unreachable.
While perusing the 21.4 source for frame-msw.c, I noticed the
following definition for mswindows_init_frame_3:
/* Called after frame's properties are set */
static void
mswindows_init_frame_3 (struct frame *f)
{
/* Don't do this earlier or we get a WM_PAINT before the frame is ready.
* The SW_x parameter in the first call that an app makes to ShowWindow is
* ignored, and the parameter specified in the caller's STARTUPINFO is
* substituted instead. That parameter is SW_HIDE if we were started by
* runemacs, so call this twice. #### runemacs is evil */
ShowWindow (FRAME_MSWINDOWS_HANDLE(f), SW_SHOWNORMAL);
ShowWindow (FRAME_MSWINDOWS_HANDLE(f), SW_SHOWNORMAL);
SetForegroundWindow (FRAME_MSWINDOWS_HANDLE(f));
DragAcceptFiles (FRAME_MSWINDOWS_HANDLE(f), TRUE);
}
Johnathan Harris edited the 21.5 version to remove the second call to
ShowWindow in May of 2002:
2002-05-06 Jonathan Harris <jonathan(a)xemacs.org>
* frame-msw.c (mswindows_init_frame_3):
Remove obsolete runemacs hack which called ShowWindow() twice.
While I agree with the sentiment that 2 calls to ShowWindow is a hack,
it appears that the second call is necessary in this instance -
restoring the second call to ShowWindow makes the initial frame
appear. This patch does restores mswindow_init_frame_3 to the
definition as it appears in 21.4.
--- src/ChangeLog~ 2007-08-17 07:46:16.184467000 -0400
+++ src/ChangeLog 2007-08-18 15:35:35.468750000 -0400
@@ -0,0 +1,7 @@
+2007-08-18 Vin Shelton <acs(a)xemacs.org>
+
+ * frame-msw.c (mswindows_init_frame_3): Restore extra call to
+ ShowWindow so that cygwin's run command can be used to open an
+ XEmacs session. Without out this, no frame appears when the
+ XEmacs process starts up.
+
--- src/frame-msw.c.orig 2007-08-15 09:01:09.769610000 -0400
+++ src/frame-msw.c 2007-08-18 15:32:48.156250000 -0400
@@ -304,10 +304,15 @@
static void
mswindows_init_frame_3 (struct frame *f)
{
- /* Don't do this earlier or we get a WM_PAINT before the frame is ready */
- ShowWindow (FRAME_MSWINDOWS_HANDLE (f), SW_SHOWNORMAL);
- SetForegroundWindow (FRAME_MSWINDOWS_HANDLE (f));
- DragAcceptFiles (FRAME_MSWINDOWS_HANDLE (f), TRUE);
+ /* Don't do this earlier or we get a WM_PAINT before the frame is ready.
+ * The SW_x parameter in the first call that an app makes to ShowWindow is
+ * ignored, and the parameter specified in the caller's STARTUPINFO is
+ * substituted instead. That parameter is SW_HIDE if we were started by
+ * runemacs, so call this twice. #### runemacs is evil */
+ ShowWindow (FRAME_MSWINDOWS_HANDLE(f), SW_SHOWNORMAL);
+ ShowWindow (FRAME_MSWINDOWS_HANDLE(f), SW_SHOWNORMAL);
+ SetForegroundWindow (FRAME_MSWINDOWS_HANDLE(f));
+ DragAcceptFiles (FRAME_MSWINDOWS_HANDLE(f), TRUE);
}
static void
I will apply this patch in a few days if no one objects.
Discussion welcome.
Regards,
Vin
--
The Journey by Mary Oliver
http://www.poemhunter.com/p/m/poem.asp?poet=6771&poem=30506
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches