Re: Xaw - Problems with keyboard focus easy to fix (Doh!) and Re: no key input

2003-11-17 Thread Harold L Hunt II
Colin,

Colin Harrison wrote:

Hi,

I recompiled my entire xc tree (shared libs Xaw, Xt, Xmu) with your Vendor.c
Xaw patch.
Keyboard focus now works for me when mouse pointer not in cygwin/xfree xterm
window.
Thanks for the sanity check.  It is good to have someone else doing a 
smoke test on patches such as this.  Your quick test allowed me to 
proceed quickly to a release.

Thanks,

Harold



Re: Xaw - Problems with keyboard focus easy to fix (Doh!) and Re: no key input

2003-11-17 Thread Colin Harrison
Hi,

I recompiled my entire xc tree (shared libs Xaw, Xt, Xmu) with your Vendor.c
Xaw patch.
Keyboard focus now works for me when mouse pointer not in cygwin/xfree xterm
window.

Thanks

Colin



Xaw - Problems with keyboard focus easy to fix (Doh!)

2003-11-17 Thread Harold L Hunt II
There is a fix in the Xaw library for fixing the VendorShell, just as in 
LessTif.  I simply enabled a Windows-specific version of this fix based 
off of Zhangrong Huang's LessTif fix.

The patch is attached.  I did a build test of this and ran a 
non-recompiled xterm.exe against it: keyboard focus worked without the 
mouse pointer being in the xterm window.

I'd like to get this released quickly, but I have to work for the moment.

Harold
Index: Vendor.c
===
RCS file: /cvs/xc/lib/Xaw/Vendor.c,v
retrieving revision 1.9
diff -u -r1.9 Vendor.c
--- Vendor.c31 May 2002 18:45:44 -  1.9
+++ Vendor.c17 Nov 2003 19:33:56 -
@@ -111,11 +111,13 @@
  *
  ***/
 
-#ifdef __UNIXOS2__
+#if defined(__UNIXOS2__) || defined(__CYGWIN__) 
 /* to fix the EditRes problem because of wrong linker semantics */
 extern WidgetClass vendorShellWidgetClass; /* from Xt/Vendor.c */
 extern VendorShellClassRec _XawVendorShellClassRec;
 extern void _XawFixupVendorShell();
+
+#if defined(__UNIXOS2__)
 unsigned long _DLL_InitTerm(unsigned long mod,unsigned long flag)
 {
switch (flag) {
@@ -130,6 +132,25 @@
return 0;
}
 }
+#endif
+
+#if defined(__CYGWIN__)
+int __stdcall
+DllMain(unsigned long mod_handle, unsigned long flag, void *routine)
+{
+  switch (flag)
+{
+case 1: /* DLL_PROCESS_ATTACH - process attach */
+  vendorShellWidgetClass = (WidgetClass)(&_XawVendorShellClassRec);
+  _XawFixupVendorShell();
+  break;
+case 0: /* DLL_PROCESS_DETACH - process detach */
+  break;
+}
+  return 1;
+}
+#endif
+
 #define vendorShellClassRec _XawVendorShellClassRec
 
 #endif
@@ -337,7 +358,7 @@
 }
 }
 
-#if defined(__osf__) || defined(__UNIXOS2__)
+#if defined(__osf__) || defined(__UNIXOS2__) || defined(__CYGWIN__)
 /* stupid OSF/1 shared libraries have the wrong semantics */
 /* symbols do not get resolved external to the shared library */
 void _XawFixupVendorShell()