From b3ded1264131db861d4bc28de80cebc7b1a27d26 Mon Sep 17 00:00:00 2001 From: marha Date: Mon, 31 Aug 2009 05:12:42 +0000 Subject: Wait for clipboard thread to be started when already launched but not yet started. --- xorg-server/hw/xwin/winclipboardwrappers.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'xorg-server/hw/xwin/winclipboardwrappers.c') diff --git a/xorg-server/hw/xwin/winclipboardwrappers.c b/xorg-server/hw/xwin/winclipboardwrappers.c index 5578182c1..1e4f910ba 100644 --- a/xorg-server/hw/xwin/winclipboardwrappers.c +++ b/xorg-server/hw/xwin/winclipboardwrappers.c @@ -342,9 +342,20 @@ winProcSetSelectionOwner (ClientPtr client) /* Abort if clipboard not completely initialized yet */ if (!g_fClipboardStarted) { - ErrorF ("winProcSetSelectionOwner - Clipboard not yet started, " - "aborting.\n"); - goto winProcSetSelectionOwner_Done; + if (g_fClipboardLaunched) + { + // Just wait until it is started + ErrorF ("winProcSetSelectionOwner - waiting to be started.\n"); + while (g_fClipboardLaunched && !g_fClipboardStarted) + Sleep(0); + ErrorF ("winProcSetSelectionOwner - Clipboard started.\n"); + } + else + { + ErrorF ("winProcSetSelectionOwner - Clipboard not yet started, " + "aborting.\n"); + goto winProcSetSelectionOwner_Done; + } } /* Grab window if we have one */ @@ -511,8 +522,8 @@ winProcSetSelectionOwner (ClientPtr client) /* Access the Windows clipboard */ if (!OpenClipboard (g_hwndClipboard)) { - ErrorF ("winProcSetSelectionOwner - OpenClipboard () failed: %08x\n", - (int) GetLastError ()); + ErrorF ("winProcSetSelectionOwner - OpenClipboard () failed: %08x, hwnd: %08x\n", + (int) GetLastError (),g_hwndClipboard); goto winProcSetSelectionOwner_Done; } -- cgit v1.2.3