diff options
author | marha <marha@users.sourceforge.net> | 2015-02-24 07:44:41 +0100 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2015-02-24 07:44:41 +0100 |
commit | f64e43decd0fdac938feddeedee255dc4508aaa5 (patch) | |
tree | 34e1cfaaea9ad73d9335197ee79b4f99affe4ea9 /xorg-server/hw/xwin/winclipboard/xevents.c | |
parent | 462f18c7b25fe3e467f837647d07ab0a78aa8d2b (diff) | |
parent | ac2c8a704aac7569f4ae85b890a546644bd86c60 (diff) | |
download | vcxsrv-f64e43decd0fdac938feddeedee255dc4508aaa5.tar.gz vcxsrv-f64e43decd0fdac938feddeedee255dc4508aaa5.tar.bz2 vcxsrv-f64e43decd0fdac938feddeedee255dc4508aaa5.zip |
Merge remote-tracking branch 'origin/released'
Conflicts:
apps/xcalc/math.c
freetype/src/base/ftbdf.c
freetype/src/base/fttype1.c
freetype/src/pfr/pfrobjs.c
mesalib/src/mesa/main/.gitignore
openssl/Configure
openssl/Makefile
openssl/crypto/cryptlib.c
openssl/crypto/opensslconf.h
openssl/test/v3nametest.c
openssl/util/mk1mf.pl
openssl/util/pl/VC-32.pl
xorg-server/Xi/xipassivegrab.c
xorg-server/dix/dispatch.c
xorg-server/dix/getevents.c
xorg-server/glx/glxcmds.c
xorg-server/glx/indirect_reqsize.c
xorg-server/glx/indirect_reqsize.h
xorg-server/hw/xwin/winclipboard/internal.h
xorg-server/hw/xwin/winclipboard/thread.c
xorg-server/hw/xwin/winclipboard/wndproc.c
xorg-server/hw/xwin/winclipboard/xevents.c
xorg-server/hw/xwin/winclipboardwrappers.c
xorg-server/hw/xwin/winprocarg.c
xorg-server/render/render.c
Diffstat (limited to 'xorg-server/hw/xwin/winclipboard/xevents.c')
-rwxr-xr-x | xorg-server/hw/xwin/winclipboard/xevents.c | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/xorg-server/hw/xwin/winclipboard/xevents.c b/xorg-server/hw/xwin/winclipboard/xevents.c index 640efeb4e..5f426322d 100755 --- a/xorg-server/hw/xwin/winclipboard/xevents.c +++ b/xorg-server/hw/xwin/winclipboard/xevents.c @@ -34,6 +34,7 @@ #include <xwin-config.h> #endif #include "winclipboard.h" +#include "winglobals.h" #include "misc.h" #include "winmsg.h" /* @@ -50,7 +51,7 @@ #include <wchar.h> #include <X11/Xutil.h> #include <X11/Xatom.h> -//#include <X11/extensions/Xfixes.h> +#include <X11/extensions/Xfixes.h> #include "winclipboard.h" #include "internal.h" @@ -71,8 +72,6 @@ extern int xfixes_event_base; Bool fPrimarySelection = TRUE; -extern Bool g_fClipboardPrimary; - /* * Local variables */ @@ -308,23 +307,24 @@ winClipboardFlushXEvents(HWND hwnd, break; } - /* Access the clipboard */ - if (!ClipboardOpened) - { - if (!OpenClipboard (hwnd)) - { - ErrorF ("winClipboardFlushXEvents - SelectionRequest - " + /* Close clipboard if we have it open already */ + if (GetOpenClipboardWindow() == hwnd) { + CloseClipboard(); + } + + /* Access the clipboard */ + if (!OpenClipboard(hwnd)) { + ErrorF("winClipboardFlushXEvents - SelectionRequest - " "OpenClipboard () failed: %08lx\n", GetLastError()); /* Abort */ fAbort = TRUE; goto winClipboardFlushXEvents_SelectionRequest_Done; - } - - /* Indicate that clipboard was opened */ - fCloseClipboard = TRUE; } + /* Indicate that clipboard was opened */ + fCloseClipboard = TRUE; + /* Check that clipboard format is available */ if (data->fUseUnicode && !IsClipboardFormatAvailable(CF_UNICODETEXT)) { static int count; /* Hack to stop acroread spamming the log */ @@ -374,13 +374,13 @@ winClipboardFlushXEvents(HWND hwnd, hGlobal = GetClipboardData(CF_TEXT); } if (!hGlobal) { - if (GetLastError()==ERROR_CLIPBOARD_NOT_OPEN && ClipboardOpened) + if (GetLastError()==ERROR_CLIPBOARD_NOT_OPEN && g_fClipboardStarted) { ErrorF("We should not have received a SelectionRequest????\n" "The owner is the clipboard, but in reality it was" "an X window\n"); /* Set the owner to None */ - if (g_fClipboardPrimary) XSetSelectionOwner (pDisplay, XA_PRIMARY, None, CurrentTime); + if (fPrimarySelection) XSetSelectionOwner (pDisplay, XA_PRIMARY, None, CurrentTime); XSetSelectionOwner (pDisplay, XInternAtom (pDisplay, "CLIPBOARD", False), None, CurrentTime); } ErrorF ("winClipboardFlushXEvents - SelectionRequest - " @@ -470,11 +470,9 @@ winClipboardFlushXEvents(HWND hwnd, /* Release the clipboard data */ GlobalUnlock(hGlobal); pszGlobalData = NULL; - if (fCloseClipboard) - { - fCloseClipboard = FALSE; - CloseClipboard (); - } + fCloseClipboard = FALSE; + CloseClipboard(); + /* Clean up */ XFree(xtpText.value); xtpText.value = NULL; |