* bug#73401: [PATCH] Make window dividers and internal border respect alpha background
@ 2024-09-20 18:25 Garklein
2024-09-28 10:20 ` Eli Zaretskii
0 siblings, 1 reply; 7+ messages in thread
From: Garklein @ 2024-09-20 18:25 UTC (permalink / raw)
To: 73401
[-- Attachment #1: Type: text/plain, Size: 305 bytes --]
Hello,
I'm using EXWM with thick window dividers and internal borders. These
areas currently aren't affected by the alpha-background frame
parameter, which looks very ugly. I can't think of any reasons why
anyone would want this, so I think it's just an oversight. This patch
just makes them respect it.
[-- Attachment #2: dividers-border-transparent.patch --]
[-- Type: text/x-patch, Size: 2772 bytes --]
diff --git a/src/xterm.c b/src/xterm.c
index 0c20d38..7f665d8 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -7497,13 +7497,13 @@ x_draw_window_divider (struct window *w, int x0, int x1, int y0, int y1)
{
XSetForeground (display, f->output_data.x->normal_gc, color_first);
x_fill_rectangle (f, f->output_data.x->normal_gc,
- x0, y0, 1, y1 - y0, false);
+ x0, y0, 1, y1 - y0, true);
XSetForeground (display, f->output_data.x->normal_gc, color);
x_fill_rectangle (f, f->output_data.x->normal_gc,
- x0 + 1, y0, x1 - x0 - 2, y1 - y0, false);
+ x0 + 1, y0, x1 - x0 - 2, y1 - y0, true);
XSetForeground (display, f->output_data.x->normal_gc, color_last);
x_fill_rectangle (f, f->output_data.x->normal_gc,
- x1 - 1, y0, 1, y1 - y0, false);
+ x1 - 1, y0, 1, y1 - y0, true);
}
else if ((x1 - x0 > y1 - y0) && (y1 - y0 >= 3))
/* A horizontal divider, at least three pixels high: Draw first and
@@ -7511,13 +7511,13 @@ x_draw_window_divider (struct window *w, int x0, int x1, int y0, int y1)
{
XSetForeground (display, f->output_data.x->normal_gc, color_first);
x_fill_rectangle (f, f->output_data.x->normal_gc,
- x0, y0, x1 - x0, 1, false);
+ x0, y0, x1 - x0, 1, true);
XSetForeground (display, f->output_data.x->normal_gc, color);
x_fill_rectangle (f, f->output_data.x->normal_gc,
- x0, y0 + 1, x1 - x0, y1 - y0 - 2, false);
+ x0, y0 + 1, x1 - x0, y1 - y0 - 2, true);
XSetForeground (display, f->output_data.x->normal_gc, color_last);
x_fill_rectangle (f, f->output_data.x->normal_gc,
- x0, y1 - 1, x1 - x0, 1, false);
+ x0, y1 - 1, x1 - x0, 1, true);
}
else
{
@@ -7525,7 +7525,7 @@ x_draw_window_divider (struct window *w, int x0, int x1, int y0, int y1)
differently. */
XSetForeground (display, f->output_data.x->normal_gc, color);
x_fill_rectangle (f, f->output_data.x->normal_gc,
- x0, y0, x1 - x0, y1 - y0, false);
+ x0, y0, x1 - x0, y1 - y0, true);
}
}
@@ -7732,11 +7732,11 @@ x_clear_under_internal_border (struct frame *f)
GC gc = f->output_data.x->normal_gc;
XSetForeground (display, gc, color);
- x_fill_rectangle (f, gc, 0, margin, width, border, false);
- x_fill_rectangle (f, gc, 0, 0, border, height, false);
- x_fill_rectangle (f, gc, width - border, 0, border, height, false);
+ x_fill_rectangle (f, gc, 0, margin, width, border, true);
+ x_fill_rectangle (f, gc, 0, 0, border, height, true);
+ x_fill_rectangle (f, gc, width - border, 0, border, height, true);
x_fill_rectangle (f, gc, 0, height - bottom_margin - border,
- width, border, false);
+ width, border, true);
XSetForeground (display, gc, FRAME_FOREGROUND_PIXEL (f));
}
else
^ permalink raw reply related [flat|nested] 7+ messages in thread
* bug#73401: [PATCH] Make window dividers and internal border respect alpha background
2024-09-20 18:25 bug#73401: [PATCH] Make window dividers and internal border respect alpha background Garklein
@ 2024-09-28 10:20 ` Eli Zaretskii
2024-09-28 10:40 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2024-09-28 10:20 UTC (permalink / raw)
To: Garklein, Po Lu; +Cc: 73401
> From: Garklein <garklein97@gmail.com>
> Date: Fri, 20 Sep 2024 14:25:14 -0400
>
> I'm using EXWM with thick window dividers and internal borders. These
> areas currently aren't affected by the alpha-background frame
> parameter, which looks very ugly. I can't think of any reasons why
> anyone would want this, so I think it's just an oversight. This patch
> just makes them respect it.
Thanks. Po Lu, any comments?
> diff --git a/src/xterm.c b/src/xterm.c
> index 0c20d38..7f665d8 100644
> --- a/src/xterm.c
> +++ b/src/xterm.c
> @@ -7497,13 +7497,13 @@ x_draw_window_divider (struct window *w, int x0, int x1, int y0, int y1)
> {
> XSetForeground (display, f->output_data.x->normal_gc, color_first);
> x_fill_rectangle (f, f->output_data.x->normal_gc,
> - x0, y0, 1, y1 - y0, false);
> + x0, y0, 1, y1 - y0, true);
> XSetForeground (display, f->output_data.x->normal_gc, color);
> x_fill_rectangle (f, f->output_data.x->normal_gc,
> - x0 + 1, y0, x1 - x0 - 2, y1 - y0, false);
> + x0 + 1, y0, x1 - x0 - 2, y1 - y0, true);
> XSetForeground (display, f->output_data.x->normal_gc, color_last);
> x_fill_rectangle (f, f->output_data.x->normal_gc,
> - x1 - 1, y0, 1, y1 - y0, false);
> + x1 - 1, y0, 1, y1 - y0, true);
> }
> else if ((x1 - x0 > y1 - y0) && (y1 - y0 >= 3))
> /* A horizontal divider, at least three pixels high: Draw first and
> @@ -7511,13 +7511,13 @@ x_draw_window_divider (struct window *w, int x0, int x1, int y0, int y1)
> {
> XSetForeground (display, f->output_data.x->normal_gc, color_first);
> x_fill_rectangle (f, f->output_data.x->normal_gc,
> - x0, y0, x1 - x0, 1, false);
> + x0, y0, x1 - x0, 1, true);
> XSetForeground (display, f->output_data.x->normal_gc, color);
> x_fill_rectangle (f, f->output_data.x->normal_gc,
> - x0, y0 + 1, x1 - x0, y1 - y0 - 2, false);
> + x0, y0 + 1, x1 - x0, y1 - y0 - 2, true);
> XSetForeground (display, f->output_data.x->normal_gc, color_last);
> x_fill_rectangle (f, f->output_data.x->normal_gc,
> - x0, y1 - 1, x1 - x0, 1, false);
> + x0, y1 - 1, x1 - x0, 1, true);
> }
> else
> {
> @@ -7525,7 +7525,7 @@ x_draw_window_divider (struct window *w, int x0, int x1, int y0, int y1)
> differently. */
> XSetForeground (display, f->output_data.x->normal_gc, color);
> x_fill_rectangle (f, f->output_data.x->normal_gc,
> - x0, y0, x1 - x0, y1 - y0, false);
> + x0, y0, x1 - x0, y1 - y0, true);
> }
> }
>
> @@ -7732,11 +7732,11 @@ x_clear_under_internal_border (struct frame *f)
> GC gc = f->output_data.x->normal_gc;
>
> XSetForeground (display, gc, color);
> - x_fill_rectangle (f, gc, 0, margin, width, border, false);
> - x_fill_rectangle (f, gc, 0, 0, border, height, false);
> - x_fill_rectangle (f, gc, width - border, 0, border, height, false);
> + x_fill_rectangle (f, gc, 0, margin, width, border, true);
> + x_fill_rectangle (f, gc, 0, 0, border, height, true);
> + x_fill_rectangle (f, gc, width - border, 0, border, height, true);
> x_fill_rectangle (f, gc, 0, height - bottom_margin - border,
> - width, border, false);
> + width, border, true);
> XSetForeground (display, gc, FRAME_FOREGROUND_PIXEL (f));
> }
> else
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#73401: [PATCH] Make window dividers and internal border respect alpha background
2024-09-28 10:20 ` Eli Zaretskii
@ 2024-09-28 10:40 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-29 19:37 ` Garklein
0 siblings, 1 reply; 7+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-09-28 10:40 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 73401, Garklein
Eli Zaretskii <eliz@gnu.org> writes:
>> From: Garklein <garklein97@gmail.com>
>> Date: Fri, 20 Sep 2024 14:25:14 -0400
>>
>> I'm using EXWM with thick window dividers and internal borders. These
>> areas currently aren't affected by the alpha-background frame
>> parameter, which looks very ugly. I can't think of any reasons why
>> anyone would want this, so I think it's just an oversight. This patch
>> just makes them respect it.
>
> Thanks. Po Lu, any comments?
We agreed in a previous bug report that this is not an oversight, since
they are borders, not backgrounds.
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#73401: [PATCH] Make window dividers and internal border respect alpha background
2024-09-28 10:40 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-09-29 19:37 ` Garklein
2024-10-12 11:23 ` Eli Zaretskii
0 siblings, 1 reply; 7+ messages in thread
From: Garklein @ 2024-09-29 19:37 UTC (permalink / raw)
To: Po Lu; +Cc: 73401, Eli Zaretskii
Would it be possible to have an option to make them transparent? It
makes it look a lot better for EXWM.
On Sat, Sep 28, 2024 at 6:40 AM Po Lu <luangruo@yahoo.com> wrote:
>
> Eli Zaretskii <eliz@gnu.org> writes:
>
> >> From: Garklein <garklein97@gmail.com>
> >> Date: Fri, 20 Sep 2024 14:25:14 -0400
> >>
> >> I'm using EXWM with thick window dividers and internal borders. These
> >> areas currently aren't affected by the alpha-background frame
> >> parameter, which looks very ugly. I can't think of any reasons why
> >> anyone would want this, so I think it's just an oversight. This patch
> >> just makes them respect it.
> >
> > Thanks. Po Lu, any comments?
>
> We agreed in a previous bug report that this is not an oversight, since
> they are borders, not backgrounds.
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#73401: [PATCH] Make window dividers and internal border respect alpha background
2024-09-29 19:37 ` Garklein
@ 2024-10-12 11:23 ` Eli Zaretskii
2024-10-13 0:38 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2024-10-12 11:23 UTC (permalink / raw)
To: luangruo, Garklein; +Cc: 73401
Ping! Po Lu, can you answer the OP?
> From: Garklein <garklein97@gmail.com>
> Date: Sun, 29 Sep 2024 15:37:58 -0400
> Cc: Eli Zaretskii <eliz@gnu.org>, 73401@debbugs.gnu.org
>
> Would it be possible to have an option to make them transparent? It
> makes it look a lot better for EXWM.
>
> On Sat, Sep 28, 2024 at 6:40 AM Po Lu <luangruo@yahoo.com> wrote:
> >
> > Eli Zaretskii <eliz@gnu.org> writes:
> >
> > >> From: Garklein <garklein97@gmail.com>
> > >> Date: Fri, 20 Sep 2024 14:25:14 -0400
> > >>
> > >> I'm using EXWM with thick window dividers and internal borders. These
> > >> areas currently aren't affected by the alpha-background frame
> > >> parameter, which looks very ugly. I can't think of any reasons why
> > >> anyone would want this, so I think it's just an oversight. This patch
> > >> just makes them respect it.
> > >
> > > Thanks. Po Lu, any comments?
> >
> > We agreed in a previous bug report that this is not an oversight, since
> > they are borders, not backgrounds.
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#73401: [PATCH] Make window dividers and internal border respect alpha background
2024-10-12 11:23 ` Eli Zaretskii
@ 2024-10-13 0:38 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-23 21:56 ` Garklein
0 siblings, 1 reply; 7+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-10-13 0:38 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 73401, Garklein
Eli Zaretskii <eliz@gnu.org> writes:
> Ping! Po Lu, can you answer the OP?
>
>> From: Garklein <garklein97@gmail.com>
>> Date: Sun, 29 Sep 2024 15:37:58 -0400
>> Cc: Eli Zaretskii <eliz@gnu.org>, 73401@debbugs.gnu.org
>>
>> Would it be possible to have an option to make them transparent? It
>> makes it look a lot better for EXWM.
Yes, but I won't be implementing it myself till Emacs 30 is released.
In the interim, patches welcome.
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#73401: [PATCH] Make window dividers and internal border respect alpha background
2024-10-13 0:38 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-11-23 21:56 ` Garklein
0 siblings, 0 replies; 7+ messages in thread
From: Garklein @ 2024-11-23 21:56 UTC (permalink / raw)
To: Po Lu; +Cc: 73401, Eli Zaretskii
[-- Attachment #1: Type: text/plain, Size: 1164 bytes --]
Here is a patch that adds this option as a frame parameter.
I hope I did everything correctly, but I have never worked with the
Emacs C source before, so I probably made some mistakes in style or
logic.
Also, should this be factored out so that `border-alpha-background' is
its own parameter? In that case, a lot of functions would need to be
changed (the `respect-alpha-background' parameter in many xterm.c
functions would probably be changed to just a `double alpha` or
something like that). I am up for that, but I'm not sure if it would
be a helpful change.
Please let me know how it looks!
On Sat, Oct 12, 2024 at 8:38 PM Po Lu <luangruo@yahoo.com> wrote:
>
> Eli Zaretskii <eliz@gnu.org> writes:
>
> > Ping! Po Lu, can you answer the OP?
> >
> >> From: Garklein <garklein97@gmail.com>
> >> Date: Sun, 29 Sep 2024 15:37:58 -0400
> >> Cc: Eli Zaretskii <eliz@gnu.org>, 73401@debbugs.gnu.org
> >>
> >> Would it be possible to have an option to make them transparent? It
> >> makes it look a lot better for EXWM.
>
> Yes, but I won't be implementing it myself till Emacs 30 is released.
> In the interim, patches welcome.
[-- Attachment #2: borders-respect-alpha-background.patch --]
[-- Type: application/x-patch, Size: 12540 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2024-11-23 21:56 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-20 18:25 bug#73401: [PATCH] Make window dividers and internal border respect alpha background Garklein
2024-09-28 10:20 ` Eli Zaretskii
2024-09-28 10:40 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-29 19:37 ` Garklein
2024-10-12 11:23 ` Eli Zaretskii
2024-10-13 0:38 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-23 21:56 ` Garklein
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).