LukeSmithxyz / voidrice

My dotfiles (deployed by LARBS)
GNU General Public License v3.0
4.26k stars 1.21k forks source link

[PARTIAL HACK] Transparency issue only with emacs (both nox and gtk) #649

Closed zenny closed 4 years ago

zenny commented 4 years ago

@LukeSmithxyz Thanks a zillion for creating the wonderful script that is rooted to the suckless sources. Hats off to you!

Learning and loving it (though I used https://github.com/PlatinumClaridge/LARBS to install with some tweaks because I am on voidlinux, fyi. Thanks to Adrian @PlatinumClaridge for the fork.)

Everything is working as expected except the transparency of emacs (both nox and gtk).

Fyi, I have attached a screenshot (https://paste.pics/94AIC) which has two gtk apps launched: emacs-gtk3 (spacemacs, invisible) and pidgin (visible). Have tried with different emacs layers like scimax, preclude, purcell and doom, the transparency remained the same specific for this application.

Any inputs? Thanks in advance,

Cheers and stay safe from corona, /z

rpolve commented 4 years ago

Look here and try to use (spacemacs/disable-transparency) in dotspacemacs/user-config, otherwise (add-hook 'after-make-frame-functions 'spacemacs/disable-transparency) might work if you're using daemon mode.

As a last resort, you could try adding this to your config.el:

;; Transparency
(set-frame-parameter (selected-frame) 'alpha '(100))
(add-to-list 'default-frame-alist '(alpha . (100)))
zenny commented 4 years ago

@rpolve Thanks for your input. However, even using the last resort you advised, the transparency issue remained the same only with bwm, but okay with i3, fyi. The latest screenshot is at https://paste.pics/94O6A.

zenny commented 4 years ago

@rpolve Thanks for your input. However, even using the last resort you advised, the transparency issue remained the same only with bwm, but okay with i3, fyi. The latest screenshot is at https://paste.pics/94O6A.

Replying with an update:

I have even tried with disabling transparency (alpha value to 1 instead of 0.8) in ~/.config/Xresources followed by xrdb ~/.config/Xresources, yet every other apps behaves as it should except emacs!

Thanks!

zenny commented 4 years ago

Hi, I made a small lisp hack to toggle transparency. Thanks to emacswiki and emacs channel.

(defun toggle-transparency ()
  (interactive)
  (let ((alpha (frame-parameter nil 'alpha)))
    (if (eq
     (if (numberp alpha)
         alpha
       (cdr alpha)) ; may also be nil
     100)
    (set-frame-parameter nil 'alpha '(85 . 50))
      (set-frame-parameter nil 'alpha '(100 . 100)))))
(global-set-key (kbd "C-c t") 'toggle-transparency)