summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXWindowEvent.c
diff options
context:
space:
mode:
Diffstat (limited to 'macosx/tkMacOSXWindowEvent.c')
-rw-r--r--macosx/tkMacOSXWindowEvent.c45
1 files changed, 19 insertions, 26 deletions
diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c
index 91cc348..95ebb25 100644
--- a/macosx/tkMacOSXWindowEvent.c
+++ b/macosx/tkMacOSXWindowEvent.c
@@ -17,7 +17,7 @@
#include "tkMacOSXWm.h"
#include "tkMacOSXEvent.h"
#include "tkMacOSXDebug.h"
-
+
/*
#ifdef TK_MAC_DEBUG
#define TK_MAC_DEBUG_EVENTS
@@ -268,13 +268,12 @@ extern BOOL opaqueTag;
const char *cmd = ([[notification name] isEqualToString:
NSApplicationDidUnhideNotification] ?
"::tk::mac::OnShow" : "::tk::mac::OnHide");
- Tcl_CmdInfo dummy;
- if (_eventInterp && Tcl_GetCommandInfo(_eventInterp, cmd, &dummy)) {
+ if (_eventInterp && Tcl_FindCommand(_eventInterp, cmd, NULL, 0)) {
int code = Tcl_EvalEx(_eventInterp, cmd, -1, TCL_EVAL_GLOBAL);
if (code != TCL_OK) {
- Tcl_BackgroundError(_eventInterp);
+ Tcl_BackgroundException(_eventInterp, code);
}
Tcl_ResetResult(_eventInterp);
}
@@ -391,7 +390,7 @@ GenerateUpdates(
/*
* TODO: Here we should handle out of process embedding.
*/
- }
+ }
return 1;
}
@@ -706,11 +705,10 @@ TkWmProtocolEventProc(
Tcl_Preserve(interp);
result = Tcl_EvalEx(interp, protPtr->command, -1, TCL_EVAL_GLOBAL);
if (result != TCL_OK) {
- Tcl_AddErrorInfo(interp, "\n (command for \"");
- Tcl_AddErrorInfo(interp,
- Tk_GetAtomName((Tk_Window) winPtr, protocol));
- Tcl_AddErrorInfo(interp, "\" window manager protocol)");
- Tcl_BackgroundError(interp);
+ Tcl_AppendObjToErrorInfo(interp, Tcl_ObjPrintf(
+ "\n (command for \"%s\" window manager protocol)",
+ Tk_GetAtomName((Tk_Window) winPtr, protocol)));
+ Tcl_BackgroundException(interp, result);
}
Tcl_Release(interp);
Tcl_Release(protPtr);
@@ -766,7 +764,7 @@ Tk_MacOSXIsAppInFront(void)
/*
* Custom content view for use in Tk NSWindows.
- *
+ *
* Since Tk handles all drawing of widgets, we only use the AppKit event loop
* as a source of input events. To do this, we overload the NSView drawRect
* method with a method which generates Expose events for Tk but does no
@@ -808,7 +806,7 @@ ConfigureRestrictProc(
{
const NSRect *rectsBeingDrawn;
NSInteger rectsBeingDrawnCount;
-
+
[self getRectsBeingDrawn:&rectsBeingDrawn count:&rectsBeingDrawnCount];
#ifdef TK_MAC_DEBUG_DRAWING
@@ -818,7 +816,6 @@ ConfigureRestrictProc(
NSCompositeSourceOver);
#endif
-
CGFloat height = [self bounds].size.height;
HIMutableShapeRef drawShape = HIShapeCreateMutable();
@@ -837,9 +834,8 @@ ConfigureRestrictProc(
NSEventTrackingRunLoopMode, NSModalPanelRunLoopMode,
nil]];
}
-
+
CFRelease(drawShape);
-
}
-(void) setFrameSize: (NSSize)newsize
@@ -859,16 +855,16 @@ ConfigureRestrictProc(
* don't clobber the AutoreleasePool set up by the caller.
*/
[NSApp setPoolProtected:YES];
-
+
/*
* Try to prevent flickers and flashes.
*
- * This stops the flickers, but on OSX 10.11 flashes still occur when
+ * This stops the flickers on OSX 10.11. But flashes still occur when
* the width of the window is 16, 32, 48, 64, 80, 96, 112, 256, 512,
- * 768, ...
+ * 768, ... :^(
*/
[w disableFlushWindow];
-
+
/* Disable Tk drawing until the window has been completely configured.*/
TkMacOSXSetDrawingEnabled(winPtr, 0);
@@ -907,15 +903,12 @@ ConfigureRestrictProc(
HIShapeRef shape = HIShapeCreateWithRect(&bounds);
[super viewDidEndLiveResize];
[self generateExposeEvents: shape];
-
}
-/* Core method of this class: generates expose events for redrawing.
- * Whereas drawRect is intended to be called only from the Appkit event
- * loop, this can be called from Tk. If the Tcl_ServiceMode is set to
- * TCL_SERVICE_ALL then the expose events will be immediately removed
- * from the Tcl event loop and processed. Typically, they should be queued,
- * however.
+/* Core method of this class: generates expose events for redrawing. If the
+ * Tcl_ServiceMode is set to TCL_SERVICE_ALL then the expose events will be
+ * immediately removed from the Tcl event loop and processed. Typically, they
+ * should be queued, however.
*/
- (void) generateExposeEvents: (HIShapeRef) shape
{