Subject: bug#56538: 29.0.50; [PATCH] Colored highlight in Lucid backend

From: Po Lu <[email-masked]>
Date: Thu, 14 Jul 2022 18:34:43 +0800

Manuel Giraud <[email-masked]> writes:

> I have attached a new version of my patch taking your remarks into
> account but I did not remove this comment.  I think it could be useful
> to understand that "top_gc = something_bottom_gc" is not a typo here.

We have the same general pattern (random_gc = random_opposite_gc) in
most of the X code, so it is redundant IMHO.  But I won't insist.

> I have also done the following testing with Xft/cairo/PseudoColor
> combinations:
>
> |-------------+-----------------+-----------------+-----------------+---------------------|
> |             | Xft + cairo     | Xft only        | cairo only      | None                |
> |-------------+-----------------+-----------------+-----------------+---------------------|
> | X Truecolor | ok              | ok              | ok              | ok but with a       |
> |             |                 |                 |                 | default tiny face   |
> |-------------+-----------------+-----------------+-----------------+---------------------|
> | Xephyr      | ok but color    | ok but color    | ok but color    | ok, colors ok, but  |
> | Pseudocolor | not quite right | not quite right | not quite right | with a default tiny |
> |             | around each     | around menu     | around each     | face [fn:2]         |
> |             | glyph [fn:1]    | labels [fn:2]   | glyph [fn:1]    |                     |
> |-------------+-----------------+-----------------+-----------------+---------------------|
>
> * Footnotes
> [fn:1] Aside from the Lucid widget, the emacs buffer is completly
> blank.

Yes, that isn't expected to work, because Cairo is broken.  Also, you
can't build Emacs with both Xft and Cairo, since they're mutually
exclusive.

> [fn:2] This time the emacs buffer is here. tool-bar icons are ugly.

Could you please describe how the colors are "not quite right"?

One last nit:

> +static void
> +draw_highlight (XlwMenuWidget mw,
> +		Window window,
> +		int x,
> +		int y,
> +		int width,
> +		int height)

[...]

>  static void
> -make_shadow_gcs (XlwMenuWidget mw)
> +compute_shadow_colors (XlwMenuWidget mw,
> +		       Pixel *top_color,
> +		       Pixel *bottom_color,
> +		       Boolean *free_top_p,
> +		       Boolean *free_bottom_p,
> +		       Pixmap *top_pixmap,
> +		       Pixmap *bottom_pixmap,
> +		       Pixel fore_color,
> +		       Pixel back_color)

Here and elsewhere new functions are added, the argument list should be
reformatted to not place each argument on its own line.

Thanks.