summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authorhobbs <hobbs>2004-05-03 22:23:08 (GMT)
committerhobbs <hobbs>2004-05-03 22:23:08 (GMT)
commitaa114d8af1cf1ad366fc05366e1c3caf052d93a7 (patch)
treef21e1f470165b77c99152ae0e76a22ffba6c2a69 /unix
parent0cae2f61a22eb7f4c3b41e2a569c03b86b79f4b4 (diff)
downloadtk-aa114d8af1cf1ad366fc05366e1c3caf052d93a7.zip
tk-aa114d8af1cf1ad366fc05366e1c3caf052d93a7.tar.gz
tk-aa114d8af1cf1ad366fc05366e1c3caf052d93a7.tar.bz2
* generic/tkClipboard.c: Move TkClipCleanup from tkClipboard.c
* mac/tkMacXStubs.c: to being implemented in a platform * macosx/tkMacOSXXStubs.c: specific manner. The cleanup order was * unix/tkUnixEvent.c: bad at least on Windows, where we * win/tkWinX.c: reset/cleared display info that was still needed for the clipboard to render. [Bug #939389, #822002, #732662]
Diffstat (limited to 'unix')
-rw-r--r--unix/tkUnixEvent.c38
1 files changed, 37 insertions, 1 deletions
diff --git a/unix/tkUnixEvent.c b/unix/tkUnixEvent.c
index 8fa56d1..b1bf18b 100644
--- a/unix/tkUnixEvent.c
+++ b/unix/tkUnixEvent.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkUnixEvent.c,v 1.11.2.1 2003/07/16 01:20:13 mdejong Exp $
+ * RCS: @(#) $Id: tkUnixEvent.c,v 1.11.2.2 2004/05/03 22:23:09 hobbs Exp $
*/
#include "tkInt.h"
@@ -241,6 +241,42 @@ TkpCloseDisplay(dispPtr)
/*
*----------------------------------------------------------------------
*
+ * TkClipCleanup --
+ *
+ * This procedure is called to cleanup resources associated with
+ * claiming clipboard ownership and for receiving selection get
+ * results. This function is called in tkWindow.c. This has to be
+ * called by the display cleanup function because we still need the
+ * access display elements.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Resources are freed - the clipboard may no longer be used.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkClipCleanup(dispPtr)
+ TkDisplay *dispPtr; /* display associated with clipboard */
+{
+ if (dispPtr->clipWindow != NULL) {
+ Tk_DeleteSelHandler(dispPtr->clipWindow, dispPtr->clipboardAtom,
+ dispPtr->applicationAtom);
+ Tk_DeleteSelHandler(dispPtr->clipWindow, dispPtr->clipboardAtom,
+ dispPtr->windowAtom);
+
+ Tk_DestroyWindow(dispPtr->clipWindow);
+ Tcl_Release((ClientData) dispPtr->clipWindow);
+ dispPtr->clipWindow = NULL;
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
* DisplaySetupProc --
*
* This procedure implements the setup part of the UNIX X display