summaryrefslogtreecommitdiffstats
path: root/mac
diff options
context:
space:
mode:
authorhobbs <hobbs>2004-05-03 22:23:08 (GMT)
committerhobbs <hobbs>2004-05-03 22:23:08 (GMT)
commit5a7c9991c1e212687cf3383f542968c474dc6497 (patch)
treef21e1f470165b77c99152ae0e76a22ffba6c2a69 /mac
parentc1b0a281aa6ab1f13f009d3bdd83c99b7df4aea9 (diff)
downloadtk-5a7c9991c1e212687cf3383f542968c474dc6497.zip
tk-5a7c9991c1e212687cf3383f542968c474dc6497.tar.gz
tk-5a7c9991c1e212687cf3383f542968c474dc6497.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 'mac')
-rw-r--r--mac/tkMacXStubs.c52
1 files changed, 44 insertions, 8 deletions
diff --git a/mac/tkMacXStubs.c b/mac/tkMacXStubs.c
index 2de6028..e49d622 100644
--- a/mac/tkMacXStubs.c
+++ b/mac/tkMacXStubs.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkMacXStubs.c,v 1.16 2002/10/09 11:57:05 das Exp $
+ * RCS: @(#) $Id: tkMacXStubs.c,v 1.16.2.1 2004/05/03 22:23:09 hobbs Exp $
*/
#include "tkInt.h"
@@ -169,13 +169,6 @@ TkpCloseDisplay(
panic("TkpCloseDisplay: tried to call TkpCloseDisplay on bad display");
}
- /*
- * Make sure that the local scrap is transfered to the global
- * scrap if needed.
- */
-
- TkSuspendClipboard();
-
gMacDisplay = NULL;
if (display->screens != (Screen *) NULL) {
if (display->screens->root_visual != (Visual *) NULL) {
@@ -189,6 +182,49 @@ TkpCloseDisplay(
/*
*----------------------------------------------------------------------
*
+ * 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 */
+{
+ /*
+ * Make sure that the local scrap is transfered to the global
+ * scrap if needed.
+ */
+
+ TkSuspendClipboard();
+
+ 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;
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
* MacXIdAlloc --
*
* This procedure is invoked by Xlib as the resource allocator