[xorg-commit-diffs] xc/programs/Xserver/hw/xwin win.h, 1.1.4.1.2.30, 1.1.4.1.2.31 winclipboard.h, 1.1.4.1.2.13, 1.1.4.1.2.14 winclipboardinit.c, 1.1.4.1.2.7, 1.1.4.1.2.8 winclipboardwndproc.c, 1.1.4.1.2.16, 1.1.4.1.2.17 winwndproc.c, 1.1.4.1.2.20, 1.1.4.1.2.21

Harold L Hunt II xorg-commit at pdx.freedesktop.org
Sat Apr 24 04:17:31 EST 2004


Committed by: harold

Update of /cvs/xorg/xc/programs/Xserver/hw/xwin
In directory pdx:/tmp/cvs-serv927

Modified Files:
      Tag: CYGWIN
	win.h winclipboard.h winclipboardinit.c winclipboardwndproc.c 
	winwndproc.c 
Log Message:
Fix - Occasional Paste Problem.  (Dan Wilks @ Intuit)

Index: win.h
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/win.h,v
retrieving revision 1.1.4.1.2.30
retrieving revision 1.1.4.1.2.31
diff -u -d -r1.1.4.1.2.30 -r1.1.4.1.2.31
--- a/win.h	23 Apr 2004 07:43:06 -0000	1.1.4.1.2.30
+++ b/win.h	23 Apr 2004 18:17:29 -0000	1.1.4.1.2.31
@@ -765,6 +765,9 @@
 
 Bool
 winInitClipboard (void);
+
+void
+winFixClipboardChain (void);
 #endif
 
 

Index: winclipboard.h
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/winclipboard.h,v
retrieving revision 1.1.4.1.2.13
retrieving revision 1.1.4.1.2.14
diff -u -d -r1.1.4.1.2.13 -r1.1.4.1.2.14
--- a/winclipboard.h	30 Mar 2004 18:42:28 -0000	1.1.4.1.2.13
+++ b/winclipboard.h	23 Apr 2004 18:17:29 -0000	1.1.4.1.2.14
@@ -76,6 +76,7 @@
 #define WIN_XEVENTS_CONVERT			2
 #define WIN_XEVENTS_NOTIFY			3
 
+#define WM_WM_REINIT                           (WM_USER + 1)
 
 /*
  * References to external symbols

Index: winclipboardinit.c
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/winclipboardinit.c,v
retrieving revision 1.1.4.1.2.7
retrieving revision 1.1.4.1.2.8
diff -u -d -r1.1.4.1.2.7 -r1.1.4.1.2.8
--- a/winclipboardinit.c	26 Mar 2004 19:45:21 -0000	1.1.4.1.2.7
+++ b/winclipboardinit.c	23 Apr 2004 18:17:29 -0000	1.1.4.1.2.8
@@ -47,6 +47,8 @@
 
 extern pthread_t		g_ptClipboardProc;
 extern winDispatchProcPtr	winProcSetSelectionOwnerOrig;
+extern Bool			g_fClipboard;
+extern HWND			g_hwndClipboard;
 
 
 /*
@@ -126,3 +128,13 @@
 
   return hwnd;
 }
+
+void
+winFixClipboardChain (void)
+{
+   if (g_fClipboard
+       && g_hwndClipboard)
+     {
+       SendMessage (g_hwndClipboard, WM_WM_REINIT, 0, 0);
+     }
+}

Index: winclipboardwndproc.c
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/winclipboardwndproc.c,v
retrieving revision 1.1.4.1.2.16
retrieving revision 1.1.4.1.2.17
diff -u -d -r1.1.4.1.2.16 -r1.1.4.1.2.17
--- a/winclipboardwndproc.c	30 Mar 2004 14:57:10 -0000	1.1.4.1.2.16
+++ b/winclipboardwndproc.c	23 Apr 2004 18:17:29 -0000	1.1.4.1.2.17
@@ -181,6 +181,30 @@
       }
       return 0;
 
+    case WM_WM_REINIT:
+      {
+        /* Ensure that we're in the clipboard chain.  Some apps,
+           WinXP's remote desktop for one, don't play nice with
+           the chain.  This message is called whenever we receive
+           a WM_ACTIVATEAPP message to ensure that we continue to
+           receive clipboard messages.
+     
+           It might be possible to detect if we're still in the
+           chain by calling
+              SendMessage (GetClipboardViewer(), WM_DRAWCLIPBOARD, 0, 0);
+           and then seeing if we get the WM_DRAWCLIPBOARD message.
+           That, however, might be more expensive than just putting
+           ourselves back into the chain.
+        */
+
+        s_fCBCInitialized = FALSE;
+        ChangeClipboardChain (hwnd, s_hwndNextViewer);
+        s_hwndNextViewer = NULL;
+        s_fCBCInitialized = FALSE;
+        s_hwndNextViewer = SetClipboardViewer (hwnd);
+      }
+      return 0;
+
 
     case WM_DRAWCLIPBOARD:
       {

Index: winwndproc.c
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/winwndproc.c,v
retrieving revision 1.1.4.1.2.20
retrieving revision 1.1.4.1.2.21
diff -u -d -r1.1.4.1.2.20 -r1.1.4.1.2.21
--- a/winwndproc.c	3 Apr 2004 22:21:56 -0000	1.1.4.1.2.20
+++ b/winwndproc.c	23 Apr 2004 18:17:29 -0000	1.1.4.1.2.21
@@ -1110,6 +1110,9 @@
 	  ShowCursor (TRUE);
 	}
 
+      /* Make sure the clipboard chain is ok. */
+      winFixClipboardChain ();
+
       /* Call engine specific screen activation/deactivation function */
       (*s_pScreenPriv->pwinActivateApp) (s_pScreen);
       return 0;




More information about the xorg-commit-diffs mailing list