summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXXStubs.c
diff options
context:
space:
mode:
Diffstat (limited to 'macosx/tkMacOSXXStubs.c')
-rw-r--r--macosx/tkMacOSXXStubs.c52
1 files changed, 44 insertions, 8 deletions
diff --git a/macosx/tkMacOSXXStubs.c b/macosx/tkMacOSXXStubs.c
index 3260d08..4d83c7b 100644
--- a/macosx/tkMacOSXXStubs.c
+++ b/macosx/tkMacOSXXStubs.c
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkMacOSXXStubs.c,v 1.2.2.2 2004/02/23 10:49:29 das Exp $
+ * RCS: @(#) $Id: tkMacOSXXStubs.c,v 1.2.2.3 2004/05/03 22:23:09 hobbs Exp $
*/
#include "tkInt.h"
@@ -181,13 +181,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) {
@@ -201,6 +194,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