Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Merge byebye-leopard into core-8-6-branch. Removes conditional code for OS X 10.5. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | core-8-6-branch |
Files: | files | file ages | folders |
SHA3-256: |
8f691b9854c73022b59590333adb3587 |
User & Date: | culler 2017-11-27 22:35:56 |
Original Comment: | Merge byebye-leopard into core-8-6-branch. Removes conditional code for )OS X 10.5. |
References
2017-11-28
| ||
12:55 | • Ticket [2e5a565fff] Error while build Tk - use of undeclared identifier 'openFileTypes' status still Open with 4 other changes artifact: 3e723aa0b8 user: marc_culler | |
Context
2017-11-28
| ||
02:57 | Merge in remove_mac_decorations branch check-in: 7a7a1baac7 user: kevin_walzer tags: core-8-6-branch | |
2017-11-27
| ||
22:50 | Merge core-8-6-branch into trunk. Removes conditional code for OS X 10.5. check-in: c4638df74d user: culler tags: trunk | |
22:35 | Merge byebye-leopard into core-8-6-branch. Removes conditional code for OS X 10.5. check-in: 8f691b9854 user: culler tags: core-8-6-branch | |
11:12 | tkWinDialog.c: Change a LoadLibrary() call to GetModuleHandle(), since "shell32.dll" is already linked to Tk. Also various whitespace changes (mainly at line-ends) and comment fixes. Nothing functional. check-in: 46834338e1 user: jan.nijtmans tags: core-8-6-branch | |
01:19 | Remove all conditional code which requires a minimum deployment target of OSX 10.5. Currently the build fails for 10.5 and it seems pointless to try fixing it now, more than 8 years after Apple declared it obsolete. Closed-Leaf check-in: 73c5ff57ba user: culler tags: byebye-leopard | |
Changes
Changes to 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. |
︙ | ︙ | |||
211 212 213 214 215 216 217 | yellow #ffff00 magenta #ff00ff orange #ff8000 purple #800080 brown #996633 clear systemTransparent | < < < < < | | | < | > | < | > | | 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 | yellow #ffff00 magenta #ff00ff orange #ff8000 purple #800080 brown #996633 clear systemTransparent - 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: | | | | 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 | 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 | | | | > | 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 | 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 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 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 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 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 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 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 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 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 | #pragma mark TKApplication(TKWindowEvent) #ifdef TK_MAC_DEBUG_NOTIFICATIONS extern NSString *NSWindowWillOrderOnScreenNotification; extern NSString *NSWindowDidOrderOnScreenNotification; extern NSString *NSWindowDidOrderOffScreenNotification; #endif extern BOOL opaqueTag; @implementation TKApplication(TKWindowEvent) - (void) windowActivation: (NSNotification *) notification |
︙ | ︙ | |||
746 747 748 749 750 751 752 | * *---------------------------------------------------------------------- */ int Tk_MacOSXIsAppInFront(void) { | < < < < < < < < | < < | 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 | * *---------------------------------------------------------------------- */ int Tk_MacOSXIsAppInFront(void) { return ([NSRunningApplication currentApplication].active == true); } #pragma mark TKContentView #import <ApplicationServices/ApplicationServices.h> /* |
︙ | ︙ |
Changes to macosx/tkMacOSXWm.c.
︙ | ︙ | |||
361 362 363 364 365 366 367 | 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); | < < < < < < < < < < | 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 | 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 |
︙ | ︙ | |||
5682 5683 5684 5685 5686 5687 5688 | /* Set background color and opacity of window if those flags are set. */ if (colorName != NULL) { [window setBackgroundColor: colorName]; } if (opaqueTag) { | < < < < | 5672 5673 5674 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 | /* Set background color and opacity of window if those flags are set. */ if (colorName != NULL) { [window setBackgroundColor: colorName]; } if (opaqueTag) { [window setOpaque: opaqueTag]; } [window setDocumentEdited:NO]; wmPtr->window = window; macWin->view = window.contentView; TkMacOSXApplyWindowAttributes(winPtr, window); |
︙ | ︙ | |||
6379 6380 6381 6382 6383 6384 6385 | initial) { NSWindowCollectionBehavior b = NSWindowCollectionBehaviorDefault; if (newAttributes & tkCanJoinAllSpacesAttribute) { b |= NSWindowCollectionBehaviorCanJoinAllSpaces; } else if (newAttributes & tkMoveToActiveSpaceAttribute) { b |= NSWindowCollectionBehaviorMoveToActiveSpace; } | < < < < < < < < < < < < | 6365 6366 6367 6368 6369 6370 6371 6372 6373 6374 6375 6376 6377 6378 6379 6380 6381 6382 6383 6384 | 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)]; } |
︙ | ︙ | |||
6528 6529 6530 6531 6532 6533 6534 | TkWindow *winPtr, NSWindow *window, int fullscreen, Tcl_Interp *interp) { WmInfo *wmPtr = winPtr->wmInfoPtr; int result = TCL_OK, wasFullscreen = (wmPtr->flags & WM_FULLSCREEN); | < < | 6502 6503 6504 6505 6506 6507 6508 6509 6510 6511 6512 6513 6514 6515 6516 | 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. |
︙ | ︙ | |||
6571 6572 6573 6574 6575 6576 6577 | [window setFrame:[window frameRectForContentRect: screenBounds] display:YES]; wmPtr->flags &= ~WM_SYNC_PENDING; } wmPtr->flags |= WM_FULLSCREEN; } | < < < < < < < < < < < < | 6543 6544 6545 6546 6547 6548 6549 6550 6551 6552 6553 6554 6555 6556 6557 6558 6559 6560 6561 6562 6563 6564 6565 6566 | [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), |
︙ | ︙ |