From 70e2e4f2690b416ae889b842d50e4c7e4be8ba5e Mon Sep 17 00:00:00 2001 From: larstvei Date: Tue, 20 Sep 2022 00:51:33 +0200 Subject: [PATCH] Rounded corners in emacs --- flake.nix | 2 +- patches/my-no-titlebar.patch | 22 -------------------- patches/no-titlebar-rounded-corners.patch | 25 +++++++++++++++++++++++ 3 files changed, 26 insertions(+), 23 deletions(-) delete mode 100644 patches/my-no-titlebar.patch create mode 100644 patches/no-titlebar-rounded-corners.patch diff --git a/flake.nix b/flake.nix index 519698a..247a81d 100644 --- a/flake.nix +++ b/flake.nix @@ -65,7 +65,7 @@ patches = [ ./patches/fix-window-role.patch - ./patches/my-no-titlebar.patch + ./patches/no-titlebar-rounded-corners.patch ./patches/system-appearance.patch ]; }); diff --git a/patches/my-no-titlebar.patch b/patches/my-no-titlebar.patch deleted file mode 100644 index a02305a..0000000 --- a/patches/my-no-titlebar.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/src/nsterm.m b/src/nsterm.m -index 44979c7c04e..eee75641f61 100644 ---- a/src/nsterm.m -+++ b/src/nsterm.m -@@ -9021,7 +9021,7 @@ - (instancetype) initWithEmacsFrame: (struct frame *) f - else if (f->tooltip) - styleMask = 0; - else -- styleMask = (NSWindowStyleMaskTitled -+ styleMask = (NSWindowStyleMaskBorderless - | NSWindowStyleMaskResizable - | NSWindowStyleMaskMiniaturizable - | NSWindowStyleMaskClosable); -@@ -9098,7 +9098,7 @@ - (instancetype) initWithEmacsFrame: (struct frame *) f - [self setOpaque:NO]; - - /* toolbar support */ -- [self createToolbar:f]; -+ // [self createToolbar:f]; - - /* macOS Sierra automatically enables tabbed windows. We can't - allow this to be enabled until it's available on a Free system. diff --git a/patches/no-titlebar-rounded-corners.patch b/patches/no-titlebar-rounded-corners.patch new file mode 100644 index 0000000..e97475a --- /dev/null +++ b/patches/no-titlebar-rounded-corners.patch @@ -0,0 +1,25 @@ +diff --git a/src/nsterm.m b/src/nsterm.m +index 44979c7c04e..234a647bade 100644 +--- a/src/nsterm.m ++++ b/src/nsterm.m +@@ -9022,6 +9022,7 @@ - (instancetype) initWithEmacsFrame: (struct frame *) f + styleMask = 0; + else + styleMask = (NSWindowStyleMaskTitled ++ | NSFullSizeContentViewWindowMask + | NSWindowStyleMaskResizable + | NSWindowStyleMaskMiniaturizable + | NSWindowStyleMaskClosable); +@@ -9109,6 +9110,12 @@ - (instancetype) initWithEmacsFrame: (struct frame *) f + #endif + } + ++ [self setTitlebarAppearsTransparent:YES]; ++ [self setTitleVisibility:NSWindowTitleHidden]; ++ [[self standardWindowButton:NSWindowCloseButton] setHidden:YES]; ++ [[self standardWindowButton:NSWindowMiniaturizeButton] setHidden:YES]; ++ [[self standardWindowButton:NSWindowZoomButton] setHidden:YES]; ++ + return self; + } +