diff options
author | culler <culler> | 2021-05-06 14:05:23 (GMT) |
---|---|---|
committer | culler <culler> | 2021-05-06 14:05:23 (GMT) |
commit | 557835b8a7fa7213cf50db5c8a56a40a039fe08f (patch) | |
tree | c70d944852d9a0fffc0453a1b8e75b4864b4ba5a /macosx | |
parent | 4cadebd56f7bcc6f9ff195dbe9b4ba3e7c51465c (diff) | |
parent | e90c3f6d3a2bec9a074ebbbac695bda5557c6df5 (diff) | |
download | tk-557835b8a7fa7213cf50db5c8a56a40a039fe08f.zip tk-557835b8a7fa7213cf50db5c8a56a40a039fe08f.tar.gz tk-557835b8a7fa7213cf50db5c8a56a40a039fe08f.tar.bz2 |
Merge 8.6
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/tkMacOSXImage.c | 30 | ||||
-rw-r--r-- | macosx/tkMacOSXKeyEvent.c | 13 | ||||
-rw-r--r-- | macosx/tkMacOSXPort.h | 2 | ||||
-rw-r--r-- | macosx/tkMacOSXWindowEvent.c | 2 | ||||
-rw-r--r-- | macosx/tkMacOSXWm.c | 3 |
5 files changed, 30 insertions, 20 deletions
diff --git a/macosx/tkMacOSXImage.c b/macosx/tkMacOSXImage.c index 1966414..c9acdab 100644 --- a/macosx/tkMacOSXImage.c +++ b/macosx/tkMacOSXImage.c @@ -4,7 +4,7 @@ * The code in this file provides an interface for XImages, * * Copyright (c) 1995-1997 Sun Microsystems, Inc. - * Copyright 2001-2009, Apple Inc. + * Copyright (c) 2001-2009, Apple Inc. * Copyright (c) 2005-2009 Daniel A. Steffen <das@users.sourceforge.net> * Copyright (c) 2017-2021 Marc Culler. * @@ -88,7 +88,7 @@ typedef union pixel32_t { int _XInitImageFuncPtrs( - XImage *image) + TCL_UNUSED(XImage *)) /* image */ { return 0; } @@ -110,14 +110,18 @@ _XInitImageFuncPtrs( *---------------------------------------------------------------------- */ -static void ReleaseData(void *info, const void *data, size_t size) { +static void ReleaseData( + void *info, + TCL_UNUSED(const void *), /* data */ + TCL_UNUSED(size_t)) /* size */ +{ ckfree(info); } CGImageRef TkMacOSXCreateCGImageWithXImage( XImage *image, - uint32 alphaInfo) + uint32_t alphaInfo) { CGImageRef img = NULL; size_t bitsPerComponent, bitsPerPixel; @@ -142,7 +146,7 @@ TkMacOSXCreateCGImageWithXImage( if (image->bitmap_bit_order != MSBFirst) { char *srcPtr = image->data + image->xoffset; char *endPtr = srcPtr + len; - char *destPtr = (data = ckalloc(len)); + char *destPtr = (data = (char *)ckalloc(len)); while (srcPtr < endPtr) { *destPtr++ = xBitReverseTable[(unsigned char)(*(srcPtr++))]; @@ -379,7 +383,7 @@ ImagePutPixel( XImage * XCreateImage( Display* display, - Visual* visual, + TCL_UNUSED(Visual*), /* visual */ unsigned int depth, int format, int offset, @@ -561,8 +565,6 @@ int TkPutImage( } int TkpPutRGBAImage( - TCL_UNUSED(unsigned long *), - TCL_UNUSED(int), Display* display, Drawable drawable, GC gc, @@ -574,7 +576,7 @@ int TkpPutRGBAImage( unsigned int width, unsigned int height) { return TkMacOSXPutImage(USE_ALPHA, display, drawable, gc, image, - src_x, src_y, dest_x, dest_y, width, height); + src_x, src_y, dest_x, dest_y, width, height); } @@ -651,13 +653,13 @@ CreateCGImageFromDrawableRect( return NULL; } NSSize size = view.frame.size; - NSUInteger width = size.width, height = size.height; + NSUInteger view_width = size.width, view_height = size.height; NSUInteger bytesPerPixel = 4, - bytesPerRow = bytesPerPixel * width, + bytesPerRow = bytesPerPixel * view_width, bitsPerComponent = 8; - imageData = ckalloc(height * bytesPerRow); + imageData = ckalloc(view_height * bytesPerRow); CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); - cg_context = CGBitmapContextCreate(imageData, width, height, + cg_context = CGBitmapContextCreate(imageData, view_width, view_height, bitsPerComponent, bytesPerRow, colorSpace, kCGImageAlphaPremultipliedLast | kCGBitmapByteOrder32Big); @@ -736,7 +738,7 @@ XGetImage( int y, unsigned int width, unsigned int height, - unsigned long plane_mask, + TCL_UNUSED(unsigned long), /* plane_mask */ int format) { NSBitmapImageRep* bitmapRep = nil; diff --git a/macosx/tkMacOSXKeyEvent.c b/macosx/tkMacOSXKeyEvent.c index a46a646..2452c1d 100644 --- a/macosx/tkMacOSXKeyEvent.c +++ b/macosx/tkMacOSXKeyEvent.c @@ -72,6 +72,18 @@ static NSUInteger textInputModifiers; } /* + * Discard repeating KeyDown events if the repeat speed has been set to + * "off" in System Preferences. It is unclear why we get these, but we do. + * See ticket [2ecb09d118]. + */ + + if ([theEvent type] == NSKeyDown && + [theEvent isARepeat] && + [NSEvent keyRepeatDelay] < 0) { + return theEvent; + } + + /* * If a local grab is in effect, key events for windows in the * grabber's application are redirected to the grabber. Key events * for other applications are delivered normally. If a global @@ -262,7 +274,6 @@ static NSUInteger textInputModifiers; */ if (type == NSKeyDown && [theEvent isARepeat]) { - xEvent.xany.type = KeyRelease; Tk_QueueWindowEvent(&xEvent, TCL_QUEUE_TAIL); xEvent.xany.type = KeyPress; diff --git a/macosx/tkMacOSXPort.h b/macosx/tkMacOSXPort.h index abf02d0..9393df3 100644 --- a/macosx/tkMacOSXPort.h +++ b/macosx/tkMacOSXPort.h @@ -169,7 +169,7 @@ #define TK_CAN_RENDER_RGBA -MODULE_SCOPE int TkpPutRGBAImage(unsigned long *colors, int ncolors, +MODULE_SCOPE 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); diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c index c4b8c07..688f5a1 100644 --- a/macosx/tkMacOSXWindowEvent.c +++ b/macosx/tkMacOSXWindowEvent.c @@ -957,7 +957,7 @@ ConfigureRestrictProc( * the view is on a Retina display, as well as incorrect size when * the view is on a normal display. */ - + self.layer.contentsScale = self.window.screen.backingScaleFactor; } diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index 15cc264..4b08fc5 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -6459,9 +6459,6 @@ TkpWmSetState( if (state != WithdrawnState) { while (Tcl_DoOneEvent(TCL_IDLE_EVENTS)) {}; } - - while (Tcl_DoOneEvent(TCL_IDLE_EVENTS)) {}; - if (state == WithdrawnState) { Tk_UnmapWindow((Tk_Window)winPtr); } else if (state == IconicState) { |