termux / termux-x11

Termux X11 add-on application.
https://termux.dev
GNU General Public License v3.0
2.12k stars 314 forks source link

incorrectly lighter color? #150

Closed youngshall closed 2 years ago

youngshall commented 2 years ago

I run termux-x11 and desktop environment running in proot ubuntu(xfce4), installed using tmoe script. The desktop runs smoothly, but the color seems lighter than it should be. for example, I set desktop background to black (#000000), but it's still dark gray. maybe I missed some settings? or this' a bug?

twaik commented 2 years ago

Can you please post some screenshots?

youngshall commented 2 years ago

Can you please post some screenshots?

Sorry, I can't reproduce this bug anymore. I closed and relaunched termux-x11, and then the color become normal. Likely this only occurs at first launch after installation. Now everything is fine!

twaik commented 1 year ago

I found it! Android lightens some Views when they receive focus, this code fixes that:

setBackground(new ColorDrawable(Color.TRANSPARENT) {
    public boolean isStateful() {
        return true;
    }
    public boolean hasFocusStateSpecified() {
        return true;
    }
});
youngshall commented 1 year ago

Amazing work! That must be really hard to find this root cause. I still occasionally encountered this bug, and the only thing I can do is relaunching termux-x11. Fixing it once and for all is very helpful to me.

twaik commented 1 year ago

This issue has been bothering me for several months.