Skip to content

Commit

Permalink
Fix transparent borders
Browse files Browse the repository at this point in the history
When terminal has transparency then its borders also become transparent.
Fix it by removing transparency from any pixels drawn.
  • Loading branch information
szatanjl committed Apr 26, 2020
1 parent d078c12 commit 1529909
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drw.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ drw_clr_create(Drw *drw, Clr *dest, const char *clrname)
DefaultColormap(drw->dpy, drw->screen),
clrname, dest))
die("error, cannot allocate color '%s'", clrname);

dest->pixel |= 0xff << 24;
}

/* Wrapper to create color schemes. The caller has to call free(3) on the
Expand Down

31 comments on commit 1529909

@kbc8090
Copy link

@kbc8090 kbc8090 commented on 1529909 May 1, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

THANK YOU SO MUCH FOR THIS! 👍

@szatanjl
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem :)

@donihalim
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, so I don't need to apply alpha patch just to fix the transparency :D

@akemrir
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works very nice. Thanks 👍

@BachoSeven
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot mate!

@qasimwarraich
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cheers, thanks a lot! 👍

@gitneeraj
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this!

@tim-hilt
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Fixed transparent Alacritty-Borders for me!

@jzbor
Copy link

@jzbor jzbor commented on 1529909 Oct 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It fixed the builtin Alacritty transparency, but when specifying a transparency value for Alacritty through picom the borders still get transparent too... any ideas?

@szatanjl
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK there are at least two ways to make transparency in X11. One is to draw transparent ARGB pixels. And this patch sets alpha (A) to 0xff turning off transparency in pixels (including borders) drawn by dwm. But there is also another way to make window transparent and my guess is that this is what picom does. There is some EWMH or ICCCM Atom that tells X11 to make whole window transparent.

  1. In order to confirm that you can check xprop output.
  2. There is nothing that can be done unless you want to write quite a bit of code. You would need to make dwm a reparenting window manager (like pretty much all the other WMs).

@jzbor
Copy link

@jzbor jzbor commented on 1529909 Oct 22, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok so I guess the problem is that the argb value set in dwm just gets overwritten in picom, when it sets the transparency (I checked the xprop output). Although I don't mind a little coding, implementing reparenting in dwm sounds like it would be quite sophisticated. And I don't really think it's worth the effort just for nicer borders on picom-transparent windows...

@nong10
Copy link

@nong10 nong10 commented on 1529909 Nov 12, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works THANK YOU SO MUCH!!!!!!

@Aarnar
Copy link

@Aarnar Aarnar commented on 1529909 Feb 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks man 👍

@sudodoas
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot. The patch worked perfectly without any errors.

@jpe90
Copy link

@jpe90 jpe90 commented on 1529909 Jun 23, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you!

@siduck
Copy link

@siduck siduck commented on 1529909 Jul 25, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

THANKS

@jwdevelab
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@nionios
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice fix, thanks

@Whernog
Copy link

@Whernog Whernog commented on 1529909 Nov 6, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are gienus!

@astrolul
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much i have been tryna fix this for ages!

@Mageas
Copy link

@Mageas Mageas commented on 1529909 Dec 15, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot mate.

@avdzm
Copy link

@avdzm avdzm commented on 1529909 May 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank alot,
It was annoying, i couldn't tell which window had focus.
For some reason i didn't have the border transperancy issue on my old build on version 6.2.
I had it on the new build version 6.3, which i downloaded 2 days ago from the suckless website.

@AlphaTechnolog
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really thank you!

@leyamir
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much!

@leyamir
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It fix some app like thunar, brave have transparent border, some are not

@Duom1
Copy link

@Duom1 Duom1 commented on 1529909 Oct 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

@donRehan
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you !

@pandasoli
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx!

@kittybwained
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't expect this to work as I thought maybe it would have changed since 2020, and the line numbers did move, but this fix still seems to work!

@nosrednawall
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@randoragon
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Please sign in to comment.