~eliasnaur/gio-patches

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
2 2

[PATCH gio v2] app: change background for js

Paulo Melo
Details
Message ID
<20210217084520.99394-1-paulo.durrer.melo@gmail.com>
DKIM signature
missing
Download raw message
Patch: +5 -1
Default window background is white.
JS default background is transparent black.

Signed-off-by: Paulo Melo <paulo.durrer.melo@gmail.com>
---
 app/loop.go | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/app/loop.go b/app/loop.go
index cf00c41..0bf89fe 100644
--- a/app/loop.go
+++ b/app/loop.go
@@ -86,7 +86,11 @@ func (l *renderLoop) renderLoop(ctx window.Context) error {
				l.refreshErr <- ctx.MakeCurrent()
			case frame := <-l.frames:
				ctx.Lock()
				g.Clear(color.NRGBA{A: 0xff, R: 0xff, G: 0xff, B: 0xff})
				if runtime.GOOS == "js" {
					g.Clear(color.NRGBA{A: 0x00, R: 0x00, G: 0x00, B: 0x00})
				} else {
					g.Clear(color.NRGBA{A: 0xff, R: 0xff, G: 0xff, B: 0xff})
				}
				g.Collect(frame.viewport, frame.ops)
				// Signal that we're done with the frame ops.
				l.ack <- struct{}{}
-- 
2.26.2

[gio/patches] build failed

builds.sr.ht
Details
Message ID
<C9BOPT7UKQZH.3FKULGPR7A8FV@cirno2>
In-Reply-To
<20210217084520.99394-1-paulo.durrer.melo@gmail.com> (view parent)
DKIM signature
missing
Download raw message
gio/patches: FAILED in 20m26s

[app: change background for js][0] v2 from [Paulo Melo][1]

[0]: https://lists.sr.ht/~eliasnaur/gio-patches/patches/20329
[1]: paulo.durrer.melo@gmail.com

✗ #428457 FAILED  gio/patches/linux.yml   https://builds.sr.ht/~eliasnaur/job/428457
✓ #428456 SUCCESS gio/patches/freebsd.yml https://builds.sr.ht/~eliasnaur/job/428456
✓ #428455 SUCCESS gio/patches/apple.yml   https://builds.sr.ht/~eliasnaur/job/428455
✓ #428458 SUCCESS gio/patches/openbsd.yml https://builds.sr.ht/~eliasnaur/job/428458
Details
Message ID
<C9C3B1BOVH5K.1KISSHESNIV0G@themachine>
In-Reply-To
<20210217084520.99394-1-paulo.durrer.melo@gmail.com> (view parent)
DKIM signature
fail
Download raw message
DKIM signature: fail
Thanks. Does this change solve your issue?

On Wed Feb 17, 2021 at 08:45, Paulo Melo wrote:
> Default window background is white.
> JS default background is transparent black.
>
> Signed-off-by: Paulo Melo <paulo.durrer.melo@gmail.com>
> ---
>  app/loop.go | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/app/loop.go b/app/loop.go
> index cf00c41..0bf89fe 100644
> --- a/app/loop.go
> +++ b/app/loop.go
> @@ -86,7 +86,11 @@ func (l *renderLoop) renderLoop(ctx window.Context) error {
>  				l.refreshErr <- ctx.MakeCurrent()
>  			case frame := <-l.frames:
>  				ctx.Lock()
> -				g.Clear(color.NRGBA{A: 0xff, R: 0xff, G: 0xff, B: 0xff})
> +				if runtime.GOOS == "js" {

Needs a comment, otherwise the differing clear color makes little sense:

// Use transparent black when Gio is embedded, to allow mixing of Gio and
// foreign content below.

> +					g.Clear(color.NRGBA{A: 0x00, R: 0x00, G: 0x00, B: 0x00})
> +				} else {
> +					g.Clear(color.NRGBA{A: 0xff, R: 0xff, G: 0xff, B: 0xff})
> +				}
>  				g.Collect(frame.viewport, frame.ops)
>  				// Signal that we're done with the frame ops.
>  				l.ack <- struct{}{}
> -- 
> 2.26.2
Reply to thread Export thread (mbox)