summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXEmbed.c
diff options
context:
space:
mode:
authordas <das>2007-05-09 12:57:44 (GMT)
committerdas <das>2007-05-09 12:57:44 (GMT)
commitf826ac6217b819d53876353acf2eb6688622564e (patch)
tree1ea5714938378ea764c1925d778432b293d1173e /macosx/tkMacOSXEmbed.c
parentc91f8973c04a4f3c48dd907359c7c98042e5d976 (diff)
downloadtk-f826ac6217b819d53876353acf2eb6688622564e.zip
tk-f826ac6217b819d53876353acf2eb6688622564e.tar.gz
tk-f826ac6217b819d53876353acf2eb6688622564e.tar.bz2
* macosx/tkMacOSXWindowEvent.c: ensure window is brought to the front
* macosx/tkMacOSXMouseEvent.c: at the start of a window drag (except * macosx/tkMacOSXInt.h: when cmd key is down); formatting and whitespace fixes. * macosx/tkMacOSXDialog.c (Tk_GetSaveFileObjCmd): add -filetypes option processing. * macosx/tkMacOSXEmbed.c (TkpMakeWindow, TkpUseWindow): fix sending of Visibility event for embedded windows (fixes frame-3.9 hang). * macosx/tkMacOSXScrlbr.c (ScrollbarBindProc): fix testsuite * macosx/tkMacOSXSubwindows.c (TkMacOSXUpdateClipRgn): crashes by adding sanity checks. * macosx/tkMacOSXButton.c: fix debug msg typo.
Diffstat (limited to 'macosx/tkMacOSXEmbed.c')
-rw-r--r--macosx/tkMacOSXEmbed.c107
1 files changed, 39 insertions, 68 deletions
diff --git a/macosx/tkMacOSXEmbed.c b/macosx/tkMacOSXEmbed.c
index 4c6c69c..aaa38bc 100644
--- a/macosx/tkMacOSXEmbed.c
+++ b/macosx/tkMacOSXEmbed.c
@@ -15,7 +15,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkMacOSXEmbed.c,v 1.2.2.5 2007/04/29 02:26:48 das Exp $
+ * RCS: @(#) $Id: tkMacOSXEmbed.c,v 1.2.2.6 2007/05/09 12:57:46 das Exp $
*/
#include "tkMacOSXInt.h"
@@ -135,49 +135,49 @@ TkpMakeWindow(
*/
if (Tk_IsEmbedded(winPtr)) {
- return (Window) winPtr->privatePtr;
- }
-
- /*
- * Allocate sub window
- */
-
- macWin = (MacDrawable *) ckalloc(sizeof(MacDrawable));
- if (macWin == NULL) {
- winPtr->privatePtr = NULL;
- return None;
- }
- macWin->winPtr = winPtr;
- winPtr->privatePtr = macWin;
- macWin->clipRgn = NewRgn();
- macWin->aboveClipRgn = NewRgn();
- macWin->drawRgn = NewRgn();
- macWin->referenceCount = 0;
- macWin->flags = TK_CLIP_INVALID;
-
- macWin->grafPtr = NULL;
- macWin->context = NULL;
- if (Tk_IsTopLevel(macWin->winPtr)) {
+ macWin = winPtr->privatePtr;
+ } else {
/*
- *This will be set when we are mapped.
+ * Allocate sub window
*/
- macWin->xOff = 0;
- macWin->yOff = 0;
- macWin->toplevel = macWin;
- } else {
- macWin->xOff = winPtr->parentPtr->privatePtr->xOff +
- winPtr->parentPtr->changes.border_width +
- winPtr->changes.x;
- macWin->yOff = winPtr->parentPtr->privatePtr->yOff +
- winPtr->parentPtr->changes.border_width +
- winPtr->changes.y;
- macWin->toplevel = winPtr->parentPtr->privatePtr->toplevel;
- }
- macWin->toplevel->referenceCount++;
+ macWin = (MacDrawable *) ckalloc(sizeof(MacDrawable));
+ if (macWin == NULL) {
+ winPtr->privatePtr = NULL;
+ return None;
+ }
+ macWin->winPtr = winPtr;
+ winPtr->privatePtr = macWin;
+ macWin->clipRgn = NewRgn();
+ macWin->aboveClipRgn = NewRgn();
+ macWin->drawRgn = NewRgn();
+ macWin->referenceCount = 0;
+ macWin->flags = TK_CLIP_INVALID;
+
+ macWin->grafPtr = NULL;
+ macWin->context = NULL;
+ if (Tk_IsTopLevel(macWin->winPtr)) {
+ /*
+ *This will be set when we are mapped.
+ */
+ macWin->xOff = 0;
+ macWin->yOff = 0;
+ macWin->toplevel = macWin;
+ } else {
+ macWin->xOff = winPtr->parentPtr->privatePtr->xOff +
+ winPtr->parentPtr->changes.border_width +
+ winPtr->changes.x;
+ macWin->yOff = winPtr->parentPtr->privatePtr->yOff +
+ winPtr->parentPtr->changes.border_width +
+ winPtr->changes.y;
+ macWin->toplevel = winPtr->parentPtr->privatePtr->toplevel;
+ }
+ macWin->toplevel->referenceCount++;
+ }
/*
* TODO: need general solution for visibility events.
*/
+
event.xany.serial = Tk_Display(winPtr)->request;
event.xany.send_event = False;
event.xany.display = Tk_Display(winPtr);
@@ -225,7 +225,6 @@ TkpUseWindow(
TkWindow *usePtr;
MacDrawable *parent, *macWin;
Container *containerPtr;
- XEvent event;
if (winPtr->window != None) {
Tcl_AppendResult(interp, "can't modify container after widget is "
@@ -235,7 +234,7 @@ TkpUseWindow(
/*
* Decode the container pointer, and look for it among the
- *list of available containers.
+ * list of available containers.
*
* N.B. For now, we are limiting the containers to be in the same Tk
* application as tkwin, since otherwise they would not be in our list
@@ -380,34 +379,6 @@ TkpUseWindow(
}
- /*
- * TODO: need general solution for visibility events.
- */
-
-
- event.xany.serial = Tk_Display(winPtr)->request;
- event.xany.send_event = False;
- event.xany.display = Tk_Display(winPtr);
-
- event.xvisibility.type = VisibilityNotify;
- event.xvisibility.window = (Window) macWin;;
- event.xvisibility.state = VisibilityUnobscured;
- Tk_QueueWindowEvent(&event, TCL_QUEUE_TAIL);
-
-
- /*
- * TODO: need general solution for visibility events.
- */
-
- event.xany.serial = Tk_Display(winPtr)->request;
- event.xany.send_event = False;
- event.xany.display = Tk_Display(winPtr);
-
- event.xvisibility.type = VisibilityNotify;
- event.xvisibility.window = (Window) macWin;;
- event.xvisibility.state = VisibilityUnobscured;
- Tk_QueueWindowEvent(&event, TCL_QUEUE_TAIL);
-
return TCL_OK;
}