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, Håkon ________________________________ Fra: Po Lu Sendt: torsdag 20. januar 2022 01:52 Til: Håkon Flatval Kopi: Lars Ingebrigtsen ; emacs-devel@gnu.org Emne: Re: Sv: Sv: Support for background transparency Håkon Flatval 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.