[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Sv: Sv: Sv: Support for background transparency

From: Håkon Flatval
Subject: Sv: Sv: Sv: Support for background transparency
Date: Thu, 20 Jan 2022 19:52:33 +0000

Thanks for the thorough review!

I have adressed your points in this new patch.

I now run a check on the bit depth of the visual in the x_set_cr_source_with_gc_background function. I'm not too happy about this solution, as it involves two more calls to the X API, but perhaps it is acceptable.

I have primarily considered GTK and Cairo when implementing this. Support for other build configurations do not work currently. It will require additional treatment of e.g. the LUCID libs. I have looked a bit on such builds on the side, but currently have not shaped a plan to finish it.

The preprocessor statements are to ensure nothing else is screwed up when using 32-bit visuals.

Again, I appreciate the feedback.

Best regards,

Fra: Po Lu <luangruo@yahoo.com>
Sendt: torsdag 20. januar 2022 01:52
Til: Håkon Flatval <hkon20@hotmail.com>
Kopi: Lars Ingebrigtsen <larsi@gnus.org>; emacs-devel@gnu.org <emacs-devel@gnu.org>
Emne: Re: Sv: Sv: Support for background transparency
Håkon Flatval <hkon20@hotmail.com> writes:

> I have attached a final patch. The only changes from the last one is a
> small conflict resolution I did while rebasing today.
> Is everything ready to have it merged? And also, how does that happen?
> Is the ball in your court, or does it require action on my end?

I see some problems:

> +  /* This prevents GTK from painting the window's background, which
> +     would interfere with transparent background in some environments */
> +  gtk_widget_set_app_paintable (wtop, TRUE);

This must be under the conditional `!HAVE_PGTK'.

> +#if defined (USE_GTK) && defined (USE_CAIRO)

Why only Cairo?  I see no reason this can't work on non-Cairo
configurations, or Cairo configurations built without GTK.

> +  gui_set_alpha_background,

In this case, please add the frame parameter handler to the rest of the
terminal backends, even if it doesn't do anything:

  - pgtkfns.c
  - nsfns.c
  - w32fns.c
  - haikufns.c

> +                         color.green / 65535.0, color.blue / 65535.0, f->alpha_background);
> +
> +  cairo_set_operator (FRAME_CR_CONTEXT (f), CAIRO_OPERATOR_SOURCE);

Cairo on XCB becomes _very_ slow if this is done and the visual has no
alpha channel, so please make this conditional on both alpha being less
than 1.0 and the display's visual actually having an alpha channel.

Also, I see a hunk that only touches indentation and whitespace.  Please
remove the following whitespace-only change:

> +
>        vinfo = XGetVisualInfo (dpy, VisualIDMask | VisualScreenMask,
>                              &vinfo_template, &n_visuals);
> +
>        if (n_visuals <= 0)
> -     fatal ("Can't get proper X visual info");
> +       fatal ("Can't get proper X visual info");

Aside from that, LGTM.  Thanks.

Attachment: gdk-cairo-background-transparency-005.patch
Description: gdk-cairo-background-transparency-005.patch

reply via email to

[Prev in Thread] Current Thread [Next in Thread]