delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/07/08/19:49:17

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Fri, 8 Jul 2005 19:10:01 -0500
From: Jordan DeLong <fracture AT allusion DOT net>
To: cygwin AT cygwin DOT com
Subject: patch for some rxvt stuff
Message-ID: <20050709001001.GA7114@allusion.net>
Mime-Version: 1.0
User-Agent: Mutt/1.5.9i

--/NkBOFFp2J2Af1nK
Content-Type: multipart/mixed; boundary="qMm9M+Fa2AknHoGS"
Content-Disposition: inline

--qMm9M+Fa2AknHoGS
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Sorry if this is the wrong place to send this.  I tried sending to the
rxvt guys at sf, and got no response.

Anyway; in case whoever maintains the cygwin port is listening, here's
some diffs...

--=20
Jordan DeLong
fracture AT allusion DOT net

--qMm9M+Fa2AknHoGS
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=CHANGES

changes:
 - libW11 support to change the cursor to a xterm cursor
 - don't go into the menu-state when someone presses and then releases Alt
 - don't close terminals when people hit the x button or alt+f4
 - fix NT_get_state:
    - allow using the VK_LWIN key as a meta key (people who use litestep
      may want this, because they can turn off the windows menu popup crap).
    - fix logic about control
 - small tweak that makes inherit pixmap a *lot* faster (i.e. actually
   usuable)

--qMm9M+Fa2AknHoGS
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="CHANGES.diff"
Content-Transfer-Encoding: quoted-printable

diff -ruN rxvt-dist/W11/w32/event.c rxvt/W11/w32/event.c
--- rxvt-dist/W11/w32/event.c	2005-04-04 20:24:49.000000000 -0500
+++ rxvt/W11/w32/event.c	2005-06-27 17:35:52.920411200 -0500
@@ -196,6 +196,18 @@
     mask =3D window->mask;
=20=09
     switch (message) {
+        case WM_SYSKEYDOWN:
+	    // Don't go into the menu mode for alt keys.
+	    return 0L;
+    	case WM_CLOSE:
+	    // Never close when people hit the x button.
+	    return 0L;
+	case WM_SETCURSOR:
+	    if (window->cursor !=3D INVALID_HANDLE) {
+	        SetCursor(window->cursor);
+		return TRUE;
+	    }
+	    return NT_default(hWnd, message, wParam, lParam);
 	/* we'll handle these, later */
 	case WM_KILLFOCUS:
 	    QEvent(wineventq,window,message,wParam,lParam);
@@ -203,7 +215,6 @@
 	    break;
 	case WM_SETFOCUS:
 	case WM_QUIT:
-	case WM_CLOSE:
 	case WM_DESTROY:
 	case WM_SYSCHAR: /* alt-keys go here */
 	case WM_CHAR:
@@ -352,13 +363,9 @@
 {
 	unsigned int state =3D 0;
 	if (GetKeyState(VK_SHIFT)   & 0x8000) state |=3D ShiftMask;
-	if (GetKeyState(VK_CONTROL) & 0x8000)
-	{
-		if (!(GetKeyState(VK_MENU) & 0x8000))=20
-			state |=3D ControlMask;
-	}
-	else if (GetKeyState(VK_MENU)    & 0x8000)
-		state |=3D Mod1Mask;
+	if (GetKeyState(VK_CONTROL) & 0x8000) state |=3D ControlMask;
+	if (GetKeyState(VK_MENU)    & 0x8000) state |=3D Mod1Mask;
+	if (GetKeyState(VK_LWIN)    & 0x8000) state |=3D Mod1Mask;
 	if (GetKeyState(VK_CAPITAL) & 0x0001) state |=3D LockMask;
 	if (GetKeyState(VK_NUMLOCK) & 0x0001) state |=3D Mod5Mask;
 	if (GetKeyState(VK_SCROLL)  & 0x0001) state |=3D Mod3Mask;
diff -ruN rxvt-dist/W11/w32/ntdef.h rxvt/W11/w32/ntdef.h
--- rxvt-dist/W11/w32/ntdef.h	2002-12-03 23:21:30.000000000 -0600
+++ rxvt/W11/w32/ntdef.h	2005-06-27 17:15:22.154786200 -0500
@@ -35,6 +35,7 @@
 	HWND w;
 	HBRUSH bg;
 	int parentRelative;
+	HCURSOR cursor;                /* cursor for this window */
 	struct NT_window *parent;      /* parent of this window */
 	struct NT_window *next;        /* next window in list */
 	struct NT_child *child;        /* points to list of children */
diff -ruN rxvt-dist/W11/w32/ntutil.c rxvt/W11/w32/ntutil.c
--- rxvt-dist/W11/w32/ntutil.c	2002-12-03 23:21:30.000000000 -0600
+++ rxvt/W11/w32/ntutil.c	2005-06-27 17:17:07.826661200 -0500
@@ -38,6 +38,7 @@
 	new->parent=3D NULL;
 	new->hBitmap =3D INVALID_HANDLE;
 	new->hDC =3D INVALID_HANDLE;
+	new->cursor =3D INVALID_HANDLE;
 	window_list =3D new;
 	cjh_printf("NEW window %x\n",window_list);
 	return(window_list);
diff -ruN rxvt-dist/W11/w32/xlib.c rxvt/W11/w32/xlib.c
--- rxvt-dist/W11/w32/xlib.c	2004-01-05 23:51:12.000000000 -0600
+++ rxvt/W11/w32/xlib.c	2005-06-27 17:32:46.217286200 -0500
@@ -2914,7 +2914,11 @@
 unsigned int shape;
 {
 	xtrace("XCreateFontCursor\n");
-	return 0;
+	if (shape =3D=3D XC_xterm ||
+			shape =3D=3D XC_left_ptr ||
+			shape =3D=3D 0)
+		return shape;
+	return -1;
 }
=20
=20
@@ -4239,9 +4243,23 @@
 	xtrace("XSetWMProperties\n");
 	XSetNormalHints(display,w,normal_hints);
 }
+
+int
 XDefineCursor(Display* display,Window w,Cursor cursor)
 {
+	NT_window *ntw=3D(NT_window *)w;
+	LPCTSTR csr;
+
 	xtrace("XDefineCursor\n");
+
+	switch (cursor) {
+	case XC_xterm:		csr =3D IDC_IBEAM;	break;
+	case XC_left_ptr:	csr =3D IDC_ARROW;	break;
+	default:
+		return 0;
+	}
+
+	ntw->cursor =3D LoadCursor(NULL, csr);
 	return 0;
 }
diff -ruN rxvt-dist/src/command.c rxvt/src/command.c
--- rxvt-dist/src/command.c	2005-06-29 15:49:56.066384100 -0500
+++ rxvt/src/command.c	2005-06-29 16:51:00.003884100 -0500
@@ -1921,6 +1921,14 @@
 	} else {
 	    /* wait (an arbitrary period) for the WM to do its thing
 	     * needed for fvwm2.2.2 (and before?) */
+#ifndef __CYGWIN__
+	     /*
+	      * JRD:  this waits a whole second any time you move a
+	      * window on cygwin (because it sends *lots* of a
+	      * configure notifies, unlike a reparenting x11 window
+	      * manager).  Needless to say, this *sucks*, so turn it
+	      * off.
+	      */
 # ifdef HAVE_NANOSLEEP
 	    struct timespec rqt;
=20
@@ -1930,6 +1938,7 @@
 # else
 	    sleep(1);=09
 # endif
+#endif
 	    D_X((stderr, "InheritPixmap Turning on (%d parents)", i - 1));
 	    for (n =3D 0; n < (unsigned int)i; n++)
 		XSetWindowBackgroundPixmap(r->Xdisplay, r->TermWin.parent[n],

--qMm9M+Fa2AknHoGS--

--/NkBOFFp2J2Af1nK
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFCzxXZDrrilS51AZ8RAk1JAJ9QTqs1n7i9KRvJJ5S/DUJ2QjixbACeLRZy
XSm3YB0IMKLJijelu6Ny6R0=
=CqIF
-----END PGP SIGNATURE-----

--/NkBOFFp2J2Af1nK--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019