| 151 | | Brightness = brightness; |
| 152 | | dim = Brightness / 255.0; |
| 153 | | col.R *= dim; |
| 154 | | col.G *= dim; |
| 155 | | col.B *= dim; |
| 156 | | |
| 157 | | debug("%s: set backlight to %d%%, original backlight color: 0x%02x%02x%02x%02x, dimmed: 0x%02x%02x%02x%02x", |
| 158 | | Name, (int)(dim * 100), BL_COL.R, BL_COL.G, BL_COL.B, BL_COL.A, col.R, col.G, col.B, col.A); |
| 159 | | for (i = 0; i < DCOLS * DROWS; i++) { |
| 160 | | drv_X11_FB[i] = col; |
| 161 | | } |
| 162 | | |
| 163 | | drv_X11_color(col); |
| 164 | | |
| 165 | | XFillRectangle(dp, pm, gc, 0, 0, dimx + 2 * border + btnwidth, dimy + 2 * border); |
| 166 | | XSetWindowBackground(dp, w, xc.pixel); |
| 167 | | XClearWindow(dp, w); |
| 168 | | |
| 169 | | /* redraw every LCD pixel */ |
| 170 | | drv_X11_blit(0, 0, LROWS, LCOLS); |
| | 151 | |
| | 152 | if (Brightness != brightness) { |
| | 153 | Brightness = brightness; |
| | 154 | dim = Brightness / 255.0; |
| | 155 | col.R *= dim; |
| | 156 | col.G *= dim; |
| | 157 | col.B *= dim; |
| | 158 | |
| | 159 | debug("%s: set backlight to %d%%, original backlight color: 0x%02x%02x%02x%02x, dimmed: 0x%02x%02x%02x%02x", |
| | 160 | Name, (int)(dim * 100), BL_COL.R, BL_COL.G, BL_COL.B, BL_COL.A, col.R, col.G, col.B, col.A); |
| | 161 | for (i = 0; i < DCOLS * DROWS; i++) { |
| | 162 | drv_X11_FB[i] = col; |
| | 163 | } |
| | 164 | |
| | 165 | drv_X11_color(col); |
| | 166 | |
| | 167 | XFillRectangle(dp, pm, gc, 0, 0, dimx + 2 * border + btnwidth, dimy + 2 * border); |
| | 168 | XSetWindowBackground(dp, w, xc.pixel); |
| | 169 | XClearWindow(dp, w); |
| | 170 | |
| | 171 | /* redraw every LCD pixel */ |
| | 172 | drv_X11_blit(0, 0, LROWS, LCOLS); |
| | 173 | } |