diff options
author | das <das> | 2007-05-09 12:55:15 (GMT) |
---|---|---|
committer | das <das> | 2007-05-09 12:55:15 (GMT) |
commit | c0e4ec8c452c01a8d95608e922f8bd3657c10ccb (patch) | |
tree | 506fdf03b09705deab71a428fb32dc8204a24c92 /macosx/tkMacOSXEmbed.c | |
parent | b7ca14476921fec908be93647b91fe3947b5f824 (diff) | |
download | tk-c0e4ec8c452c01a8d95608e922f8bd3657c10ccb.zip tk-c0e4ec8c452c01a8d95608e922f8bd3657c10ccb.tar.gz tk-c0e4ec8c452c01a8d95608e922f8bd3657c10ccb.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 (fixes fileDialog-0.1, fileDialog-0.2 failures).
* 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/Wish.xcodeproj/project.pbxproj: add 'DebugUnthreaded' &
* macosx/Wish.xcodeproj/default.pbxuser: 'DebugLeaks' targets and env
var settings needed to run the 'leaks' tool.
* macosx/tkMacOSXButton.c: fix debug msg typo.
Diffstat (limited to 'macosx/tkMacOSXEmbed.c')
-rw-r--r-- | macosx/tkMacOSXEmbed.c | 107 |
1 files changed, 39 insertions, 68 deletions
diff --git a/macosx/tkMacOSXEmbed.c b/macosx/tkMacOSXEmbed.c index f8ca9a7..04d0e4d 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.11 2007/04/25 00:02:04 das Exp $ + * RCS: @(#) $Id: tkMacOSXEmbed.c,v 1.12 2007/05/09 12:55:15 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; } |