mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-04-19 09:00:47 +02:00
Fix - Occasional Paste Problem. (Dan Wilks @ Intuit)
This commit is contained in:
parent
525f80baae
commit
5228ce0353
5 changed files with 43 additions and 0 deletions
|
|
@ -765,6 +765,9 @@ winPixmapToRegionNativeGDI (PixmapPtr pPix);
|
|||
|
||||
Bool
|
||||
winInitClipboard (void);
|
||||
|
||||
void
|
||||
winFixClipboardChain (void);
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -47,6 +47,8 @@ DISPATCH_PROC(winProcSetSelectionOwner);
|
|||
|
||||
extern pthread_t g_ptClipboardProc;
|
||||
extern winDispatchProcPtr winProcSetSelectionOwnerOrig;
|
||||
extern Bool g_fClipboard;
|
||||
extern HWND g_hwndClipboard;
|
||||
|
||||
|
||||
/*
|
||||
|
|
@ -126,3 +128,13 @@ winClipboardCreateMessagingWindow ()
|
|||
|
||||
return hwnd;
|
||||
}
|
||||
|
||||
void
|
||||
winFixClipboardChain (void)
|
||||
{
|
||||
if (g_fClipboard
|
||||
&& g_hwndClipboard)
|
||||
{
|
||||
SendMessage (g_hwndClipboard, WM_WM_REINIT, 0, 0);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -181,6 +181,30 @@ winClipboardWindowProc (HWND hwnd, UINT message,
|
|||
}
|
||||
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:
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1110,6 +1110,9 @@ winWindowProc (HWND hwnd, UINT message,
|
|||
ShowCursor (TRUE);
|
||||
}
|
||||
|
||||
/* Make sure the clipboard chain is ok. */
|
||||
winFixClipboardChain ();
|
||||
|
||||
/* Call engine specific screen activation/deactivation function */
|
||||
(*s_pScreenPriv->pwinActivateApp) (s_pScreen);
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue