summaryrefslogtreecommitdiffstats
path: root/macosx
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-12-11 14:11:14 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-12-11 14:11:14 (GMT)
commit76eb475a1c171000446b21fb488202f2b1a124db (patch)
tree8b054d2dc9f1ba3071bd8194ece265b0445d0f8b /macosx
parent8fb4a031ef0229ae94bd43a06ac1779baab3049e (diff)
parent46f4476afd4803621152594669922f4d8b8afc3d (diff)
downloadtk-76eb475a1c171000446b21fb488202f2b1a124db.zip
tk-76eb475a1c171000446b21fb488202f2b1a124db.tar.gz
tk-76eb475a1c171000446b21fb488202f2b1a124db.tar.bz2
Merge 8.7
Diffstat (limited to 'macosx')
-rw-r--r--macosx/GNUmakefile2
-rw-r--r--macosx/tkMacOSXBitmap.c6
-rw-r--r--macosx/tkMacOSXButton.c12
-rw-r--r--macosx/tkMacOSXClipboard.c6
-rw-r--r--macosx/tkMacOSXColor.c24
-rw-r--r--macosx/tkMacOSXColor.h2
-rw-r--r--macosx/tkMacOSXConfig.c4
-rw-r--r--macosx/tkMacOSXConstants.h2
-rw-r--r--macosx/tkMacOSXCursor.c6
-rw-r--r--macosx/tkMacOSXCursors.h6
-rw-r--r--macosx/tkMacOSXDebug.c4
-rw-r--r--macosx/tkMacOSXDebug.h4
-rw-r--r--macosx/tkMacOSXDefault.h23
-rw-r--r--macosx/tkMacOSXDialog.c8
-rw-r--r--macosx/tkMacOSXDraw.c8
-rw-r--r--macosx/tkMacOSXEmbed.c6
-rw-r--r--macosx/tkMacOSXEntry.c6
-rw-r--r--macosx/tkMacOSXEvent.c6
-rw-r--r--macosx/tkMacOSXFont.c6
-rw-r--r--macosx/tkMacOSXFont.h8
-rw-r--r--macosx/tkMacOSXHLEvents.c10
-rw-r--r--macosx/tkMacOSXImage.c8
-rw-r--r--macosx/tkMacOSXInit.c44
-rw-r--r--macosx/tkMacOSXKeyEvent.c8
-rw-r--r--macosx/tkMacOSXKeyboard.c8
-rw-r--r--macosx/tkMacOSXKeysyms.h10
-rw-r--r--macosx/tkMacOSXMenu.c114
-rw-r--r--macosx/tkMacOSXMenubutton.c10
-rw-r--r--macosx/tkMacOSXMenus.c6
-rw-r--r--macosx/tkMacOSXMouseEvent.c4
-rw-r--r--macosx/tkMacOSXNotify.c8
-rw-r--r--macosx/tkMacOSXPrivate.h6
-rw-r--r--macosx/tkMacOSXRegion.c6
-rw-r--r--macosx/tkMacOSXScale.c8
-rw-r--r--macosx/tkMacOSXScrlbr.c10
-rw-r--r--macosx/tkMacOSXSend.c8
-rw-r--r--macosx/tkMacOSXServices.c6
-rw-r--r--macosx/tkMacOSXSubwindows.c6
-rw-r--r--macosx/tkMacOSXSysTray.c6
-rw-r--r--macosx/tkMacOSXTest.c6
-rw-r--r--macosx/tkMacOSXWindowEvent.c8
-rw-r--r--macosx/tkMacOSXWm.c28
-rw-r--r--macosx/tkMacOSXWm.h4
-rw-r--r--macosx/tkMacOSXXCursors.h6
-rw-r--r--macosx/tkMacOSXXStubs.c8
-rw-r--r--macosx/ttkMacOSXTheme.c46
46 files changed, 279 insertions, 262 deletions
diff --git a/macosx/GNUmakefile b/macosx/GNUmakefile
index 2451e5c..cf76ac0 100644
--- a/macosx/GNUmakefile
+++ b/macosx/GNUmakefile
@@ -100,7 +100,7 @@ space := ${empty} ${empty}
objdir = $(subst ${space},\ ,${OBJ_DIR})
develop_make_args := BUILD_STYLE=Development CONFIGURE_ARGS=--enable-symbols
-deploy_make_args := BUILD_STYLE=Deployment INSTALL_TARGET=install-strip
+deploy_make_args := BUILD_STYLE=Deployment INSTALL_TARGET=install
embedded_make_args := EMBEDDED_BUILD=1
install_make_args := INSTALL_BUILD=1
diff --git a/macosx/tkMacOSXBitmap.c b/macosx/tkMacOSXBitmap.c
index 29bb163..2e7230e 100644
--- a/macosx/tkMacOSXBitmap.c
+++ b/macosx/tkMacOSXBitmap.c
@@ -3,9 +3,9 @@
*
* This file handles the implementation of native bitmaps.
*
- * Copyright (c) 1996-1997 Sun Microsystems, Inc.
- * Copyright 2001-2009, Apple Inc.
- * Copyright (c) 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright © 1996-1997 Sun Microsystems, Inc.
+ * Copyright © 2001-2009 Apple Inc.
+ * Copyright © 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
diff --git a/macosx/tkMacOSXButton.c b/macosx/tkMacOSXButton.c
index 857ce34..f96acc7 100644
--- a/macosx/tkMacOSXButton.c
+++ b/macosx/tkMacOSXButton.c
@@ -4,12 +4,12 @@
* This file implements the Macintosh specific portion of the button
* widgets.
*
- * Copyright (c) 1996-1997 by Sun Microsystems, Inc.
- * Copyright 2001, Apple Computer, Inc.
- * Copyright (c) 2006-2007 Daniel A. Steffen <das@users.sourceforge.net>
- * Copyright 2007 Revar Desmera.
- * Copyright 2015 Kevin Walzer/WordTech Communications LLC.
- * Copyright 2015 Marc Culler.
+ * Copyright © 1996-1997 Sun Microsystems, Inc.
+ * Copyright © 2001 Apple Computer, Inc.
+ * Copyright © 2006-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright © 2007 Revar Desmera.
+ * Copyright © 2015 Kevin Walzer/WordTech Communications LLC.
+ * Copyright © 2015 Marc Culler.
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
diff --git a/macosx/tkMacOSXClipboard.c b/macosx/tkMacOSXClipboard.c
index 47203e2..8e2b4a4 100644
--- a/macosx/tkMacOSXClipboard.c
+++ b/macosx/tkMacOSXClipboard.c
@@ -3,9 +3,9 @@
*
* This file manages the clipboard for the Tk toolkit.
*
- * Copyright (c) 1995-1997 Sun Microsystems, Inc.
- * Copyright 2001-2009, Apple Inc.
- * Copyright (c) 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright © 1995-1997 Sun Microsystems, Inc.
+ * Copyright © 2001-2009 Apple Inc.
+ * Copyright © 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
diff --git a/macosx/tkMacOSXColor.c b/macosx/tkMacOSXColor.c
index f11e660..3c155f6 100644
--- a/macosx/tkMacOSXColor.c
+++ b/macosx/tkMacOSXColor.c
@@ -5,11 +5,11 @@
* toolkit, in order to avoid round-trips to the server to
* map color names to pixel values.
*
- * Copyright (c) 1990-1994 The Regents of the University of California.
- * Copyright (c) 1994-1996 Sun Microsystems, Inc.
- * Copyright 2001-2009, Apple Inc.
- * Copyright (c) 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
- * Copyright (c) 2020 Marc Culler
+ * Copyright © 1990-1994 The Regents of the University of California.
+ * Copyright © 1994-1996 Sun Microsystems, Inc.
+ * Copyright © 2001-2009 Apple Inc.
+ * Copyright © 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright © 2020 Marc Culler
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -177,7 +177,7 @@ TkMacOSXRGBPixel(
unsigned long green,
unsigned long blue)
{
- MacPixel p;
+ MacPixel p = {0};
p.pixel.colortype = rgbColor;
p.pixel.value = ((red & 0xff) << 16) |
((green & 0xff) << 8) |
@@ -207,7 +207,7 @@ MODULE_SCOPE
unsigned long TkMacOSXClearPixel(
void)
{
- MacPixel p;
+ MacPixel p = {0};
p.pixel.value = 0;
p.pixel.colortype = clearColor;
return p.ulong;
@@ -236,7 +236,7 @@ SystemColorDatum*
GetEntryFromPixel(
unsigned long pixel)
{
- MacPixel p;
+ MacPixel p = {0};
int index = rgbColorIndex;
p.ulong = pixel;
@@ -314,6 +314,10 @@ GetRGBA(
}
}
break;
+ case clearColor:
+ rgba[0] = rgba[1] = rgba[2] = 1.0;
+ rgba[3] = 0;
+ break;
case semantic:
if (entry->index == controlAccentIndex && useFakeAccentColor) {
#if MAC_OS_X_VERSION_MIN_REQUIRED < 101400
@@ -332,8 +336,6 @@ GetRGBA(
}
[color getComponents: rgba];
break;
- case clearColor:
- rgba[3] = 0;
default:
break;
}
@@ -598,7 +600,7 @@ TkpGetColor(
if (strncasecmp(name, "system", 6) == 0) {
Tcl_HashEntry *hPtr = Tcl_FindHashEntry(&systemColors, name + 6);
- MacPixel p;
+ MacPixel p = {0};
if (hPtr != NULL) {
SystemColorDatum *entry = (SystemColorDatum *)Tcl_GetHashValue(hPtr);
diff --git a/macosx/tkMacOSXColor.h b/macosx/tkMacOSXColor.h
index a030589..1b4bab6 100644
--- a/macosx/tkMacOSXColor.h
+++ b/macosx/tkMacOSXColor.h
@@ -87,7 +87,7 @@ typedef struct {
static SystemColorDatum systemColorData[] = {
{"Pixel", rgbColor, 0, NULL, 0, NULL },
-{"Transparent", clearColor, 0, NULL, 0, NULL },
+{"Transparent", clearColor, 0, NULL, 0, NULL },
{"Highlight", HIBrush, kThemeBrushPrimaryHighlightColor, NULL, 0, NULL },
{"HighlightSecondary", HIBrush, kThemeBrushSecondaryHighlightColor, NULL, 0, NULL },
diff --git a/macosx/tkMacOSXConfig.c b/macosx/tkMacOSXConfig.c
index 34a1fc9..1588d21 100644
--- a/macosx/tkMacOSXConfig.c
+++ b/macosx/tkMacOSXConfig.c
@@ -4,8 +4,8 @@
* This module implements the Macintosh system defaults for
* the configuration package.
*
- * Copyright (c) 1997 by Sun Microsystems, Inc.
- * Copyright 2001, Apple Inc.
+ * Copyright © 1997 Sun Microsystems, Inc.
+ * Copyright © 2001, Apple Inc.
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
diff --git a/macosx/tkMacOSXConstants.h b/macosx/tkMacOSXConstants.h
index 0b6ae2b..8ab6a80 100644
--- a/macosx/tkMacOSXConstants.h
+++ b/macosx/tkMacOSXConstants.h
@@ -6,7 +6,7 @@
* operating system. (Each new OS release seems to come with a new
* naming convention for the same old constants.)
*
- * Copyright (c) 2017 Marc Culler
+ * Copyright © 2017 Marc Culler
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
diff --git a/macosx/tkMacOSXCursor.c b/macosx/tkMacOSXCursor.c
index 9371889..4e899f2 100644
--- a/macosx/tkMacOSXCursor.c
+++ b/macosx/tkMacOSXCursor.c
@@ -3,9 +3,9 @@
*
* This file contains Macintosh specific cursor related routines.
*
- * Copyright (c) 1995-1997 Sun Microsystems, Inc.
- * Copyright 2001-2009, Apple Inc.
- * Copyright (c) 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright © 1995-1997 Sun Microsystems, Inc.
+ * Copyright © 2001-2009 Apple Inc.
+ * Copyright © 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
diff --git a/macosx/tkMacOSXCursors.h b/macosx/tkMacOSXCursors.h
index 2cf00fb..9434cc3 100644
--- a/macosx/tkMacOSXCursors.h
+++ b/macosx/tkMacOSXCursors.h
@@ -4,9 +4,9 @@
* This file defines a set of Macintosh cursor resources that
* are only available on the Macintosh platform.
*
- * Copyright (c) 1995-1996 Sun Microsystems, Inc.
- * Copyright 2008-2009, Apple Inc.
- * Copyright (c) 2008-2009 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright © 1995-1996 Sun Microsystems, Inc.
+ * Copyright © 2008-2009 Apple Inc.
+ * Copyright © 2008-2009 Daniel A. Steffen <das@users.sourceforge.net>
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
diff --git a/macosx/tkMacOSXDebug.c b/macosx/tkMacOSXDebug.c
index fc01ef4..b2022b9 100644
--- a/macosx/tkMacOSXDebug.c
+++ b/macosx/tkMacOSXDebug.c
@@ -4,8 +4,8 @@
* Implementation of Macintosh specific functions for debugging MacOS
* events, regions, etc...
*
- * Copyright 2001-2009, Apple Inc.
- * Copyright (c) 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright © 2001-2009, Apple Inc.
+ * Copyright © 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
diff --git a/macosx/tkMacOSXDebug.h b/macosx/tkMacOSXDebug.h
index ab37187..18cf9b4 100644
--- a/macosx/tkMacOSXDebug.h
+++ b/macosx/tkMacOSXDebug.h
@@ -4,8 +4,8 @@
* Declarations of Macintosh specific functions for debugging MacOS events,
* regions, etc...
*
- * Copyright 2001-2009, Apple Inc.
- * Copyright (c) 2005-2009 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright © 2001-2009, Apple Inc.
+ * Copyright © 2005-2009 Daniel A. Steffen <das@users.sourceforge.net>
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
diff --git a/macosx/tkMacOSXDefault.h b/macosx/tkMacOSXDefault.h
index 0dc9db9..1df20f7 100644
--- a/macosx/tkMacOSXDefault.h
+++ b/macosx/tkMacOSXDefault.h
@@ -46,6 +46,7 @@
#define TROUGH "#c3c3c3"
#define INDICATOR "#b03060"
#define DISABLED "systemDisabledControlTextColor"
+#define IGNORED "#abcdef"
/*
* Defaults for labels, buttons, checkbuttons, and radiobuttons:
@@ -301,24 +302,24 @@
* Defaults for menus overall:
*/
-#define DEF_MENU_ACTIVE_BG_COLOR NORMAL_BG /*ignored*/
-#define DEF_MENU_ACTIVE_BG_MONO NORMAL_BG /*ignored*/
+#define DEF_MENU_ACTIVE_BG_COLOR IGNORED
+#define DEF_MENU_ACTIVE_BG_MONO IGNORED
#define DEF_MENU_ACTIVE_BORDER_WIDTH "0"
-#define DEF_MENU_ACTIVE_FG_COLOR NORMAL_FG
-#define DEF_MENU_ACTIVE_FG_MONO NORMAL_FG
+#define DEF_MENU_ACTIVE_FG_COLOR IGNORED
+#define DEF_MENU_ACTIVE_FG_MONO IGNORED
#define DEF_MENU_ACTIVE_RELIEF "flat"
-#define DEF_MENU_BG_COLOR NORMAL_BG /*ignored*/
-#define DEF_MENU_BG_MONO NORMAL_BG /*ignored*/
+#define DEF_MENU_BG_COLOR "#000001" /* Detects custom bg. */
+#define DEF_MENU_BG_MONO IGNORED
#define DEF_MENU_BORDER_WIDTH "0"
#define DEF_MENU_CURSOR "arrow"
-#define DEF_MENU_DISABLED_FG_COLOR DISABLED
-#define DEF_MENU_DISABLED_FG_MONO DISABLED
+#define DEF_MENU_DISABLED_FG_COLOR IGNORED
+#define DEF_MENU_DISABLED_FG_MONO ""
#define DEF_MENU_FONT "menu" /* special: see tkMacOSXMenu.c */
-#define DEF_MENU_FG NORMAL_FG
+#define DEF_MENU_FG "#010000" /* Detects custom fg. */
#define DEF_MENU_POST_COMMAND ""
#define DEF_MENU_RELIEF "flat"
-#define DEF_MENU_SELECT_COLOR "systemSelectedMenuItemTextColor"
-#define DEF_MENU_SELECT_MONO "systemSelectedMenuItemTextColor"
+#define DEF_MENU_SELECT_COLOR IGNORED
+#define DEF_MENU_SELECT_MONO IGNORED
#define DEF_MENU_TAKE_FOCUS "0"
#define DEF_MENU_TEAROFF "0"
#define DEF_MENU_TEAROFF_CMD NULL
diff --git a/macosx/tkMacOSXDialog.c b/macosx/tkMacOSXDialog.c
index 91383d2..757bcea 100644
--- a/macosx/tkMacOSXDialog.c
+++ b/macosx/tkMacOSXDialog.c
@@ -3,10 +3,10 @@
*
* Contains the Mac implementation of the common dialog boxes.
*
- * Copyright (c) 1996-1997 Sun Microsystems, Inc.
- * Copyright 2001-2009, Apple Inc.
- * Copyright (c) 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
- * Copyright (c) 2017 Christian Gollwitzer.
+ * Copyright © 1996-1997 Sun Microsystems, Inc.
+ * Copyright © 2001-2009 Apple Inc.
+ * Copyright © 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright © 2017 Christian Gollwitzer.
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c
index a7314f1..7685837 100644
--- a/macosx/tkMacOSXDraw.c
+++ b/macosx/tkMacOSXDraw.c
@@ -4,10 +4,10 @@
* This file contains functions that draw to windows. Many of thees
* functions emulate Xlib functions.
*
- * Copyright (c) 1995-1997 Sun Microsystems, Inc.
- * Copyright (c) 2001-2009 Apple Inc.
- * Copyright (c) 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
- * Copyright (c) 2014-2020 Marc Culler.
+ * Copyright © 1995-1997 Sun Microsystems, Inc.
+ * Copyright © 2001-2009 Apple Inc.
+ * Copyright © 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright © 2014-2020 Marc Culler.
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
diff --git a/macosx/tkMacOSXEmbed.c b/macosx/tkMacOSXEmbed.c
index f275815..98a40e6 100644
--- a/macosx/tkMacOSXEmbed.c
+++ b/macosx/tkMacOSXEmbed.c
@@ -7,9 +7,9 @@
* other application). Currently only Toplevel embedding within the same
* Tk application is allowed on the Macintosh.
*
- * Copyright (c) 1996-1997 Sun Microsystems, Inc.
- * Copyright 2001-2009, Apple Inc.
- * Copyright (c) 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright © 1996-1997 Sun Microsystems, Inc.
+ * Copyright © 2001-2009 Apple Inc.
+ * Copyright © 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
diff --git a/macosx/tkMacOSXEntry.c b/macosx/tkMacOSXEntry.c
index 75cd198..66c4bce 100644
--- a/macosx/tkMacOSXEntry.c
+++ b/macosx/tkMacOSXEntry.c
@@ -3,9 +3,9 @@
*
* This file implements the native aqua entry widget.
*
- * Copyright 2001, Apple Computer, Inc.
- * Copyright (c) 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
- * Copyright 2008-2009, Apple Inc.
+ * Copyright © 2001 Apple Computer, Inc.
+ * Copyright © 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright © 2008-2009 Apple Inc.
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
diff --git a/macosx/tkMacOSXEvent.c b/macosx/tkMacOSXEvent.c
index 66ca964..6ed7dbf 100644
--- a/macosx/tkMacOSXEvent.c
+++ b/macosx/tkMacOSXEvent.c
@@ -3,9 +3,9 @@
*
* This file contains the basic Mac OS X Event handling routines.
*
- * Copyright (c) 1995-1997 Sun Microsystems, Inc.
- * Copyright 2001-2009, Apple Inc.
- * Copyright (c) 2005-2009 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright © 1995-1997 Sun Microsystems, Inc.
+ * Copyright © 2001-2009, Apple Inc.
+ * Copyright © 2005-2009 Daniel A. Steffen <das@users.sourceforge.net>
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
diff --git a/macosx/tkMacOSXFont.c b/macosx/tkMacOSXFont.c
index c062b16..50ef287 100644
--- a/macosx/tkMacOSXFont.c
+++ b/macosx/tkMacOSXFont.c
@@ -4,9 +4,9 @@
* Contains the Macintosh implementation of the platform-independent font
* package interface.
*
- * Copyright 2002-2004 Benjamin Riefenstahl, Benjamin.Riefenstahl@epost.de
- * Copyright (c) 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
- * Copyright 2008-2009, Apple Inc.
+ * Copyright © 2002-2004 Benjamin Riefenstahl, Benjamin.Riefenstahl@epost.de
+ * Copyright © 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright © 2008-2009 Apple Inc.
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
diff --git a/macosx/tkMacOSXFont.h b/macosx/tkMacOSXFont.h
index 7fc9265..5babfa8 100644
--- a/macosx/tkMacOSXFont.h
+++ b/macosx/tkMacOSXFont.h
@@ -4,10 +4,10 @@
* Contains the Macintosh implementation of the platform-independent
* font package interface.
*
- * Copyright (c) 1990-1994 The Regents of the University of California.
- * Copyright (c) 1994-1997 Sun Microsystems, Inc.
- * Copyright 2001-2009, Apple Inc.
- * Copyright (c) 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright © 1990-1994 The Regents of the University of California.
+ * Copyright © 1994-1997 Sun Microsystems, Inc.
+ * Copyright © 2001-2009, Apple Inc.
+ * Copyright © 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
diff --git a/macosx/tkMacOSXHLEvents.c b/macosx/tkMacOSXHLEvents.c
index 6d53634..7cd8344 100644
--- a/macosx/tkMacOSXHLEvents.c
+++ b/macosx/tkMacOSXHLEvents.c
@@ -3,11 +3,11 @@
*
* Implements high level event support for the Macintosh.
*
- * Copyright (c) 1995-1997 Sun Microsystems, Inc.
- * Copyright (c) 2001-2009, Apple Inc.
- * Copyright (c) 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
- * Copyright (c) 2015-2019 Marc Culler
- * Copyright (c) 2019 Kevin Walzer/WordTech Communications LLC.
+ * Copyright © 1995-1997 Sun Microsystems, Inc.
+ * Copyright © 2001-2009 Apple Inc.
+ * Copyright © 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright © 2015-2019 Marc Culler
+ * Copyright © 2019 Kevin Walzer/WordTech Communications LLC.
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
diff --git a/macosx/tkMacOSXImage.c b/macosx/tkMacOSXImage.c
index 0df23d9..60183f4 100644
--- a/macosx/tkMacOSXImage.c
+++ b/macosx/tkMacOSXImage.c
@@ -3,10 +3,10 @@
*
* The code in this file provides an interface for XImages,
*
- * Copyright (c) 1995-1997 Sun Microsystems, Inc.
- * Copyright 2001-2009, Apple Inc.
- * Copyright (c) 2005-2009 Daniel A. Steffen <das@users.sourceforge.net>
- * Copyright (c) 2017-2020 Marc Culler.
+ * Copyright © 1995-1997 Sun Microsystems, Inc.
+ * Copyright © 2001-2009, Apple Inc.
+ * Copyright © 2005-2009 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright © 2017-2020 Marc Culler.
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
diff --git a/macosx/tkMacOSXInit.c b/macosx/tkMacOSXInit.c
index da2ea61..bd6ca7d 100644
--- a/macosx/tkMacOSXInit.c
+++ b/macosx/tkMacOSXInit.c
@@ -4,10 +4,10 @@
* This file contains Mac OS X -specific interpreter initialization
* functions.
*
- * Copyright (c) 1995-1997 Sun Microsystems, Inc.
- * Copyright 2001-2009, Apple Inc.
- * Copyright (c) 2005-2009 Daniel A. Steffen <das@users.sourceforge.net>
- * Copyright (c) 2017 Marc Culler
+ * Copyright © 1995-1997 Sun Microsystems, Inc.
+ * Copyright © 2001-2009 Apple Inc.
+ * Copyright © 2005-2009 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright © 2017 Marc Culler
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -109,17 +109,15 @@ static int TkMacOSXGetAppPathCmd(ClientData cd, Tcl_Interp *ip,
#endif
[self _setupWindowNotifications];
[self _setupApplicationNotifications];
+}
- /*
- * Construct the menu bar.
- */
-
- _defaultMainMenu = nil;
- [self _setupMenus];
+-(void)applicationDidFinishLaunching:(NSNotification *)notification
+{
+ (void)notification;
- /*
- * Initialize event processing.
- */
+ /*
+ * Initialize event processing.
+ */
TkMacOSXInitAppleEvents(_eventInterp);
@@ -131,25 +129,11 @@ static int TkMacOSXGetAppPathCmd(ClientData cd, Tcl_Interp *ip,
TkMacOSXInitCGDrawing(_eventInterp, TRUE, 0);
/*
- * Check if the app has been signed.
+ * Construct the menu bar.
*/
- mainBundleURL = CFBundleCopyBundleURL(CFBundleGetMainBundle());
- errorCode = SecStaticCodeCreateWithPath(mainBundleURL, kSecCSDefaultFlags,
- &staticCode);
- CFRelease(mainBundleURL);
- if (staticCode != nil && errorCode == noErr) {
- errorCode = SecStaticCodeCheckValidity(staticCode, kSecCSBasicValidateOnly, nil);
- if (errorCode == noErr) {
- [NSApp setIsSigned:YES];
- }
- CFRelease(staticCode);
- }
-}
-
--(void)applicationDidFinishLaunching:(NSNotification *)notification
-{
- (void)notification;
+ _defaultMainMenu = nil;
+ [self _setupMenus];
/*
* It is not safe to force activation of the NSApp until this method is
diff --git a/macosx/tkMacOSXKeyEvent.c b/macosx/tkMacOSXKeyEvent.c
index 6e4a764..e41d7e6 100644
--- a/macosx/tkMacOSXKeyEvent.c
+++ b/macosx/tkMacOSXKeyEvent.c
@@ -4,10 +4,10 @@
* This file implements functions that decode & handle keyboard events on
* MacOS X.
*
- * Copyright 2001-2009, Apple Inc.
- * Copyright (c) 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
- * Copyright (c) 2012 Adrian Robert.
- * Copyright 2015-2020 Marc Culler.
+ * Copyright © 2001-2009, Apple Inc.
+ * Copyright © 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright © 2012 Adrian Robert.
+ * Copyright © 2015-2020 Marc Culler.
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
diff --git a/macosx/tkMacOSXKeyboard.c b/macosx/tkMacOSXKeyboard.c
index 60d1d0d..e6f51d8 100644
--- a/macosx/tkMacOSXKeyboard.c
+++ b/macosx/tkMacOSXKeyboard.c
@@ -3,10 +3,10 @@
*
* Routines to support keyboard events on the Macintosh.
*
- * Copyright (c) 1995-1997 Sun Microsystems, Inc.
- * Copyright 2001-2009, Apple Inc.
- * Copyright (c) 2005-2009 Daniel A. Steffen <das@users.sourceforge.net>
- * Copyright (c) 2020 Marc Culler
+ * Copyright © 1995-1997 Sun Microsystems, Inc.
+ * Copyright © 2001-2009, Apple Inc.
+ * Copyright © 2005-2009 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright © 2020 Marc Culler
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
diff --git a/macosx/tkMacOSXKeysyms.h b/macosx/tkMacOSXKeysyms.h
index da364ea..7bd250b 100644
--- a/macosx/tkMacOSXKeysyms.h
+++ b/macosx/tkMacOSXKeysyms.h
@@ -4,11 +4,11 @@
* Contains data used for processing key events, some of which was
* moved from tkMacOSXKeyboard.c.
*
- * Copyright (c) 1990-1994 The Regents of the University of California.
- * Copyright (c) 1994-1997 Sun Microsystems, Inc.
- * Copyright 2001-2009, Apple Inc.
- * Copyright (c) 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
- * Copyright (c) 2020 Marc Culler
+ * Copyright © 1990-1994 The Regents of the University of California.
+ * Copyright © 1994-1997 Sun Microsystems, Inc.
+ * Copyright © 2001-2009 Apple Inc.
+ * Copyright © 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright © 2020 Marc Culler
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
diff --git a/macosx/tkMacOSXMenu.c b/macosx/tkMacOSXMenu.c
index 8970109..2a9ca0b 100644
--- a/macosx/tkMacOSXMenu.c
+++ b/macosx/tkMacOSXMenu.c
@@ -3,10 +3,10 @@
*
* This module implements the Mac-platform specific features of menus.
*
- * Copyright (c) 1996-1997 by Sun Microsystems, Inc.
- * Copyright 2001-2009, Apple Inc.
- * Copyright (c) 2005-2009 Daniel A. Steffen <das@users.sourceforge.net>
- * Copyright (c) 2012 Adrian Robert.
+ * Copyright © 1996-1997 Sun Microsystems, Inc.
+ * Copyright © 2001-2009 Apple Inc.
+ * Copyright © 2005-2009 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright © 2012 Adrian Robert.
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -316,12 +316,6 @@ TKBackgroundLoop *backgroundLoop = nil;
if (menuPtr && mePtr) {
Tcl_Interp *interp = menuPtr->interp;
- /*
- * Add time for errors to fire if necessary. This is sub-optimal
- * but avoids issues with Tcl/Cocoa event loop integration.
- */
-
- //Tcl_Sleep(100);
Tcl_Preserve(interp);
Tcl_Preserve(menuPtr);
@@ -685,7 +679,6 @@ TkpConfigureMenuEntry(
NSString *keyEquivalent = @"";
NSUInteger modifierMask = NSCommandKeyMask;
NSMenu *submenu = nil;
- NSDictionary *attributes;
int imageWidth, imageHeight;
GC gc = (mePtr->textGC ? mePtr->textGC : mePtr->menuPtr->textGC);
Tcl_Obj *fontPtr = (mePtr->fontPtr ?
@@ -714,9 +707,7 @@ TkpConfigureMenuEntry(
&imageHeight);
image = TkMacOSXGetNSImageFromBitmap(mePtr->menuPtr->display, bitmap,
gc, imageWidth, imageHeight);
- if (gc->foreground == defaultFg) {
- [image setTemplate:YES];
- }
+ [image setTemplate:YES];
}
[menuItem setImage:image];
if ((!image || mePtr->compound != COMPOUND_NONE) && mePtr->labelPtr &&
@@ -730,25 +721,50 @@ TkpConfigureMenuEntry(
}
}
[menuItem setTitle:title];
- if (strcmp(Tcl_GetString(fontPtr), "menu") || gc->foreground != defaultFg
- || gc->background != defaultBg) {
- attributes = TkMacOSXNSFontAttributesForFont(Tk_GetFontFromObj(
- mePtr->menuPtr->tkwin, fontPtr));
- if (gc->foreground != defaultFg || gc->background != defaultBg) {
- NSColor *color = TkMacOSXGetNSColor(gc,
- gc->foreground!=defaultFg? gc->foreground:gc->background);
-
- attributes = [[attributes mutableCopy] autorelease];
- [(NSMutableDictionary *) attributes setObject:color
- forKey:NSForegroundColorAttributeName];
- }
- if (attributes) {
- attributedTitle = [[[NSAttributedString alloc]
- initWithString:title attributes:attributes] autorelease];
- }
+
+#if 0
+
+ /*
+ * The -background and -foreground options are now ignored in Aqua.
+ * See ticket [635167af14].
+ */
+
+ NSDictionary fontAttributes = TkMacOSXNSFontAttributesForFont(
+ Tk_GetFontFromObj(mePtr->menuPtr->tkwin, fontPtr));
+ NSMutableDictionary *attributes = [fontAttributes mutableCopy];
+ static unsigned long defaultBg = 0, defaultFg = 0;
+ if (defaultBg == 0) {
+ tkColor *tkColPtr = TkpGetColor(NULL, DEF_MENU_BG_COLOR);
+ defaultBg = tkColPtr->color.pixel;
+ ckfree(tkColPtr);
+ }
+ if (defaultFg == 0) {
+ tkColor *tkColPtr = TkpGetColor(NULL, DEF_MENU_FG);
+ defaultFg = tkColPtr->color.pixel;
+ ckfree(tkColPtr);
+ }
+ if (gc->foreground != defaultFg) {
+ NSColor *fgcolor = TkMacOSXGetNSColor(gc, gc->foreground);
+ [attributes setObject:fgcolor
+ forKey:NSForegroundColorAttributeName];
+ }
+ if (gc->background != defaultBg) {
+ NSColor *bgcolor = TkMacOSXGetNSColor(gc, gc->background);
+ [attributes setObject:bgcolor
+ forKey:NSBackgroundColorAttributeName];
}
+
+#else
+
+ NSDictionary *attributes = TkMacOSXNSFontAttributesForFont(
+ Tk_GetFontFromObj(mePtr->menuPtr->tkwin, fontPtr));
+
+#endif
+
+ attributedTitle = [[NSAttributedString alloc] initWithString:title
+ attributes:attributes];
[menuItem setAttributedTitle:attributedTitle];
- [menuItem setEnabled:!(mePtr->state == ENTRY_DISABLED)];
+ [menuItem setEnabled:(mePtr->state != ENTRY_DISABLED)];
[menuItem setState:((mePtr->type == CHECK_BUTTON_ENTRY ||
mePtr->type == RADIO_BUTTON_ENTRY) && mePtr->indicatorOn &&
(mePtr->entryFlags & ENTRY_SELECTED) ? NSOnState : NSOffState)];
@@ -781,27 +797,17 @@ TkpConfigureMenuEntry(
if ([menuItem isEnabled]) {
/*
- * This menuItem might have been previously disabled (XXX:
- * track this), which would have disabled entries; we must
- * re-enable the entries here.
+ * This menuItem might have been previously disabled which
+ * would have disabled all of its entries; we must re-enable the
+ * entries here. It is important to iterate though the Tk
+ * entries, not the NSMenuItems, since some NSMenuItems may
+ * have been added by the system. See [7185d26cf4].
*/
- int i = 0;
- NSArray *itemArray = [submenu itemArray];
-
- for (NSMenuItem *item in itemArray) {
+ for (int i = 0; i < menuRefPtr->menuPtr->numEntries; i++) {
TkMenuEntry *submePtr = menuRefPtr->menuPtr->entries[i];
-
- /*
- * Work around an apparent bug where itemArray can have
- * more items than the menu's entries[] array.
- */
-
- if (i >= (int) menuRefPtr->menuPtr->numEntries) {
- break;
- }
- [item setEnabled: !(submePtr->state == ENTRY_DISABLED)];
- i++;
+ NSMenuItem *item = (NSMenuItem *) submePtr->platformEntryData;
+ [item setEnabled:(submePtr->state != ENTRY_DISABLED)];
}
}
}
@@ -1674,8 +1680,6 @@ TkMacOSXClearMenubarActive(void)
void
TkpMenuInit(void)
{
- // TkColor *tkColPtr;
-
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
#define observe(n, s) \
@@ -1815,13 +1819,17 @@ TkpComputeMenubarGeometry(
* TkpDrawMenuEntry --
*
* Draws the given menu entry at the given coordinates with the given
- * attributes.
+ * attributes. This is a no-op on macOS since the menus are drawn by
+ * the Apple window manager, which also handles all events related to
+ * selecting menu items. This function is only called for tearoff
+ * menus, which are not supported on macOS but do get drawn as nearly
+ * invisible 1 pixel wide windows on macOS
*
* Results:
* None.
*
* Side effects:
- * X Server commands are executed to display the menu entry.
+ * None
*
*----------------------------------------------------------------------
*/
diff --git a/macosx/tkMacOSXMenubutton.c b/macosx/tkMacOSXMenubutton.c
index 2fad3cb..7de2b46 100644
--- a/macosx/tkMacOSXMenubutton.c
+++ b/macosx/tkMacOSXMenubutton.c
@@ -4,11 +4,11 @@
* This file implements the Macintosh specific portion of the menubutton
* widget.
*
- * Copyright (c) 1996 by Sun Microsystems, Inc.
- * Copyright 2001, Apple Computer, Inc.
- * Copyright (c) 2006-2007 Daniel A. Steffen <das@users.sourceforge.net>
- * Copyright 2007 Revar Desmera.
- * Copyright 2015 Kevin Walzer/WordTech Communications LLC.
+ * Copyright © 1996 Sun Microsystems, Inc.
+ * Copyright © 2001 Apple Computer, Inc.
+ * Copyright © 2006-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright © 2007 Revar Desmera.
+ * Copyright © 2015 Kevin Walzer/WordTech Communications LLC.
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
diff --git a/macosx/tkMacOSXMenus.c b/macosx/tkMacOSXMenus.c
index fe53f25..31429d4 100644
--- a/macosx/tkMacOSXMenus.c
+++ b/macosx/tkMacOSXMenus.c
@@ -3,9 +3,9 @@
*
* These calls set up the default menus for Tk.
*
- * Copyright (c) 1995-1996 Sun Microsystems, Inc.
- * Copyright 2001-2009, Apple Inc.
- * Copyright (c) 2005-2009 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright © 1995-1996 Sun Microsystems, Inc.
+ * Copyright © 2001-2009 Apple Inc.
+ * Copyright © 2005-2009 Daniel A. Steffen <das@users.sourceforge.net>
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
diff --git a/macosx/tkMacOSXMouseEvent.c b/macosx/tkMacOSXMouseEvent.c
index 83eef3d..c4ba1bd 100644
--- a/macosx/tkMacOSXMouseEvent.c
+++ b/macosx/tkMacOSXMouseEvent.c
@@ -4,8 +4,8 @@
* This file implements functions that decode & handle mouse events on
* MacOS X.
*
- * Copyright 2001-2009, Apple Inc.
- * Copyright (c) 2005-2009 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright © 2001-2009 Apple Inc.
+ * Copyright © 2005-2009 Daniel A. Steffen <das@users.sourceforge.net>
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
diff --git a/macosx/tkMacOSXNotify.c b/macosx/tkMacOSXNotify.c
index e169a7d..854e241 100644
--- a/macosx/tkMacOSXNotify.c
+++ b/macosx/tkMacOSXNotify.c
@@ -4,10 +4,10 @@
* This file contains the implementation of a tcl event source
* for the AppKit event loop.
*
- * Copyright (c) 1995-1997 Sun Microsystems, Inc.
- * Copyright 2001-2009, Apple Inc.
- * Copyright (c) 2005-2009 Daniel A. Steffen <das@users.sourceforge.net>
- * Copyright 2015 Marc Culler.
+ * Copyright © 1995-1997 Sun Microsystems, Inc.
+ * Copyright © 2001-2009, Apple Inc.
+ * Copyright © 2005-2009 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright © 2015 Marc Culler.
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
diff --git a/macosx/tkMacOSXPrivate.h b/macosx/tkMacOSXPrivate.h
index ef2bd1d..5b8ea14 100644
--- a/macosx/tkMacOSXPrivate.h
+++ b/macosx/tkMacOSXPrivate.h
@@ -3,9 +3,9 @@
*
* Macros and declarations that are purely internal & private to TkAqua.
*
- * Copyright (c) 2005-2009 Daniel A. Steffen <das@users.sourceforge.net>
- * Copyright (c) 2008-2009 Apple Inc.
- * Copyright (c) 2020 Marc Culler
+ * Copyright © 2005-2009 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright © 2008-2009 Apple Inc.
+ * Copyright © 2020 Marc Culler
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
diff --git a/macosx/tkMacOSXRegion.c b/macosx/tkMacOSXRegion.c
index 6cb61dd..f78aa79 100644
--- a/macosx/tkMacOSXRegion.c
+++ b/macosx/tkMacOSXRegion.c
@@ -3,9 +3,9 @@
*
* Implements X window calls for manipulating regions
*
- * Copyright (c) 1995-1996 Sun Microsystems, Inc.
- * Copyright 2001-2009, Apple Inc.
- * Copyright (c) 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright © 1995-1996 Sun Microsystems, Inc.
+ * Copyright © 2001-2009, Apple Inc.
+ * Copyright © 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
diff --git a/macosx/tkMacOSXScale.c b/macosx/tkMacOSXScale.c
index 2bbd795..c226aeb 100644
--- a/macosx/tkMacOSXScale.c
+++ b/macosx/tkMacOSXScale.c
@@ -4,10 +4,10 @@
* This file implements the Macintosh specific portion of the
* scale widget.
*
- * Copyright (c) 1996 by Sun Microsystems, Inc.
- * Copyright (c) 1998-2000 by Scriptics Corporation.
- * Copyright (c) 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
- * Copyright 2008-2009, Apple Inc.
+ * Copyright © 1996 Sun Microsystems, Inc.
+ * Copyright © 1998-2000 Scriptics Corporation.
+ * Copyright © 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright © 2008-2009 Apple Inc.
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
diff --git a/macosx/tkMacOSXScrlbr.c b/macosx/tkMacOSXScrlbr.c
index 3149b15..5cd1f56 100644
--- a/macosx/tkMacOSXScrlbr.c
+++ b/macosx/tkMacOSXScrlbr.c
@@ -4,11 +4,11 @@
* This file implements the Macintosh specific portion of the scrollbar
* widget.
*
- * Copyright (c) 1996 by Sun Microsystems, Inc.
- * Copyright 2001-2009, Apple Inc.
- * Copyright (c) 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
- * Copyright (c) 2015 Kevin Walzer/WordTech Commununications LLC.
- * Copyright (c) 2018-2019 Marc Culler
+ * Copyright © 1996 Sun Microsystems, Inc.
+ * Copyright © 2001-2009 Apple Inc.
+ * Copyright © 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright © 2015 Kevin Walzer/WordTech Commununications LLC.
+ * Copyright © 2018-2019 Marc Culler
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
diff --git a/macosx/tkMacOSXSend.c b/macosx/tkMacOSXSend.c
index 8cc00d3..5b97923 100644
--- a/macosx/tkMacOSXSend.c
+++ b/macosx/tkMacOSXSend.c
@@ -22,10 +22,10 @@
* may not get done for awhile. So this sketch is offered for the brave
* to attempt if they need the functionality...
*
- * Copyright (c) 1989-1994 The Regents of the University of California.
- * Copyright (c) 1994-1998 Sun Microsystems, Inc.
- * Copyright 2001-2009, Apple Inc.
- * Copyright (c) 2005-2009 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright © 1989-1994 The Regents of the University of California.
+ * Copyright © 1994-1998 Sun Microsystems, Inc.
+ * Copyright © 2001-2009 Apple Inc.
+ * Copyright © 2005-2009 Daniel A. Steffen <das@users.sourceforge.net>
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
diff --git a/macosx/tkMacOSXServices.c b/macosx/tkMacOSXServices.c
index 6e1a9a1..c9a46f5 100644
--- a/macosx/tkMacOSXServices.c
+++ b/macosx/tkMacOSXServices.c
@@ -3,9 +3,9 @@
*\
* This file allows the integration of Tk and the Cocoa NSServices API.
*
- * Copyright (c) 2010-2019 Kevin Walzer/WordTech Communications LLC.
- * Copyright (c) 2019 Marc Culler.
- * Copyright (c) 2010 Adrian Robert.
+ * Copyright © 2010-2019 Kevin Walzer/WordTech Communications LLC.
+ * Copyright © 2019 Marc Culler.
+ * Copyright © 2010 Adrian Robert.
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
diff --git a/macosx/tkMacOSXSubwindows.c b/macosx/tkMacOSXSubwindows.c
index d2979f6..a3cf7b0 100644
--- a/macosx/tkMacOSXSubwindows.c
+++ b/macosx/tkMacOSXSubwindows.c
@@ -3,9 +3,9 @@
*
* Implements subwindows for the macintosh version of Tk.
*
- * Copyright (c) 1995-1997 Sun Microsystems, Inc.
- * Copyright 2001-2009, Apple Inc.
- * Copyright (c) 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright © 1995-1997 Sun Microsystems, Inc.
+ * Copyright © 2001-2009 Apple Inc.
+ * Copyright © 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
diff --git a/macosx/tkMacOSXSysTray.c b/macosx/tkMacOSXSysTray.c
index b6d8253..563b58f 100644
--- a/macosx/tkMacOSXSysTray.c
+++ b/macosx/tkMacOSXSysTray.c
@@ -6,9 +6,9 @@
* window and a "sysnotify" command to post system notifications.
* In macOS the icon appears on the right hand side of the menu bar.
*
- * Copyright (c) 2020 Kevin Walzer/WordTech Communications LLC.
- * Copyright (c) 2020 Jan Nijtmans.
- * Copyright (c) 2020 Marc Culler.
+ * Copyright © 2020 Kevin Walzer/WordTech Communications LLC.
+ * Copyright © 2020 Jan Nijtmans.
+ * Copyright © 2020 Marc Culler.
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
diff --git a/macosx/tkMacOSXTest.c b/macosx/tkMacOSXTest.c
index 4ded4de..730b8a4 100644
--- a/macosx/tkMacOSXTest.c
+++ b/macosx/tkMacOSXTest.c
@@ -4,9 +4,9 @@
* Contains commands for platform specific tests for
* the Macintosh platform.
*
- * Copyright (c) 1996 Sun Microsystems, Inc.
- * Copyright 2001-2009, Apple Inc.
- * Copyright (c) 2005-2009 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright © 1996 Sun Microsystems, Inc.
+ * Copyright © 2001-2009 Apple Inc.
+ * Copyright © 2005-2009 Daniel A. Steffen <das@users.sourceforge.net>
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c
index 30a2d57..d6923db 100644
--- a/macosx/tkMacOSXWindowEvent.c
+++ b/macosx/tkMacOSXWindowEvent.c
@@ -4,10 +4,10 @@
* This file defines the routines for both creating and handling Window
* Manager class events for Tk.
*
- * Copyright 2001-2009, Apple Inc.
- * Copyright (c) 2005-2009 Daniel A. Steffen <das@users.sourceforge.net>
- * Copyright (c) 2015 Kevin Walzer/WordTech Communications LLC.
- * Copyright (c) 2015 Marc Culler.
+ * Copyright © 2001-2009 Apple Inc.
+ * Copyright © 2005-2009 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright © 2015 Kevin Walzer/WordTech Communications LLC.
+ * Copyright © 2015 Marc Culler.
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c
index 0b8ef81..d647b46 100644
--- a/macosx/tkMacOSXWm.c
+++ b/macosx/tkMacOSXWm.c
@@ -5,11 +5,11 @@
* application and the window manager. Among other things, it implements
* the "wm" command and passes geometry information to the window manager.
*
- * Copyright (c) 1994-1997 Sun Microsystems, Inc.
- * Copyright 2001-2009, Apple Inc.
- * Copyright (c) 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
- * Copyright (c) 2010 Kevin Walzer/WordTech Communications LLC.
- * Copyright (c) 2017-2019 Marc Culler.
+ * Copyright © 1994-1997 Sun Microsystems, Inc.
+ * Copyright © 2001-2009, Apple Inc.
+ * Copyright © 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright © 2010 Kevin Walzer/WordTech Communications LLC.
+ * Copyright © 2017-2019 Marc Culler.
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -2868,9 +2868,9 @@ WmIconwindowCmd(
static int
WmManageCmd(
- TCL_UNUSED(Tk_Window), /* Main window of the application. */
- TkWindow *winPtr, /* Toplevel or Frame to work with */
- Tcl_Interp *interp, /* Current interpreter. */
+ TCL_UNUSED(Tk_Window), /* Main window of the application. */
+ TkWindow *winPtr, /* Toplevel or Frame to work with */
+ Tcl_Interp *interp, /* Current interpreter. */
TCL_UNUSED(int), /* Number of arguments. */
TCL_UNUSED(Tcl_Obj *const *)) /* Argument objects. */
{
@@ -2888,6 +2888,18 @@ WmManageCmd(
Tcl_SetErrorCode(interp, "TK", "WM", "MANAGE", NULL);
return TCL_ERROR;
}
+
+ /*
+ * Draw the managed widget at the top left corner of its toplevel.
+ * See [4a40c6cace].
+ */
+
+ if (macWin) {
+ winPtr->changes.x -= macWin->xOff;
+ winPtr->changes.y -= macWin->yOff;
+ XMoveWindow(winPtr->display, winPtr->window, 0, 0);
+ }
+
TkFocusSplit(winPtr);
Tk_UnmapWindow(frameWin);
if (wmPtr == NULL) {
diff --git a/macosx/tkMacOSXWm.h b/macosx/tkMacOSXWm.h
index c648292..6b0ee69 100644
--- a/macosx/tkMacOSXWm.h
+++ b/macosx/tkMacOSXWm.h
@@ -3,8 +3,8 @@
*
* Declarations of Macintosh specific window manager structures.
*
- * Copyright 2001-2009, Apple Inc.
- * Copyright (c) 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright © 2001-2009 Apple Inc.
+ * Copyright © 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
diff --git a/macosx/tkMacOSXXCursors.h b/macosx/tkMacOSXXCursors.h
index 1363bee..9beda5e 100644
--- a/macosx/tkMacOSXXCursors.h
+++ b/macosx/tkMacOSXXCursors.h
@@ -5,9 +5,9 @@
* emulate the X cursor set. All of these cursors were
* constructed and donated by Grant Neufeld. (gneufeld@ccs.carleton.ca)
*
- * Copyright (c) 1995-1996 Sun Microsystems, Inc.
- * Copyright 2008-2009, Apple Inc.
- * Copyright (c) 2008-2009 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright © 1995-1996 Sun Microsystems, Inc.
+ * Copyright © 2008-2009 Apple Inc.
+ * Copyright © 2008-2009 Daniel A. Steffen <das@users.sourceforge.net>
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
diff --git a/macosx/tkMacOSXXStubs.c b/macosx/tkMacOSXXStubs.c
index 25d9f96..208bb45 100644
--- a/macosx/tkMacOSXXStubs.c
+++ b/macosx/tkMacOSXXStubs.c
@@ -6,10 +6,10 @@
* their implementation just doesn't do anything. Other calls will
* eventually be moved into other files.
*
- * Copyright (c) 1995-1997 Sun Microsystems, Inc.
- * Copyright 2001-2009, Apple Inc.
- * Copyright (c) 2005-2009 Daniel A. Steffen <das@users.sourceforge.net>
- * Copyright 2014 Marc Culler.
+ * Copyright © 1995-1997 Sun Microsystems, Inc.
+ * Copyright © 2001-2009, Apple Inc.
+ * Copyright © 2005-2009 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright © 2014 Marc Culler.
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
diff --git a/macosx/ttkMacOSXTheme.c b/macosx/ttkMacOSXTheme.c
index 8437aa6..ea40a97 100644
--- a/macosx/ttkMacOSXTheme.c
+++ b/macosx/ttkMacOSXTheme.c
@@ -3,12 +3,12 @@
*
* Tk theme engine for Mac OSX, using the Appearance Manager API.
*
- * Copyright (c) 2004 Joe English
- * Copyright (c) 2005 Neil Madden
- * Copyright (c) 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
- * Copyright 2008-2009, Apple Inc.
- * Copyright 2009 Kevin Walzer/WordTech Communications LLC.
- * Copyright 2019 Marc Culler
+ * Copyright © 2004 Joe English
+ * Copyright © 2005 Neil Madden
+ * Copyright © 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright © 2008-2009 Apple Inc.
+ * Copyright © 2009 Kevin Walzer/WordTech Communications LLC.
+ * Copyright © 2019 Marc Culler
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -1872,19 +1872,24 @@ static Ttk_ElementSpec EntryElementSpec = {
* 1 pixel to account for the fact that the button is not centered.
*/
-static Ttk_Padding ComboboxPadding = {4, 2, 20, 2};
+static Ttk_Padding ComboboxPadding = {4, 4, 20, 4};
+static Ttk_Padding DarkComboboxPadding = {6, 6, 22, 6};
static void ComboboxElementSize(
TCL_UNUSED(void *),
TCL_UNUSED(void *),
- TCL_UNUSED(Tk_Window),
+ Tk_Window tkwin,
int *minWidth,
int *minHeight,
Ttk_Padding *paddingPtr)
{
*minWidth = 24;
*minHeight = 23;
- *paddingPtr = ComboboxPadding;
+ if (TkMacOSXInDarkMode(tkwin)) {
+ *paddingPtr = DarkComboboxPadding;
+ } else {
+ *paddingPtr = ComboboxPadding;
+ }
}
static void ComboboxElementDraw(
@@ -1905,19 +1910,24 @@ static void ComboboxElementDraw(
};
BEGIN_DRAWING(d)
- bounds.origin.y += 1;
if (TkMacOSXInDarkMode(tkwin)) {
- bounds.size.height += 1;
+ bounds = CGRectInset(bounds, 3, 3);
+ if (state & TTK_STATE_FOCUS) {
+ DrawDarkFocusRing(bounds, dc.context);
+ }
DrawDarkButton(bounds, info.kind, state, dc.context);
- } else if ([NSApp macOSVersion] > 100800) {
- if ((state & TTK_STATE_BACKGROUND) &&
- !(state & TTK_STATE_DISABLED)) {
- NSColor *background = [NSColor textBackgroundColor];
- CGRect innerBounds = CGRectInset(bounds, 1, 2);
- SolidFillRoundedRectangle(dc.context, innerBounds, 4, background);
+ } else {
+ if ([NSApp macOSVersion] > 100800) {
+ if ((state & TTK_STATE_BACKGROUND) &&
+ !(state & TTK_STATE_DISABLED)) {
+ NSColor *background = [NSColor textBackgroundColor];
+ CGRect innerBounds = CGRectInset(bounds, 1, 4);
+ bounds.origin.y += 1;
+ SolidFillRoundedRectangle(dc.context, innerBounds, 4, background);
+ }
}
+ ChkErr(HIThemeDrawButton, &bounds, &info, dc.context, HIOrientation, NULL);
}
- ChkErr(HIThemeDrawButton, &bounds, &info, dc.context, HIOrientation, NULL);
END_DRAWING
}