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

childframe macOS limitation; (black fullscreen, missing border) #30

Open
abbaswasim opened this issue May 25, 2019 · 30 comments
Open

childframe macOS limitation; (black fullscreen, missing border) #30

abbaswasim opened this issue May 25, 2019 · 30 comments

Comments

@abbaswasim
Copy link

abbaswasim commented May 25, 2019

When I run emacs in Mac OS style fullscreen app, occupying the whole screen I see a second black screen. My steps to reproduce.

Run emacs with a temp home dir;
HOME=/tmp/tmp-home emacs tmp.el

M-x package-install RET posframe RET

contents of tmp.el

(require 'posframe)
(defvar my-posframe-buffer " *my-posframe-buffer*")

(with-current-buffer (get-buffer-create my-posframe-buffer)
  (erase-buffer)
  (insert "Hello world"))

(when (posframe-workable-p)
  (posframe-show my-posframe-buffer
                 :position (point)))

M-x eval-buffer

Whenever this is evaluated the first time a new 'posframe' black fullscreen window appears with a flicker and becomes window in focus. I have to do Alt-Tab to go back to emacs and sometimes that doesn't work either and I am stuck at the black window.

next eval-buffer doesn't behave the same but the black window is always there, I am assuming thats the posframe child-window?

emacs-after-eval-buffer

fullscreen-apps

In this image you can see I have two fullscreen apps, the actual Emacs app and the *Minibuf-1*.

This doesn't happen if emacs is not fullscreen though. Not sure if this is a bug in posframe or Emacs child-window?

@abbaswasim abbaswasim changed the title Posframe Mac OS black Fullscreen Posframe Mac OS black fullscreen May 25, 2019
@conao3
Copy link
Contributor

conao3 commented May 25, 2019

Same here.

However, I have given up on dealing with this issue. It's probably a chilled frame problem.
Use maximize instead of full screen. (use (toggle-frame-maximized) instead of (toggle-frame-fullscreen) )

@abbaswasim
Copy link
Author

Ah right. I figured it must be child frame issue but couldn't find any bugs reported there. I do see the flicker issue mentioned https://debbugs.gnu.org/cgi/bugreport.cgi?bug=30699 but that was different. Is it worth submitting an emacs bug?

@conao3
Copy link
Contributor

conao3 commented May 25, 2019

I don't have an opinion on it is worth submitting an emacs bug. Not a few Mac users are in trouble, but I'm not sure if this is Emacs Limitation or MacOS Limitation.

@conao3
Copy link
Contributor

conao3 commented May 25, 2019

Because this package is registered in the ELPA repository, we consider this package to be a common framework for dealing with Child-frame.
For that reason, I think the maintainer of Emacs itself will support it, but I would like to ask @tumashu for his opinion first.

@tumashu
Copy link
Owner

tumashu commented May 25, 2019

I have no opinion, for i do not know the status of emacs in macos, i have no mac for test

@gcv
Copy link

gcv commented May 25, 2019

I had this problem with macOS Emacs built using the ns (official GNU NextStep) port. It does not happen to me with the mac port (https://bitbucket.org/mituharu/emacs-mac/).

@abbaswasim: Which macOS Emacs do you use?

@conao3
Copy link
Contributor

conao3 commented May 25, 2019

I have emacs-26.2 ns ver, and emacs-26.1 mac-port ver. The issue doesn't occur on mac-port ver.
BTW, posframe border in emacs-26.2 ns ver is not shown...
Capture 2019-05-14 21 54 34

@wasimabbas-arm
Copy link

@gcv I use the one from https://emacsformacosx.com I will give the one from mac-port a try.

@wasimabbas-arm
Copy link

@conao3 yes I could never see border either in my version.

@abbaswasim
Copy link
Author

abbaswasim commented May 27, 2019

I have now moved to mac-port. I see improvements already pos-tip finally has a themed face. No posframe flickers. I still don't know if this issue is in posframe or emacs child frames. If anyone knows better let me know I am happy to submit a bug report otherwise I will close the issue.

@tumashu
Copy link
Owner

tumashu commented May 27, 2019

flick? suggest a screenshot

@abbaswasim
Copy link
Author

No more flickers with posframe in mac-port. Sorry there were typos in my previous comment. I have now corrected it.

@conao3
Copy link
Contributor

conao3 commented Dec 28, 2019

@tumashu, please rename this issue to childframe macOS limitation; (black fullscreen, missing border) or something like this.

@abbaswasim abbaswasim changed the title Posframe Mac OS black fullscreen childframe macOS limitation; (black fullscreen, missing border) Dec 28, 2019
@mpereira
Copy link

mpereira commented Feb 14, 2020

I also see this. Emacs 26.3 from EmacsForOSX, macOS 10.14.6, posframe 20200205.928.

@trepca
Copy link

trepca commented Feb 14, 2020

Thanks @mpereira, I have the same problem.

mpereira added a commit to mpereira/.emacs.d that referenced this issue Feb 14, 2020
@Yanhao
Copy link

Yanhao commented Feb 15, 2020

experiencing same problem

@muffinmad
Copy link

I believe child frames must work fine in fullscreen with this commit

@Eason0210
Copy link

I have the same issue at Mac os

@kaiwk
Copy link

kaiwk commented May 4, 2020

This issue #30 (comment) exists not only in child frame, but also in normal frame. I have the same problem when customize helm to display in a separate frame. it seems internal-border face attribute :background doesn't work with emacs(ns), where emacs(mac) is fine.

I tested the code below on emacs(ns), emacs(mac) and emacs on linux(gtk), turns out both emacs(mac) and emacs on linux works fine, but emacs(ns) does not.

So, i think it's a bug of emacs(ns).

;; from https://lists.gnu.org/r/emacs-devel/2019-03/msg00282.html
(defface test
  '((t (:inherit default :background "green")))
  "Face used by the ivy-posframe."
  :group 'ivy-posframe)

(set-face-background
 'internal-border
 (face-attribute 'test :background)
 (make-frame `((internal-border-width . 100)
               (parent-frame . ,(window-frame)))))

(set-face-background
 'internal-border
 (face-attribute 'test :background)
 (make-frame `((internal-border-width . 100))))

@mpereira
Copy link

For the record, I fixed the "black fullscreen" issues by using daviderestivo/homebrew-emacs-head. The "black fullscreen" issue is still reproducible for me in the alternative, d12frosted/homebrew-emacs-plus.

I'm still unable to get posframe borders working though.

macOS 10.15.5
Emacs 28.0.50 (from https://github.com/daviderestivo/homebrew-emacs-head)
ivy-posframe:

Package-Version: 20200528.553
Package-Commit: 44749562a9e68bd43ccaa225b31311476fab1251

@muffinmad
Copy link

@mpereira See this commit. Try to reinstall Emacs and see if internal borders is working.

@agzam
Copy link

agzam commented Sep 25, 2020

@muffinmad yay! finally!

@mpereira
Copy link

mpereira commented Oct 3, 2020

I recompiled Emacs and I get posframe borders now! Thanks for the ping, @muffinmad!

@mpereira
Copy link

mpereira commented Oct 3, 2020

Folks using Linux, are you able to create frames with both an external/outer border and an internal border? I tried to set both in posframe (with some code changes in posframe.el) but was unable to do so on macOS.

My intention was to use the internal border as padding between the frame content and the actual border.

https://www.gnu.org/software/emacs/manual/html_node/elisp/Frame-Layout.html
image

@muffinmad
Copy link

@mpereira I suggest you to ask this question on the emacs-devel mailing list or fill the bugreport via M-x report-emacs-bug.

@wd
Copy link

wd commented Oct 26, 2020

I have installed emacs-head@28 from daviderestivo/homebrew-emacs-head, it fixed the black screen and the border issue. If it's still not work for you, please remove hooks ns-system-appearance-change-functions, just use the raw (load-theme 'xx t) to load theme and try again.

@pragmat1c1
Copy link

I migrated to emacs-mac from emacs-plus to get this fixed, but I still have problems. In emacs-mac I see the border around the child frame, but after some time of usage it disappers and reappers only in new frames.

This problem has been reported also here: emacs-lsp/lsp-ui#21

@pragmat1c1
Copy link

I have installed emacs-head@28 from daviderestivo/homebrew-emacs-head, it fixed the black screen and the border issue.

I just brew installed emacs-head@28 as well, but problem of disappearing child frame border still occurs. I can always fix it by changing a theme, until frame disappers some minutes later again.

@wd
Copy link

wd commented Nov 3, 2020

I just brew installed emacs-head@28 as well, but problem of disappearing child frame border still occurs. I can always fix it by changing a theme, until frame disappers some minutes later again.

It's probably related with your config, maybe you can try to remove most of the configs and test again? Like I have issues with the ns-system-appearance-change-functions, maybe there are some similar things happened to you.

@pragmat1c1
Copy link

Might be the case indeed, but I have a init.el file with 2k lines, and a custom.el file with a few hundred lines of code. Debugging and pinpointing the error will take some time. - But thanks for the hint.

Btw: emacs-head@28 from daviderestivo/homebrew-emacs-head is super fast on my Mac (opening new frames: in an instant). Thank you for the suggestion.

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

No branches or pull requests