railwaycat / homebrew-emacsmacport

Emacs mac port formulae for the Homebrew package manager
BSD 2-Clause "Simplified" License
1.66k stars 125 forks source link

Support for alpha-background for transparency? #376

Open jasonmj opened 4 months ago

jasonmj commented 4 months ago

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.

brosasaki commented 3 months ago

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?

jasonmj commented 3 months ago

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
jado4810 commented 2 months ago

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))
jasonmj commented 1 month ago

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?

jado4810 commented 1 month ago

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.