Skip to content

Commit

Permalink
Fix tabs drawing over rest of MacVim in macOS 14 Sonoma
Browse files Browse the repository at this point in the history
macOS 14 now defaults clipsToBounds to false, which works in most places
in MacVim but seems to cause issues with PSMTabBar which relies on
clipping to work. Since we are replacing it soon, simply set
clipsToBounds to true for the control.

Fix #1439
  • Loading branch information
ychin committed Oct 12, 2023
1 parent 5098093 commit ba5bae3
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
4 changes: 4 additions & 0 deletions src/MacVim/PSMTabBarControl/source/PSMTabBarControl.m
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ - (void)initAddedProperties
}
[_addTabButton setNeedsDisplay:YES];
}

#if MAC_OS_X_VERSION_MAX_ALLOWED >= 140000
[self setClipsToBounds:YES];
#endif
}

- (id)initWithFrame:(NSRect)frame
Expand Down
9 changes: 7 additions & 2 deletions src/auto/configure
Original file line number Diff line number Diff line change
Expand Up @@ -4960,13 +4960,18 @@ fi
printf %s "checking if SDK is supported... " >&6; }
save_cflags="$CFLAGS"
save_ldflags="$LDFLAGS"
sdkflags="$DEVELOPER_DIR/SDKs/MacOSX$MACSDK"

sdkflags="$DEVELOPER_DIR/SDKs/MacOSX$MACSDK"
if test "x$MACSDK" = "x10.4"; then
sdkflags="$sdkflags""u"
fi
if ! test -d "$sdkflags.sdk"; then
sdkflags="$DEVELOPER_DIR/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$MACSDK"
fi
sdkflags="$sdkflags.sdk -mmacosx-version-min=$MACSDK"

CFLAGS="$CFLAGS -isysroot $sdkflags"
LDFLAGS="$LDFLAGS -Wl,-syslibroot,$sdkflags"
LDFLAGS="$LDFLAGS -isysroot $sdkflags"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */

Expand Down
9 changes: 8 additions & 1 deletion src/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -280,13 +280,20 @@ if test "$vim_cv_uname_output" = Darwin; then
AC_MSG_CHECKING(if SDK is supported)
save_cflags="$CFLAGS"
save_ldflags="$LDFLAGS"

dnl Old location of SDKs and also in Command-Line Tools
sdkflags="$DEVELOPER_DIR/SDKs/MacOSX$MACSDK"
if test "x$MACSDK" = "x10.4"; then
sdkflags="$sdkflags""u"
fi
if ! test -d "$sdkflags.sdk"; then
dnl Location of SDKs in Xcode
sdkflags="$DEVELOPER_DIR/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$MACSDK"
fi
sdkflags="$sdkflags.sdk -mmacosx-version-min=$MACSDK"

CFLAGS="$CFLAGS -isysroot $sdkflags"
LDFLAGS="$LDFLAGS -Wl,-syslibroot,$sdkflags"
LDFLAGS="$LDFLAGS -isysroot $sdkflags"
AC_LINK_IFELSE([AC_LANG_PROGRAM([ ], [ ])],
[ AC_MSG_RESULT([yes])
XCODEFLAGS="$XCODEFLAGS -sdk macosx$MACSDK MACOSX_DEPLOYMENT_TARGET=$MACSDK" ],
Expand Down

0 comments on commit ba5bae3

Please sign in to comment.