aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvolker <volker@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2007-06-20 15:03:41 +0000
committervolker <volker@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2007-06-20 15:03:41 +0000
commit4e604a94f3872b465d51a124f832e3d295fc1772 (patch)
tree3d5595da9760acbb9be5d3dfe1ab2cc3bd5d4266
parentf2004be68776eaf223a4cba5a0b7e45cc5a72624 (diff)
downloadlcd4linux-4e604a94f3872b465d51a124f832e3d295fc1772.tar.gz
LCD::brightness in drv_X11 corrected
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@812 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
Diffstat (limited to '')
-rw-r--r--drv_X11.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/drv_X11.c b/drv_X11.c
index ef56245..939909e 100644
--- a/drv_X11.c
+++ b/drv_X11.c
@@ -154,7 +154,8 @@ static int drv_X11_brightness(int brightness)
col.G *= dim;
col.B *= dim;
- debug("%s: set backlight to %d%%, bl_col=0x%8x, dimmed=0x%8x", Name, (int)(dim * 100), BL_COL, col);
+ debug("%s: set backlight to %d%%, original backlight color: 0x%02x%02x%02x%02x, dimmed: 0x%02x%02x%02x%02x",
+ Name, (int)(dim * 100), BL_COL.R, BL_COL.G, BL_COL.B, BL_COL.A, col.R, col.G, col.B, col.A);
for (i = 0; i < DCOLS * DROWS; i++) {
drv_X11_FB[i] = col;
}
@@ -165,6 +166,9 @@ static int drv_X11_brightness(int brightness)
XSetWindowBackground(dp, w, xc.pixel);
XClearWindow(dp, w);
+ /* redraw every LCD pixel */
+ drv_X11_blit(0, 0, LROWS, LCOLS);
+
return Brightness;
}
@@ -242,7 +246,11 @@ static void drv_X11_expose(const int x, const int y, const int width, const int
/* Keypad on the right side */
if (x1 >= xoffset) {
xfs = XQueryFont(dp, XGContextFromGC(DefaultGC(dp, 0)));
- drv_X11_color(FG_COL);
+ if (drv_X11_brightness(-1) > 127) {
+ drv_X11_color(FG_COL);
+ } else {
+ drv_X11_color(BG_COL);
+ }
for (r = 0; r < buttons; r++) {
yk = yoffset + r * (btnheight + pgap);
switch(r) {