diff options
author | Kevin Walzer <kw@codebykevin.com> | 2021-05-08 13:22:37 (GMT) |
---|---|---|
committer | Kevin Walzer <kw@codebykevin.com> | 2021-05-08 13:22:37 (GMT) |
commit | 826c870297d0f8e9007aea7947f8fa4e49628f8e (patch) | |
tree | 7fb282df580adfb6cdc7d3be077dc21a84f7870e /macosx | |
parent | 4456905b5ffd46ca9759b0f883883f53a636d034 (diff) | |
parent | 7653fd57944db2a7fd92a7dc515faaf4d83026bc (diff) | |
download | tk-826c870297d0f8e9007aea7947f8fa4e49628f8e.zip tk-826c870297d0f8e9007aea7947f8fa4e49628f8e.tar.gz tk-826c870297d0f8e9007aea7947f8fa4e49628f8e.tar.bz2 |
Merge printing and GDI files into one for tighter coupling of print device context
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/tkMacOSXImage.c | 8 | ||||
-rw-r--r-- | macosx/tkMacOSXInit.c | 21 |
2 files changed, 23 insertions, 6 deletions
diff --git a/macosx/tkMacOSXImage.c b/macosx/tkMacOSXImage.c index 3ea9bd7..c41b3a6 100644 --- a/macosx/tkMacOSXImage.c +++ b/macosx/tkMacOSXImage.c @@ -56,7 +56,7 @@ static void ReleaseData( CGImageRef TkMacOSXCreateCGImageWithXImage( XImage *image, - uint32 alphaInfo) + uint32_t alphaInfo) { CGImageRef img = NULL; size_t bitsPerComponent, bitsPerPixel; @@ -480,8 +480,7 @@ TkMacOSXPutImage( int XPutImage(Display* display, Drawable drawable, GC gc, XImage* image, int src_x, int src_y, int dest_x, int dest_y, - unsigned int width, unsigned int height) -{ + unsigned int width, unsigned int height) { return TkMacOSXPutImage(PIXEL_RGBX, display, drawable, gc, image, src_x, src_y, dest_x, dest_y, width, height); } @@ -489,8 +488,7 @@ int XPutImage(Display* display, Drawable drawable, GC gc, XImage* image, int TkpPutRGBAImage(Display* display, Drawable drawable, GC gc, XImage* image, int src_x, int src_y, int dest_x, int dest_y, - unsigned int width, unsigned int height) -{ + unsigned int width, unsigned int height) { return TkMacOSXPutImage(PIXEL_RGBA, display, drawable, gc, image, src_x, src_y, dest_x, dest_y, width, height); } diff --git a/macosx/tkMacOSXInit.c b/macosx/tkMacOSXInit.c index d4edd56..c2de9ff 100644 --- a/macosx/tkMacOSXInit.c +++ b/macosx/tkMacOSXInit.c @@ -104,18 +104,37 @@ static int TkMacOSXGetAppPathCmd(ClientData cd, Tcl_Interp *ip, #endif [self _setupWindowNotifications]; [self _setupApplicationNotifications]; + +if ([NSApp macOSVersion] >= 110000) { + + /* + * Initialize Apple Event processing. Apple's docs (see + * https://developer.apple.com/documentation/appkit/nsapplication) + * recommend doing this here, although historically we have + * done this in applicationWillFinishLaunching. In response to + * bug 7bb246b072. + */ + + TkMacOSXInitAppleEvents(_eventInterp); + + } } -(void)applicationDidFinishLaunching:(NSNotification *)notification { (void)notification; + if ([NSApp macOSVersion] < 110000) { + /* - * Initialize event processing. + * Initialize Apple Event processing on macOS versions + * older than Big Sur (11). */ TkMacOSXInitAppleEvents(_eventInterp); + } + /* * Initialize the graphics context. */ |