diff options
| author | Karl Heuer | 1999-07-26 19:09:56 +0000 |
|---|---|---|
| committer | Karl Heuer | 1999-07-26 19:09:56 +0000 |
| commit | 51a1d2d86b16dac04df52e9f82f7aba48f687cf2 (patch) | |
| tree | c44159ab0c3213fa15c5585fce34cab2347fed0d /src | |
| parent | ec6d44639a9e97c6baa1c28eca60d5a237fe3628 (diff) | |
| download | emacs-51a1d2d86b16dac04df52e9f82f7aba48f687cf2.tar.gz emacs-51a1d2d86b16dac04df52e9f82f7aba48f687cf2.zip | |
(x_set_mouse_color): Always unload the old color.
Don't allow nil as color value.
(x_set_cursor_color, x_set_background_color, x_set_foreground_color):
Always unload the old color.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xfns.c | 38 |
1 files changed, 8 insertions, 30 deletions
diff --git a/src/xfns.c b/src/xfns.c index 251b48dd322..385724fcf84 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -1314,10 +1314,7 @@ x_set_foreground_color (f, arg, oldval) | |||
| 1314 | unsigned long pixel | 1314 | unsigned long pixel |
| 1315 | = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f)); | 1315 | = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f)); |
| 1316 | 1316 | ||
| 1317 | if (f->output_data.x->foreground_pixel != f->output_data.x->mouse_pixel | 1317 | unload_color (f, f->output_data.x->foreground_pixel); |
| 1318 | && f->output_data.x->foreground_pixel != f->output_data.x->cursor_pixel | ||
| 1319 | && f->output_data.x->foreground_pixel != f->output_data.x->cursor_foreground_pixel) | ||
| 1320 | unload_color (f, f->output_data.x->foreground_pixel); | ||
| 1321 | f->output_data.x->foreground_pixel = pixel; | 1318 | f->output_data.x->foreground_pixel = pixel; |
| 1322 | 1319 | ||
| 1323 | if (FRAME_X_WINDOW (f) != 0) | 1320 | if (FRAME_X_WINDOW (f) != 0) |
| @@ -1345,10 +1342,7 @@ x_set_background_color (f, arg, oldval) | |||
| 1345 | unsigned long pixel | 1342 | unsigned long pixel |
| 1346 | = x_decode_color (f, arg, WHITE_PIX_DEFAULT (f)); | 1343 | = x_decode_color (f, arg, WHITE_PIX_DEFAULT (f)); |
| 1347 | 1344 | ||
| 1348 | if (f->output_data.x->background_pixel != f->output_data.x->mouse_pixel | 1345 | unload_color (f, f->output_data.x->background_pixel); |
| 1349 | && f->output_data.x->background_pixel != f->output_data.x->cursor_pixel | ||
| 1350 | && f->output_data.x->background_pixel != f->output_data.x->cursor_foreground_pixel) | ||
| 1351 | unload_color (f, f->output_data.x->background_pixel); | ||
| 1352 | f->output_data.x->background_pixel = pixel; | 1346 | f->output_data.x->background_pixel = pixel; |
| 1353 | 1347 | ||
| 1354 | if (FRAME_X_WINDOW (f) != 0) | 1348 | if (FRAME_X_WINDOW (f) != 0) |
| @@ -1388,23 +1382,15 @@ x_set_mouse_color (f, arg, oldval) | |||
| 1388 | Cursor cursor, nontext_cursor, mode_cursor, cross_cursor; | 1382 | Cursor cursor, nontext_cursor, mode_cursor, cross_cursor; |
| 1389 | Cursor busy_cursor; | 1383 | Cursor busy_cursor; |
| 1390 | int count; | 1384 | int count; |
| 1391 | int mask_color; | 1385 | unsigned long pixel = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f)); |
| 1392 | unsigned long pixel = f->output_data.x->mouse_pixel; | 1386 | unsigned long mask_color = f->output_data.x->background_pixel; |
| 1393 | |||
| 1394 | if (!EQ (Qnil, arg)) | ||
| 1395 | pixel = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f)); | ||
| 1396 | 1387 | ||
| 1397 | mask_color = f->output_data.x->background_pixel; | 1388 | /* Don't let pointers be invisible. */ |
| 1398 | /* No invisible pointers. */ | ||
| 1399 | if (mask_color == pixel | 1389 | if (mask_color == pixel |
| 1400 | && mask_color == f->output_data.x->background_pixel) | 1390 | && mask_color == f->output_data.x->background_pixel) |
| 1401 | pixel = f->output_data.x->foreground_pixel; | 1391 | pixel = f->output_data.x->foreground_pixel; |
| 1402 | 1392 | ||
| 1403 | if (f->output_data.x->background_pixel != f->output_data.x->mouse_pixel | 1393 | unload_color (f, f->output_data.x->mouse_pixel); |
| 1404 | && f->output_data.x->foreground_pixel != f->output_data.x->mouse_pixel | ||
| 1405 | && f->output_data.x->cursor_pixel != f->output_data.x->mouse_pixel | ||
| 1406 | && f->output_data.x->cursor_foreground_pixel != f->output_data.x->mouse_pixel) | ||
| 1407 | unload_color (f, f->output_data.x->mouse_pixel); | ||
| 1408 | f->output_data.x->mouse_pixel = pixel; | 1394 | f->output_data.x->mouse_pixel = pixel; |
| 1409 | 1395 | ||
| 1410 | BLOCK_INPUT; | 1396 | BLOCK_INPUT; |
| @@ -1544,18 +1530,10 @@ x_set_cursor_color (f, arg, oldval) | |||
| 1544 | fore_pixel = f->output_data.x->background_pixel; | 1530 | fore_pixel = f->output_data.x->background_pixel; |
| 1545 | } | 1531 | } |
| 1546 | 1532 | ||
| 1547 | if (f->output_data.x->background_pixel != f->output_data.x->cursor_foreground_pixel | 1533 | unload_color (f, f->output_data.x->cursor_foreground_pixel); |
| 1548 | && f->output_data.x->foreground_pixel != f->output_data.x->cursor_foreground_pixel | ||
| 1549 | && f->output_data.x->mouse_pixel != f->output_data.x->cursor_foreground_pixel | ||
| 1550 | && f->output_data.x->cursor_pixel != f->output_data.x->cursor_foreground_pixel) | ||
| 1551 | unload_color (f, f->output_data.x->cursor_foreground_pixel); | ||
| 1552 | f->output_data.x->cursor_foreground_pixel = fore_pixel; | 1534 | f->output_data.x->cursor_foreground_pixel = fore_pixel; |
| 1553 | 1535 | ||
| 1554 | if (f->output_data.x->background_pixel != f->output_data.x->cursor_pixel | 1536 | unload_color (f, f->output_data.x->cursor_pixel); |
| 1555 | && f->output_data.x->foreground_pixel != f->output_data.x->cursor_pixel | ||
| 1556 | && f->output_data.x->mouse_pixel != f->output_data.x->cursor_pixel | ||
| 1557 | && f->output_data.x->cursor_foreground_pixel != f->output_data.x->cursor_pixel) | ||
| 1558 | unload_color (f, f->output_data.x->cursor_pixel); | ||
| 1559 | f->output_data.x->cursor_pixel = pixel; | 1537 | f->output_data.x->cursor_pixel = pixel; |
| 1560 | 1538 | ||
| 1561 | if (FRAME_X_WINDOW (f) != 0) | 1539 | if (FRAME_X_WINDOW (f) != 0) |