all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Help writing a patch to allow transparent backgrounds?
@ 2016-02-09 15:22 Clément Pit--Claudel
  2016-02-10 18:35 ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: Clément Pit--Claudel @ 2016-02-09 15:22 UTC (permalink / raw
  To: Emacs developers

[-- Attachment #1: Type: text/plain, Size: 2023 bytes --]

Hi all,

The only way to get transparency at the moment seems to be with the 'alpha frame parameter. Unfortunately this makes the whole frame transparent, instead of just the background. I'd like to make Emacs only draw text to the screen, without painting a background. I'm on Linux with Gtk3.

I expect that this would require changing the way the background is painted, and changing the way faces are drawn to not add a solid background.

There are examples online:
  * Two StackOverflow questions:
    * https://stackoverflow.com/questions/16832581/how-to-make-a-gtkwindow-background-transparent-on-linux
    * https://stackoverflow.com/questions/22940588/how-do-i-really-make-a-gtk-3-gtklayout-transparent-draw-theme-background
  * A patch to implement this feature in Nemo:
    * https://lists.fedoraproject.org/pipermail/scm-commits/Week-of-Mon-20131230/1165217.html
  * Another patch:
    * https://github.com/IgnorantGuru/spacefm/commit/5e4e148a2e1cf962fdf7dbc776d8d09ad110dbd7
    * https://github.com/IgnorantGuru/spacefm/issues/269

It's not clear to me how to apply the ideas from these pages. I tried two sets of modifications:

* In gtkutil.c (xg_set_widget_bg (struct frame *f, GtkWidget *w, unsigned long pixel)), changing
    bg.alpha = 1.0;
  to
    bg.alpha = 0.0;
* In xterm.c (x_set_cr_source_with_gc_background (struct frame *f, GC gc)), changing
    cairo_set_source_rgb (FRAME_CR_CONTEXT (f), color.red / 65535.0,
                          color.green / 65535.0, color.blue / 65535.0);
  to
    cairo_set_source_rgba (FRAME_CR_CONTEXT (f), color.red / 65535.0,
                           color.green / 65535.0, color.blue / 65535.0, 0.0);
  and compiling with --with-cairo

Both of these changes had the same effect: the background isn't redrawn anymore. The contents of the desktop (behind the Emacs frame) are captured when the frame is created, but never updated after that; instead, whatever gets painted there remains there.

Thanks for the help!
Clément.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-02-13 13:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-09 15:22 Help writing a patch to allow transparent backgrounds? Clément Pit--Claudel
2016-02-10 18:35 ` Eli Zaretskii
2016-02-10 18:46   ` Clément Pit--Claudel
2016-02-10 19:23     ` Eli Zaretskii
2016-02-10 19:36       ` Clément Pit--Claudel
2016-02-13 13:51         ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.