Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update breaks app appearance #82

Closed
frankjonen opened this issue May 29, 2018 · 35 comments
Closed

Update breaks app appearance #82

frankjonen opened this issue May 29, 2018 · 35 comments

Comments

@frankjonen
Copy link

With the option to turn off the frame title bars gone we have to resort to specifying it in the init.el where it gets loaded AFTER the app has already launched, not at launch. This would be sort of acceptable if it would work at all but after some searching this part of Emacs 26 was never finished. All it does is turn off the title bar, leaving a bigass gap on the screen top area. Also this doesn't seem to be documented as people find this stuff out by accident it seems.

Also I tried to fix it by stepping back one version and got this error message.

brew search emacs-plus
==> Searching local taps...
d12frosted/emacs-plus/emacs-plus ✔
==> Searching taps on GitHub...
==> Searching blacklisted, migrated and deleted formulae...

Is there some special trick to step back to working versions?

@d12frosted d12frosted added this to the Emacs 26.1 milestone May 29, 2018
@mclearc
Copy link

mclearc commented May 29, 2018

I'm using 26.1 on High Sierra and it works fine for me. The code I'm using is:

(when (memq window-system '(mac ns))
  (add-to-list 'default-frame-alist '(ns-appearance . dark))
  (add-to-list 'default-frame-alist '(ns-transparent-titlebar . t)))

@d12frosted
Copy link
Owner

@mclearc yeah, exactly

@frankjonen sorry for inconvenience, I've updated the readme and added few words to caveats section to reflect required actions (52192f0).

@frankjonen
Copy link
Author

@mclearc not at all similar. This just darkens the title bar and sets the text to white somewhen after the application has already launched. This just skins the window. --with-no-title-bars removed them.

@d12frosted the workaround you're noting in the caveats to get the exact same behaviour, doesn't yield a similar result. It just darkens the title bar and leaves the text black.

The behaviour that --with-no-title-bars brought was exactly that. No title bars. The frame started right below the menubar and either filled the entire screen or just left stuff of windows that wasn't necessary for Emacs.

@d12frosted
Copy link
Owner

@frankjonen Ok, possibly that was a bad decision to remove this option. Sorry for that. I will look into it ASAP, but I doubt that it'll happen before the weekends.

If someone wants to step in, you know, PRs are WARMLY welcome! 😸

@CestDiego
Copy link

I too support this happening. I have had great experience with -no-title-bar. It allows things like these to happen:

img

!img2

@d12frosted
Copy link
Owner

Ok. It seems that Emacs 26.1 already has all the necessary stuff to make it working. As @frankjonen said, it's not documented (or at least, I could not find any relevant documentation). After some trial I've managed to make it working by adding following code to the beginning of my init.el file:

(add-to-list 'default-frame-alist '(undecorated . t))
(add-to-list 'default-frame-alist '(fullscreen . maximized))

@frankjonen and @CestDiego, could you please check if it works for you? 😸 If not, please checkout what other options are in default-frame-alist and let me know if you are using HEAD or 26.1.

@frankjonen
Copy link
Author

It's a well-meaning setting (and one that I had commented on before). Unfortunately it leaves you with a gap where the title bar used to be and no way to grab on to the window to scale it up vertically. Probably could do it with an AppleScript (example on my Pastebin) but I have no idea how to trigger it from the init.el / spacemacs.el setup.

Using normal installation.

In Emacs Preferences I've searched high and low for anything remotely resembling title bar related stuff. Absolutely nothing.

@d12frosted
Copy link
Owner

@frankjonen
If I add only (add-to-list 'default-frame-alist '(undecorated . t)) I see the gap. Once I add (add-to-list 'default-frame-alist '(fullscreen . maximized)) the gap goes away. Do you set fullscreen to maximized?

@d12frosted
Copy link
Owner

BTW, you didn't specify any configurations you are making in any of your comments. It would be super helpful if you said in the first comment that you tried setting undecorated to t.

@frankjonen
Copy link
Author

Oh right. I sort of implied neither of them making a difference to the gapishness.

  • undecorated . t = gap
  • undecorated . t + fullscreen . maximized = gap

No --HEAD setup, just the normal one.

@CestDiego
Copy link

CestDiego commented Jun 5, 2018

@d12frosted as you can see in this github issue: https://github.com/koekeishiya/chunkwm/issues/265#issuecomment-394801114

This has problems with the chunkwm window manager. It would be better if we had the no-title-bar option back. Would this just be a revert on the commit that removed it? I'm not familiar with the quirks of this but I would love to help make this happen.

@d12frosted
Copy link
Owner

Thanks for checking @frankjonen and @CestDiego

Would this just be a revert on the commit that removed it?

@CestDiego unfortunately no, as the patch behind the toggle has no sense on 26.1+. That patch was an experimental hack until 26.1 comes out. Right now Emacs has a means of creating undecorated frames, but it seems to behave differently. Quick look at nsterm.m didn't help to understand me why.

Since I don't use this option I didn't notice it before we've spent some time trying to understand what's wrong.

Anyways, I'll try to take care of this issue during this week.

@d12frosted d12frosted removed this from the Emacs 26.1 milestone Jun 6, 2018
@CestDiego
Copy link

CestDiego commented Jun 6, 2018 via email

@d12frosted
Copy link
Owner

I've tried adding several changes to nterm.m, but it didn't help. Following the thread I've started on mailing list, gonna file a bug, cause I don't know why it doesn't allow to resize even after the changes.

@CestDiego
Copy link

CestDiego commented Jun 11, 2018 via email

@d12frosted
Copy link
Owner

Yes, I thought about providing emacs-plus@25 formulae for you guys. Looks like issue with title bar won't be fixed ASAP.

@d12frosted
Copy link
Owner

Short update:

$ brew install emacs-plus@25 [all-your-favourite-options]

@CestDiego
Copy link

That works. Thanks. However I hope that we can eventually use emacs 26 T_T

@d12frosted
Copy link
Owner

However I hope that we can eventually use emacs 26 T_T

Haha. I understand. Though right now I can't promise fast resolution for this issue on Emacs 26.1.

@d12frosted
Copy link
Owner

Good news everyone!

I've pushed a patch that does borderless Emacs (fe4dc95). The option is called --with-no-titlebar. And it's even more experimental than before :D

Please note, that I highly advice against using this option, instead use ns-transparent-titlebar frame setting. I'll update readme file soon.

@CestDiego @frankjonen

@CestDiego
Copy link

@d12frosted I get this:
image

@CestDiego
Copy link

@d12frosted this is what I get:

~
➜ brew install emacs-plus --with-no-titlebar
==> Installing emacs-plus from d12frosted/emacs-plus
==> Downloading https://raw.githubusercontent.com/d12frosted/homebrew-emacs-plus/master/patches/borderless-frame-on-macOS.patch
Already downloaded: /Users/dberrocal/Library/Caches/Homebrew/emacs-plus-frame.patch
==> Downloading https://gist.githubusercontent.com/aatxe/260261daf70865fbf1749095de9172c5/raw/214b50c62450be1cbee9f11cecba846dd66c7d06/patch-multicolor-font.diff
Already downloaded: /Users/dberrocal/Library/Caches/Homebrew/emacs-plus--patch-5af2587e986db70999d1a791fca58df027ccbabd75f45e4a2af1602c75511a8c.diff
==> Downloading https://lists.gnu.org/archive/html/emacs-devel/2018-02/txtshOHDg6PmW.txt
Already downloaded: /Users/dberrocal/Library/Caches/Homebrew/emacs-plus--patch-ba9d9555256f91409c4a7b233c36119514ba3d61f4acdb15d7d017db0fb9f00c.txt
==> Downloading https://lists.gnu.org/archive/html/emacs-devel/2018-02/txtzUNqW9dNDT.txt
Already downloaded: /Users/dberrocal/Library/Caches/Homebrew/emacs-plus--patch-500b437c3ed03e0ef1341b800919aa85cc9a9f13ecbaea8d5fc67bf74510317a.txt
==> Patching
==> Applying patch-multicolor-font.diff
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/src/macfont.m b/src/macfont.m
|index 0445628..c9082a5 100644
|--- a/src/macfont.m
|+++ b/src/macfont.m
--------------------------
No file to patch.  Skipping patch.
1 out of 1 hunk ignored
Error: Failure while executing: patch -g 0 -f -p1 -i /private/tmp/emacs-plus--patch-20180612-18212-rrfvli/patch-multicolor-font.diff

@d12frosted
Copy link
Owner

d12frosted commented Jun 12, 2018 via email

@CestDiego
Copy link

It does not fail

@d12frosted
Copy link
Owner

Ah, my apologises. I made a mistake in a formula that I pushed. Was creating patch and applying it on two different machines and didn't copy paste everything.

I was planning also to add a test for this.

@CestDiego
Copy link

CestDiego commented Jun 12, 2018 via email

@d12frosted
Copy link
Owner

d12frosted commented Jun 13, 2018 via email

@CestDiego
Copy link

CestDiego commented Jun 13, 2018 via email

@d12frosted
Copy link
Owner

Glad to hear 😸

So I am closing this issue. If there is something wrong with current implementation, just let me know (either in this issue or fire new one).

@benjamin-rood
Copy link

Failing for me with --HEAD:

==> Installing d12frosted/emacs-plus/emacs-plus --HEAD --with-no-titlebar
==> Cloning https://github.com/emacs-mirror/emacs.git
Cloning into '/Users/br/Library/Caches/Homebrew/emacs-plus--git'...
Checking out files: 100% (3897/3897), done.
==> Checking out branch master
Already on 'master'
Your branch is up to date with 'origin/master'.
==> Downloading https://raw.githubusercontent.com/d12frosted/homebrew-emacs-plus/master/patches/borde
######################################################################## 100.0%
==> Downloading https://gist.githubusercontent.com/aatxe/260261daf70865fbf1749095de9172c5/raw/214b50c
######################################################################## 100.0%
==> Downloading https://github.com/emacs-mirror/emacs/compare/scratch/ns-drawing.patch
######################################################################## 100.0%
==> Downloading http://emacs.1067599.n8.nabble.com/attachment/465838/0/0001-Fix-crash-on-flush-to-dis
######################################################################## 100.0%
==> Patching
==> Applying borderless-frame-on-macOS.patch
patching file src/nsterm.m
Hunk #1 FAILED at 425.
Hunk #2 FAILED at 1888.
Hunk #3 FAILED at 6842.
Hunk #4 succeeded at 7328 (offset 110 lines).
Hunk #5 succeeded at 7363 (offset 110 lines).
3 out of 5 hunks FAILED -- saving rejects to file src/nsterm.m.rej
Error: undefined method `shelljoin' for nil:NilClass
Please report this bug:
  https://docs.brew.sh/Troubleshooting
/usr/local/Homebrew/Library/Homebrew/exceptions.rb:547:in `initialize'
/usr/local/Homebrew/Library/Homebrew/utils/fork.rb:7:in `new'
/usr/local/Homebrew/Library/Homebrew/utils/fork.rb:7:in `rewrite_child_error'
/usr/local/Homebrew/Library/Homebrew/utils/fork.rb:84:in `block (3 levels) in safe_fork'
/usr/local/Homebrew/Library/Homebrew/utils.rb:402:in `ignore_interrupts'
/usr/local/Homebrew/Library/Homebrew/utils/fork.rb:60:in `block (2 levels) in safe_fork'
/usr/local/Homebrew/Library/Homebrew/utils/fork.rb:29:in `open'
/usr/local/Homebrew/Library/Homebrew/utils/fork.rb:29:in `block in safe_fork'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/tmpdir.rb:89:in `mktmpdir'
/usr/local/Homebrew/Library/Homebrew/utils/fork.rb:28:in `safe_fork'
/usr/local/Homebrew/Library/Homebrew/formula_installer.rb:729:in `build'
/usr/local/Homebrew/Library/Homebrew/formula_installer.rb:317:in `install'
/usr/local/Homebrew/Library/Homebrew/cmd/install.rb:325:in `install_formula'
/usr/local/Homebrew/Library/Homebrew/cmd/install.rb:256:in `block in install'
/usr/local/Homebrew/Library/Homebrew/cmd/install.rb:254:in `each'
/usr/local/Homebrew/Library/Homebrew/cmd/install.rb:254:in `install'
/usr/local/Homebrew/Library/Homebrew/brew.rb:91:in `<main>'

This is with a completely fresh install of homebrew, fwiw.

@d12frosted
Copy link
Owner

Please try without --with-no-titlebar. I will take a look why this one fails.

@benjamin-rood
Copy link

benjamin-rood commented Sep 26, 2018

@d12frosted Hi Boris without the --with-no-titlebar flag it installs fine from --HEAD. I'm reporting/bringing it up for your information. 😃

P.S. If I omit the --HEAD flag, --with-no-titlebar patches successfully, I'm doing it right this second.

@frankjonen
Copy link
Author

Oh totally forgot about this. The non --HEAD version with no titlebar works fine now. Had to re-install recently because my Homebrew install fk'd itself into oblivion.

Thanks @d12frosted for coming through with this.

@d12frosted
Copy link
Owner

@benjamin-rood nice! I haven't checked why --with-no-titlebar fails, but I will take a look.

@frankjonen 👌 thanks for checking 😸

P. S. I hope these fixes for macOS Mojave will be merged soon into master branch of Emacs.

@d12frosted
Copy link
Owner

@benjamin-rood --with-no-titlebar should work now on Mojave HEAD. Note that building on Mojave without HEAD is not supported yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants