tumashu / posframe

Pop a posframe (just a child-frame) at point, posframe is a **GNU ELPA** package!
450 stars 58 forks source link

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

Open abbaswasim opened 5 years ago

abbaswasim commented 5 years ago

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?

conao3 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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

gcv commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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

wasimabbas-arm commented 5 years ago

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

abbaswasim commented 5 years ago

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 commented 5 years ago

flick? suggest a screenshot

abbaswasim commented 5 years ago

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

conao3 commented 4 years ago

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

mpereira commented 4 years ago

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

trepca commented 4 years ago

Thanks @mpereira, I have the same problem.

Yanhao commented 4 years ago

experiencing same problem

muffinmad commented 4 years ago

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

Eason0210 commented 4 years ago

I have the same issue at Mac os

kaiwk commented 4 years ago

This issue https://github.com/tumashu/posframe/issues/30#issuecomment-495928777 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 commented 4 years ago

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 commented 4 years ago

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

agzam commented 4 years ago

@muffinmad yay! finally!

mpereira commented 4 years ago

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

mpereira commented 4 years ago

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 commented 4 years ago

@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 commented 4 years ago

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 commented 4 years ago

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: https://github.com/emacs-lsp/lsp-ui/issues/21

pragmat1c1 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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.