homebrew-emacsmacport icon indicating copy to clipboard operation
homebrew-emacsmacport copied to clipboard

Support for alpha-background for transparency?

Open jasonmj opened this issue 11 months ago • 6 comments

Perhaps I'm missing something, but it seems like setting frame parameter alpha-background do not produce the desired effect of applying transparency to the frame background. What I want to do is display a posframe with alpha-background set to 80%. I've had no trouble with this Emacs plus for macOS or standard Emacs for Linux, so I know my config is not the issue.

Edit: the frame parameter I need support for is alpha rather than alpha-background, see comments below.

jasonmj avatar Mar 12 '24 13:03 jasonmj

This port implements background transparency in the "mac way" (frosted glass look) by setting the :stipple attribute to "alpha:ALPHA" where alpha is between 0.0 and 1.0. Check the info pages linked in the "Mac" customization group.

More importantly, how are you getting alpha-background to work on Emacs plus? I've always been bothered by how I have to choose between alpha-background support and better window decoration management between the two, but it seems you have found a way?

brosasaki avatar Apr 10 '24 22:04 brosasaki

how are you getting alpha-background to work on Emacs plus?

I'm sorry, I wasn't using the alpha-background frame parameter. It was just alpha. I checked my git history and saw that it was (alpha . 85) I had used as a frame parameter for my vertico posframe.

Testing now, I get transparency in Emacs Plus: image

Unfortunately, the same is not true in Emacs Mac: image

jasonmj avatar Apr 16 '24 01:04 jasonmj

Seems to work frame parameter like: (alpha . (100 85)).

I use below on my init.el:

(setq default-frame-alist
      (append '((background-color . "#f0f0f0")
		(cursor-color     . "#d00000")
		(height           . 40)
		(alpha            . (100 85)))
	      default-frame-alist))

jado4810 avatar May 14 '24 14:05 jado4810

Seems to work frame parameter like: (alpha . (100 85)).

I use below on my init.el:

(setq default-frame-alist
      (append '((background-color . "#f0f0f0")
		(cursor-color     . "#d00000")
		(height           . 40)
		(alpha            . (100 85)))
	      default-frame-alist))

I wish that worked for me, but it does not. Are you able to get the effect while using a posframe or something similar?

jasonmj avatar May 22 '24 20:05 jasonmj

Sorry I didn't understand your intent.

With that configuration, the transparency of the child posframe is the same as that of the parent frame. Might have to set alpha for child popup frame, however I have not found a way so far.

jado4810 avatar May 30 '24 05:05 jado4810