Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | add tk upstream changes |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
3029dbecda00444a0c203fb6bb5aab13 |
User & Date: | chw 2017-11-28 04:19:38 |
Context
2017-11-29
| ||
05:52 | fix for ticket [ec608f3052] check-in: ba57aaa4c4 user: chw tags: trunk | |
2017-11-28
| ||
04:19 | add tk upstream changes check-in: 3029dbecda user: chw tags: trunk | |
2017-11-27
| ||
21:24 | add tk upstream changes check-in: af0bfe21ca user: chw tags: trunk | |
Changes
Changes to jni/sdl2tk/macosx/README.
︙ | ︙ | |||
28 29 30 31 32 33 34 | - There are two versions of Tk available on macOS: TkAqua using the native aqua widgets and look&feel, and TkX11 using the traditional unix X11 wigets. TkX11 requires an X11 server to be installed, such as Apple's X11 (which is available as an optional or default install on recent macOS). TkAqua and TkX11 can be distinguished at runtime via [tk windowingsystem]. - At a minimum, macOS 10.3 is required to run Tcl and TkX11. | | | 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | - There are two versions of Tk available on macOS: TkAqua using the native aqua widgets and look&feel, and TkX11 using the traditional unix X11 wigets. TkX11 requires an X11 server to be installed, such as Apple's X11 (which is available as an optional or default install on recent macOS). TkAqua and TkX11 can be distinguished at runtime via [tk windowingsystem]. - At a minimum, macOS 10.3 is required to run Tcl and TkX11. TkAqua requires macOS 10.6 or later. - Unless weak-linking is used, Tcl/Tk built on macOS 10.x will not run on 10.y with y < x; on the other hand Tcl/Tk built on 10.y will always run on 10.x with y <= x (but without any of the fixes and optimizations that would be available in a binary built on 10.x). Weak-linking is available on OS X 10.2 or later, it additionally allows Tcl/Tk built on 10.x to run on any 10.y with x > y >= z (for a chosen z >= 2). |
︙ | ︙ | |||
58 59 60 61 62 63 64 | $pkg/Resources/Scripts/pkgIndex.tcl as well as the usual $pkg/pkgIndex.tcl. This allows building extensions as frameworks with all script files contained in the Resources/Scripts directory of the framework. - [load]able binary extensions can linked as either ordinary shared libraries (.dylib) or as MachO bundles (since 8.4.10/8.5a3); bundles have the advantage that they are [load]ed more efficiently from a tcl VFS (no temporary copy to the | | < | 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | $pkg/Resources/Scripts/pkgIndex.tcl as well as the usual $pkg/pkgIndex.tcl. This allows building extensions as frameworks with all script files contained in the Resources/Scripts directory of the framework. - [load]able binary extensions can linked as either ordinary shared libraries (.dylib) or as MachO bundles (since 8.4.10/8.5a3); bundles have the advantage that they are [load]ed more efficiently from a tcl VFS (no temporary copy to the native filesystem required). - The 'deploy' target of macosx/GNUmakefile installs the html manpages into the standard documentation location in the Tcl/Tk frameworks: Tcl.framework/Resources/Documentation/Reference/Tcl Tk.framework/Resources/Documentation/Reference/Tk No nroff manpages are installed by default by the GNUmakefile. |
︙ | ︙ | |||
175 176 177 178 179 180 181 | Window class names: document, modal, floating, utility, toolbar, simple, help, overlay Window attribute names: standardDocument, standardFloating, resizable, fullZoom, horizontalZoom, verticalZoom, closeBox, collapseBox, toolbarButton, sideTitlebar, noTitleBar, unifiedTitleAndToolbar, metal, hud, noShadow, doesNotCycle, noActivates, hideOnSuspend, inWindowMenu, ignoreClicks, doesNotHide, | | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | | | | < | > | < | > | | 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 | Window class names: document, modal, floating, utility, toolbar, simple, help, overlay Window attribute names: standardDocument, standardFloating, resizable, fullZoom, horizontalZoom, verticalZoom, closeBox, collapseBox, toolbarButton, sideTitlebar, noTitleBar, unifiedTitleAndToolbar, metal, hud, noShadow, doesNotCycle, noActivates, hideOnSuspend, inWindowMenu, ignoreClicks, doesNotHide, canJoinAllSpaces, moveToActiveSpace, nonActivating Note that not all attributes are valid for all window classes. Support for the 3 argument form was added with the Cocoa-based Tk 8.5.7, at the same time support for some legacy Carbon-specific classes and attributes was removed (they are still accepted by the command but no longer have any effect). If you want to use Remote Debugging with Xcode, you need to set the environment variable XCNOSTDIN to 1 in the Executable editor for Wish. That will cause us to force closing stdin & stdout. Otherwise, given how Xcode launches Wish remotely, they will be left open and then Wish & gdb will fight for stdin. 3. Building Tcl/Tk on macOS ------------------------------ - At least macOS 10.3 is required to build Tcl and TkX11, and macOS 10.6 is required to build TkAqua. The XCode application provides everything needed to build Tk, but it is not necessary to install the full XCode. It suffices to install the Command Line Tools package, which can be done by running the command: xcode-selecct --install - Tcl/Tk are most easily built as macOS frameworks via GNUmakefile in tcl/macosx and tk/macosx (see below for details), but can also be built with the standard unix configure and make buildsystem in tcl/unix resp. tk/unix as on any other unix platform (indeed, the GNUmakefiles are just wrappers around the unix buildsystem). The macOS specific configure flags are --enable-aqua, --enable-framework and --disable-corefoundation (which disables CF and notably reverts to the standard select based notifier). Note that --enable-aqua is incompatible with --disable-corefoundation (for both Tcl and Tk configure). - It was once possible to build with the Xcode IDE via the projects in tk/macosx, but this has not been tested recently. Take care to use the project matching your DevTools and OS version: Tk.xcode: for Xcode 3.1 on 10.5 Tk.xcodeproj: for Xcode 3.2 on 10.6 These have the following targets: Tk: calls through to tk/macosx/GNUMakefile, requires a corresponding build of the Tcl target of tcl/macosx/Tcl.xcode. tktest: static build of TkAqua tktest for debugging. |
︙ | ︙ | |||
299 300 301 302 303 304 305 | be run on the build machine (i.e. ppc on G3/G4, ppc or ppc64 on G5, ppc or i386 on Core and ppc, i386 or x86_64 on Core2/Xeon). Universal builds of Tcl TEA extensions are also possible with CFLAGS set as above, they will be [load]able by universal as well as thin binaries of Tcl. - To enable weak-linking, set the MACOSX_DEPLOYMENT_TARGET environment variable to the minimal OS version the binaries should be able to run on, e.g: | | | | 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 | be run on the build machine (i.e. ppc on G3/G4, ppc or ppc64 on G5, ppc or i386 on Core and ppc, i386 or x86_64 on Core2/Xeon). Universal builds of Tcl TEA extensions are also possible with CFLAGS set as above, they will be [load]able by universal as well as thin binaries of Tcl. - To enable weak-linking, set the MACOSX_DEPLOYMENT_TARGET environment variable to the minimal OS version the binaries should be able to run on, e.g: export MACOSX_DEPLOYMENT_TARGET=10.6 This requires at least gcc 3.1; with gcc 4 or later, set/add to CFLAGS instead: export CFLAGS="-mmacosx-version-min=10.6" Support for weak-linking was added with 8.4.14/8.5a5. Detailed Instructions for building with macosx/GNUmakefile ---------------------------------------------------------- - Unpack the Tcl and Tk source release archives and place the tcl and tk source trees in a common parent directory. |
︙ | ︙ | |||
454 455 456 457 458 459 460 | 4.2 Autorelease pools ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In order to carry out the job of managing autorelease pools, which would normally be handled by the [NSApp run] method, a private NSAUtoreleasePool* property is added to the TkApplication subclass of NSApplication. The TkpInit function calls [NSApp _setup] which | | | | > | 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 | 4.2 Autorelease pools ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In order to carry out the job of managing autorelease pools, which would normally be handled by the [NSApp run] method, a private NSAUtoreleasePool* property is added to the TkApplication subclass of NSApplication. The TkpInit function calls [NSApp _setup] which initializes this property by creating an NSAutoreleasePool prior to calling [NSApp finishLaunching]. This mimics the behavior of the [NSApp run] method, which calls [NSApp finishLaunching] just before starting the event loop. Since the CheckProc function gets called for every Tk event, it is an appropriate place to drain the main NSAutoreleasePool and replace it with a new pool. This is done by calling the method [NSApp _resetAutoreleasePool], where _resetAutoreleasePool is a method which we define for the subclass. Unfortunately, by itself this is not sufficient for safe memory managememt because, as was made painfully |
︙ | ︙ |
Changes to jni/sdl2tk/macosx/Wish-Info.plist.in.
︙ | ︙ | |||
65 66 67 68 69 70 71 | <key>CFBundleShortVersionString</key> <string>@TK_VERSION@@TK_PATCH_LEVEL@</string> <key>CFBundleSignature</key> <string>WiSH</string> <key>CFBundleVersion</key> <string>@TK_VERSION@@TK_PATCH_LEVEL@</string> <key>LSMinimumSystemVersion</key> | | | 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | <key>CFBundleShortVersionString</key> <string>@TK_VERSION@@TK_PATCH_LEVEL@</string> <key>CFBundleSignature</key> <string>WiSH</string> <key>CFBundleVersion</key> <string>@TK_VERSION@@TK_PATCH_LEVEL@</string> <key>LSMinimumSystemVersion</key> <string>10.6.0</string> <key>LSRequiresCarbon</key> <true/> <key>NSAppleScriptEnabled</key> <true/> <key>OSAScriptingDefinition</key> <string>Wish.sdef</string> <key>NSHighResolutionCapable</key> |
︙ | ︙ |
Changes to jni/sdl2tk/macosx/tkMacOSXDialog.c.
︙ | ︙ | |||
165 166 167 168 169 170 171 | [TYPE_YESNOCANCEL] = {5, 6, 4}, }; /* * Construct a file URL from directory and filename. Either may * be nil. If both are nil, returns nil. */ | < < | 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 | [TYPE_YESNOCANCEL] = {5, 6, 4}, }; /* * Construct a file URL from directory and filename. Either may * be nil. If both are nil, returns nil. */ static NSURL *getFileURL(NSString *directory, NSString *filename) { NSURL *url = nil; if (directory) { url = [NSURL fileURLWithPath:directory isDirectory:YES]; } if (filename) { url = [NSURL URLWithString:filename relativeToURL:url]; } return url; } #pragma mark TKApplication(TKDialog) @interface NSColorPanel(TKDialog) - (void) _setUseModalAppearance: (BOOL) flag; @end |
︙ | ︙ | |||
712 713 714 715 716 717 718 | } callbackInfo->cmdObj = cmdObj; callbackInfo->interp = interp; callbackInfo->multiple = multiple; parent = TkMacOSXDrawableWindow(((TkWindow *) tkwin)->window); if (haveParentOption && parent && ![parent attachedSheet]) { | | < < < < < < < < < < < < < < < < | 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 | } callbackInfo->cmdObj = cmdObj; callbackInfo->interp = interp; callbackInfo->multiple = multiple; parent = TkMacOSXDrawableWindow(((TkWindow *) tkwin)->window); if (haveParentOption && parent && ![parent attachedSheet]) { parentIsKey = [parent isKeyWindow]; if (directory || filename ) { NSURL * fileURL = getFileURL(directory, filename); [openpanel setDirectoryURL:fileURL]; } [openpanel beginSheetModalForWindow:parent completionHandler:^(NSInteger returnCode) { [NSApp tkFilePanelDidEnd:openpanel returnCode:returnCode contextInfo:callbackInfo ]; } ]; modalReturnCode = cmdObj ? modalOther : [NSApp runModalForWindow:openpanel]; } else { if (directory || filename ) { NSURL * fileURL = getFileURL(directory, filename); [openpanel setDirectoryURL:fileURL]; } modalReturnCode = [openpanel runModal]; [NSApp tkFilePanelDidEnd:openpanel returnCode:modalReturnCode contextInfo:callbackInfo]; } result = (modalReturnCode != modalError) ? TCL_OK : TCL_ERROR; if (parentIsKey) { [parent makeKeyWindow]; } |
︙ | ︙ | |||
997 998 999 1000 1001 1002 1003 | callbackInfo->cmdObj = cmdObj; callbackInfo->interp = interp; callbackInfo->multiple = 0; parent = TkMacOSXDrawableWindow(((TkWindow *) tkwin)->window); if (haveParentOption && parent && ![parent attachedSheet]) { parentIsKey = [parent isKeyWindow]; | < < < < < < < < < | < < < < < | 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 | callbackInfo->cmdObj = cmdObj; callbackInfo->interp = interp; callbackInfo->multiple = 0; parent = TkMacOSXDrawableWindow(((TkWindow *) tkwin)->window); if (haveParentOption && parent && ![parent attachedSheet]) { parentIsKey = [parent isKeyWindow]; if (directory) { [savepanel setDirectoryURL:[NSURL fileURLWithPath:directory isDirectory:YES]]; } /*check for file name, otherwise set to empty string; crashes with uncaught exception if set to nil*/ if (filename) { [savepanel setNameFieldStringValue:filename]; } else { [savepanel setNameFieldStringValue:@""]; } [savepanel beginSheetModalForWindow:parent completionHandler:^(NSInteger returnCode) { [NSApp tkFilePanelDidEnd:savepanel returnCode:returnCode contextInfo:callbackInfo ]; } ]; modalReturnCode = cmdObj ? modalOther : [NSApp runModalForWindow:savepanel]; } else { if (directory) { [savepanel setDirectoryURL:[NSURL fileURLWithPath:directory isDirectory:YES]]; } /*check for file name, otherwise set to empty string; crashes with uncaught exception if set to nil*/ if (filename) { [savepanel setNameFieldStringValue:filename]; } else { [savepanel setNameFieldStringValue:@""]; } modalReturnCode = [savepanel runModal]; [NSApp tkFilePanelDidEnd:savepanel returnCode:modalReturnCode contextInfo:callbackInfo]; } result = (modalReturnCode != modalError) ? TCL_OK : TCL_ERROR; if (parentIsKey) { [parent makeKeyWindow]; } |
︙ | ︙ | |||
1168 1169 1170 1171 1172 1173 1174 | callbackInfo->multiple = 0; /*check for directory value, set to root if not specified; otherwise crashes with exception because of nil string parameter*/ if (!directory) { directory = @"/"; } parent = TkMacOSXDrawableWindow(((TkWindow *) tkwin)->window); if (haveParentOption && parent && ![parent attachedSheet]) { | | < < < < < < < < < < < < < | 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 | callbackInfo->multiple = 0; /*check for directory value, set to root if not specified; otherwise crashes with exception because of nil string parameter*/ if (!directory) { directory = @"/"; } parent = TkMacOSXDrawableWindow(((TkWindow *) tkwin)->window); if (haveParentOption && parent && ![parent attachedSheet]) { parentIsKey = [parent isKeyWindow]; [panel setDirectoryURL:[NSURL fileURLWithPath:directory isDirectory:YES]]; [panel beginSheetModalForWindow:parent completionHandler:^(NSInteger returnCode) { [NSApp tkFilePanelDidEnd:panel returnCode:returnCode contextInfo:callbackInfo ]; } ]; modalReturnCode = cmdObj ? modalOther : [NSApp runModalForWindow:panel]; } else { [panel setDirectoryURL:[NSURL fileURLWithPath:directory isDirectory:YES]]; modalReturnCode = [panel runModal]; [NSApp tkFilePanelDidEnd:panel returnCode:modalReturnCode contextInfo:callbackInfo]; } result = (modalReturnCode != modalError) ? TCL_OK : TCL_ERROR; if (parentIsKey) { [parent makeKeyWindow]; } |
︙ | ︙ |
Changes to jni/sdl2tk/macosx/tkMacOSXEvent.c.
︙ | ︙ | |||
85 86 87 88 89 90 91 | case NSApplicationDefined: { id win; win = [theEvent window]; break; } case NSCursorUpdate: break; | < < | 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 | case NSApplicationDefined: { id win; win = [theEvent window]; break; } case NSCursorUpdate: break; case NSEventTypeGesture: case NSEventTypeMagnify: case NSEventTypeRotate: case NSEventTypeSwipe: case NSEventTypeBeginGesture: case NSEventTypeEndGesture: break; #endif default: break; /* return theEvent */ } return processedEvent; } |
︙ | ︙ |
Changes to jni/sdl2tk/macosx/tkMacOSXInit.c.
︙ | ︙ | |||
29 30 31 32 33 34 35 | static char scriptPath[PATH_MAX + 1] = ""; long tkMacOSXMacOSXVersion = 0; #pragma mark TKApplication(TKInit) | < < < < < < < < < < < | 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | static char scriptPath[PATH_MAX + 1] = ""; long tkMacOSXMacOSXVersion = 0; #pragma mark TKApplication(TKInit) @interface TKApplication(TKKeyboard) - (void) keyboardChanged: (NSNotification *) notification; @end #define TKApplication_NSApplicationDelegate <NSApplicationDelegate> @interface TKApplication(TKWindowEvent) TKApplication_NSApplicationDelegate - (void) _setupWindowNotifications; @end @interface TKApplication(TKMenus) - (void) _setupMenus; @end |
︙ | ︙ | |||
102 103 104 105 106 107 108 | observe(NSApplicationDidBecomeActiveNotification, applicationActivate:); observe(NSApplicationDidResignActiveNotification, applicationDeactivate:); observe(NSApplicationDidUnhideNotification, applicationShowHide:); observe(NSApplicationDidHideNotification, applicationShowHide:); observe(NSApplicationDidChangeScreenParametersNotification, displayChanged:); observe(NSTextInputContextKeyboardSelectionDidChangeNotification, keyboardChanged:); #undef observe | < < < | 91 92 93 94 95 96 97 98 99 100 101 102 103 104 | observe(NSApplicationDidBecomeActiveNotification, applicationActivate:); observe(NSApplicationDidResignActiveNotification, applicationDeactivate:); observe(NSApplicationDidUnhideNotification, applicationShowHide:); observe(NSApplicationDidHideNotification, applicationShowHide:); observe(NSApplicationDidChangeScreenParametersNotification, displayChanged:); observe(NSTextInputContextKeyboardSelectionDidChangeNotification, keyboardChanged:); #undef observe } -(void)applicationWillFinishLaunching:(NSNotification *)aNotification { /* * Initialize notifications. |
︙ | ︙ | |||
269 270 271 272 273 274 275 | initialized = 1; /* * Initialize/check OS version variable for runtime checks. */ | | | | 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 | initialized = 1; /* * Initialize/check OS version variable for runtime checks. */ #if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 # error Mac OS X 10.6 required #endif if (!uname(&name)) { tkMacOSXMacOSXVersion = (strtod(name.release, NULL) + 96) * 10; } /*Check for new versioning scheme on Yosemite (10.10) and later.*/ if (MAC_OS_X_VERSION_MIN_REQUIRED > 100000) { |
︙ | ︙ |
Changes to jni/sdl2tk/macosx/tkMacOSXMenu.c.
︙ | ︙ | |||
113 114 115 116 117 118 119 | @interface TKMenu(TKMenuPrivate) - (id) initWithTkMenu: (TkMenu *) tkMenu; - (TkMenu *) tkMenu; - (int) tkIndexOfItem: (NSMenuItem *) menuItem; - (void) insertItem: (NSMenuItem *) newItem atTkIndex: (NSInteger) index; @end | < < < < | 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | @interface TKMenu(TKMenuPrivate) - (id) initWithTkMenu: (TkMenu *) tkMenu; - (TkMenu *) tkMenu; - (int) tkIndexOfItem: (NSMenuItem *) menuItem; - (void) insertItem: (NSMenuItem *) newItem atTkIndex: (NSInteger) index; @end #define TKMenu_NSMenuDelegate <NSMenuDelegate> @interface TKMenu(TKMenuDelegate) TKMenu_NSMenuDelegate @end @implementation TKMenu - (void) setSpecial: (NSUInteger) special { NSAssert(!_tkSpecial, @"Cannot change specialness of a special menu"); |
︙ | ︙ |
Changes to jni/sdl2tk/macosx/tkMacOSXNotify.c.
︙ | ︙ | |||
272 273 274 275 276 277 278 | do { modalSession = TkMacOSXGetModalSession(); testEvent = [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:[NSDate distantPast] inMode:GetRunLoopMode(modalSession) dequeue:NO]; /* We must not steal any events during LiveResize. */ | < < < < < < | 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 | do { modalSession = TkMacOSXGetModalSession(); testEvent = [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:[NSDate distantPast] inMode:GetRunLoopMode(modalSession) dequeue:NO]; /* We must not steal any events during LiveResize. */ if (testEvent && [[testEvent window] inLiveResize]) { break; } currentEvent = [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:[NSDate distantPast] inMode:GetRunLoopMode(modalSession) dequeue:YES]; if (currentEvent) { /* Generate Xevents. */ int oldServiceMode = Tcl_SetServiceMode(TCL_SERVICE_ALL); |
︙ | ︙ |
Changes to jni/sdl2tk/macosx/tkMacOSXPrivate.h.
︙ | ︙ | |||
55 56 57 58 59 60 61 | if ((chk) && (cond)) { __VA_ARGS__ #define tk_else_mac_os_x_chk(...) \ } else { __VA_ARGS__ #define tk_if_mac_os_x_no(chk, cond, ...) \ if (0) { #define tk_else_mac_os_x_no(...) \ } else { __VA_ARGS__ | < < < < < < < < < < < < < < < < < < < < < | 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | if ((chk) && (cond)) { __VA_ARGS__ #define tk_else_mac_os_x_chk(...) \ } else { __VA_ARGS__ #define tk_if_mac_os_x_no(chk, cond, ...) \ if (0) { #define tk_else_mac_os_x_no(...) \ } else { __VA_ARGS__ /* * Macros for DEBUG_ASSERT_MESSAGE et al from Debugging.h. */ #undef kComponentSignatureString #undef COMPONENT_SIGNATURE |
︙ | ︙ |
Changes to jni/sdl2tk/macosx/tkMacOSXWindowEvent.c.
︙ | ︙ | |||
38 39 40 41 42 43 44 | #pragma mark TKApplication(TKWindowEvent) #ifdef TK_MAC_DEBUG_NOTIFICATIONS extern NSString *NSWindowWillOrderOnScreenNotification; extern NSString *NSWindowDidOrderOnScreenNotification; extern NSString *NSWindowDidOrderOffScreenNotification; | < < < < < | < | 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | #pragma mark TKApplication(TKWindowEvent) #ifdef TK_MAC_DEBUG_NOTIFICATIONS extern NSString *NSWindowWillOrderOnScreenNotification; extern NSString *NSWindowDidOrderOnScreenNotification; extern NSString *NSWindowDidOrderOffScreenNotification; #endif @implementation TKApplication(TKWindowEvent) - (void) windowActivation: (NSNotification *) notification { #ifdef TK_MAC_DEBUG_NOTIFICATIONS TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, notification); |
︙ | ︙ | |||
746 747 748 749 750 751 752 | * *---------------------------------------------------------------------- */ int Tk_MacOSXIsAppInFront(void) { | < < < < < < < < | < < | 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 | * *---------------------------------------------------------------------- */ int Tk_MacOSXIsAppInFront(void) { return ([NSRunningApplication currentApplication].active == true); } #pragma mark TKContentView #import <ApplicationServices/ApplicationServices.h> /* |
︙ | ︙ | |||
970 971 972 973 974 975 976 | Tk_QueueWindowEvent((XEvent *) &event, TCL_QUEUE_TAIL); } - (BOOL) isOpaque { NSWindow *w = [self window]; | < < < < | < | 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 | Tk_QueueWindowEvent((XEvent *) &event, TCL_QUEUE_TAIL); } - (BOOL) isOpaque { NSWindow *w = [self window]; return (w && (([w styleMask] & NSTexturedBackgroundWindowMask) || ![w isOpaque]) ? NO : YES); } - (BOOL) wantsDefaultClipping { return NO; } |
︙ | ︙ |
Changes to jni/sdl2tk/macosx/tkMacOSXWm.c.
︙ | ︙ | |||
52 53 54 55 56 57 58 | | kWindowHideOnFullScreenAttribute | kWindowNoConstrainAttribute \ | kWindowNoShadowAttribute | kWindowLiveResizeAttribute \ | kWindowOpaqueForEventsAttribute | kWindowIgnoreClicksAttribute \ | kWindowDoesNotCycleAttribute | tkWindowDoesNotHideAttribute \ | tkCanJoinAllSpacesAttribute | tkMoveToActiveSpaceAttribute \ | tkNonactivatingPanelAttribute | tkHUDWindowAttribute) | < < < | 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | | kWindowHideOnFullScreenAttribute | kWindowNoConstrainAttribute \ | kWindowNoShadowAttribute | kWindowLiveResizeAttribute \ | kWindowOpaqueForEventsAttribute | kWindowIgnoreClicksAttribute \ | kWindowDoesNotCycleAttribute | tkWindowDoesNotHideAttribute \ | tkCanJoinAllSpacesAttribute | tkMoveToActiveSpaceAttribute \ | tkNonactivatingPanelAttribute | tkHUDWindowAttribute) static const struct { const UInt64 validAttrs, defaultAttrs, forceOnAttrs, forceOffAttrs; int flags; NSUInteger styleMask; } macClassAttrs[] = { [kAlertWindowClass] = { .defaultAttrs = kWindowDoesNotCycleAttribute, }, |
︙ | ︙ | |||
362 363 364 365 366 367 368 | static void GetMinSize(TkWindow *winPtr, int *minWidthPtr, int *minHeightPtr); static void GetMaxSize(TkWindow *winPtr, int *maxWidthPtr, int *maxHeightPtr); static void RemapWindows(TkWindow *winPtr, MacDrawable *parentWin); | < < < < < < < < < < | 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 | static void GetMinSize(TkWindow *winPtr, int *minWidthPtr, int *minHeightPtr); static void GetMaxSize(TkWindow *winPtr, int *maxWidthPtr, int *maxHeightPtr); static void RemapWindows(TkWindow *winPtr, MacDrawable *parentWin); #pragma mark TKWindow(TKWm) @interface NSDrawerWindow : NSWindow { id _i1, _i2; } @end |
︙ | ︙ | |||
5254 5255 5256 5257 5258 5259 5260 | int index, i; if (objc < 3) { Tcl_WrongNumArgs(interp, 1, objv, "option window ?arg ...?"); return TCL_ERROR; } | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 5241 5242 5243 5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 | int index, i; if (objc < 3) { Tcl_WrongNumArgs(interp, 1, objv, "option window ?arg ...?"); return TCL_ERROR; } winPtr = (TkWindow *) Tk_NameToWindow(interp, Tcl_GetString(objv[2]), tkwin); if (winPtr == NULL) { return TCL_ERROR; } if (!(winPtr->flags & TK_TOP_LEVEL)) { |
︙ | ︙ | |||
5676 5677 5678 5679 5680 5681 5682 | /* * Workaround for [Bug 2824538]: Texured windows are draggable * from opaque content. */ [window setMovableByWindowBackground:NO]; } | < < < < < < < < < < < < < < | 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 | /* * Workaround for [Bug 2824538]: Texured windows are draggable * from opaque content. */ [window setMovableByWindowBackground:NO]; } [window setDocumentEdited:NO]; wmPtr->window = window; macWin->view = window.contentView; TkMacOSXApplyWindowAttributes(winPtr, window); NSRect geometry = InitialWindowBounds(winPtr, window); geometry.size.width += structureRect.size.width; |
︙ | ︙ | |||
6380 6381 6382 6383 6384 6385 6386 | initial) { NSWindowCollectionBehavior b = NSWindowCollectionBehaviorDefault; if (newAttributes & tkCanJoinAllSpacesAttribute) { b |= NSWindowCollectionBehaviorCanJoinAllSpaces; } else if (newAttributes & tkMoveToActiveSpaceAttribute) { b |= NSWindowCollectionBehaviorMoveToActiveSpace; } | < < < < < < < < < < < < | 6312 6313 6314 6315 6316 6317 6318 6319 6320 6321 6322 6323 6324 6325 6326 6327 6328 6329 6330 6331 | initial) { NSWindowCollectionBehavior b = NSWindowCollectionBehaviorDefault; if (newAttributes & tkCanJoinAllSpacesAttribute) { b |= NSWindowCollectionBehaviorCanJoinAllSpaces; } else if (newAttributes & tkMoveToActiveSpaceAttribute) { b |= NSWindowCollectionBehaviorMoveToActiveSpace; } if (newAttributes & kWindowDoesNotCycleAttribute) { b |= NSWindowCollectionBehaviorIgnoresCycle; } else { b |= NSWindowCollectionBehaviorParticipatesInCycle; } [macWindow setCollectionBehavior:b]; } if ((wmPtr->flags & WM_TOPMOST) != (oldFlags & WM_TOPMOST)) { [macWindow setLevel:(wmPtr->flags & WM_TOPMOST) ? kCGUtilityWindowLevel : ([macWindow isKindOfClass: [NSPanel class]] && [macWindow isFloatingPanel] ? kCGFloatingWindowLevel : kCGNormalWindowLevel)]; } |
︙ | ︙ | |||
6529 6530 6531 6532 6533 6534 6535 | TkWindow *winPtr, NSWindow *window, int fullscreen, Tcl_Interp *interp) { WmInfo *wmPtr = winPtr->wmInfoPtr; int result = TCL_OK, wasFullscreen = (wmPtr->flags & WM_FULLSCREEN); | < < | 6449 6450 6451 6452 6453 6454 6455 6456 6457 6458 6459 6460 6461 6462 6463 | TkWindow *winPtr, NSWindow *window, int fullscreen, Tcl_Interp *interp) { WmInfo *wmPtr = winPtr->wmInfoPtr; int result = TCL_OK, wasFullscreen = (wmPtr->flags & WM_FULLSCREEN); static unsigned long prevMask = 0, prevPres = 0; if (fullscreen) { int screenWidth = WidthOfScreen(Tk_Screen(winPtr)); int screenHeight = HeightOfScreen(Tk_Screen(winPtr)); /* * Check max width and height if set by the user. |
︙ | ︙ | |||
6572 6573 6574 6575 6576 6577 6578 | [window setFrame:[window frameRectForContentRect: screenBounds] display:YES]; wmPtr->flags &= ~WM_SYNC_PENDING; } wmPtr->flags |= WM_FULLSCREEN; } | < < < < < < < < < < < < | 6490 6491 6492 6493 6494 6495 6496 6497 6498 6499 6500 6501 6502 6503 6504 6505 6506 6507 6508 6509 6510 6511 6512 6513 | [window setFrame:[window frameRectForContentRect: screenBounds] display:YES]; wmPtr->flags &= ~WM_SYNC_PENDING; } wmPtr->flags |= WM_FULLSCREEN; } prevMask = [window styleMask]; prevPres = [NSApp presentationOptions]; [window setStyleMask: NSBorderlessWindowMask]; [NSApp setPresentationOptions: NSApplicationPresentationAutoHideDock | NSApplicationPresentationAutoHideMenuBar]; Tk_MapWindow((Tk_Window) winPtr); } else { wmPtr->flags &= ~WM_FULLSCREEN; [NSApp setPresentationOptions: prevPres]; [window setStyleMask: prevMask]; } if (wasFullscreen && !(wmPtr->flags & WM_FULLSCREEN)) { Tk_UnmapWindow((Tk_Window) winPtr); UInt64 oldAttributes = wmPtr->attributes; NSRect bounds = NSMakeRect(wmPtr->configX, tkMacOSXZeroScreenHeight - (wmPtr->configY + wmPtr->yInParent + wmPtr->configHeight), |
︙ | ︙ |