diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 11 | ||||
| -rw-r--r-- | src/xfns.c | 9 |
2 files changed, 18 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index f076c78de4b..420c9f6c0f6 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,14 @@ | |||
| 1 | 2003-07-31 Kenichi Handa <handa@m17n.org> | ||
| 2 | |||
| 3 | * xterm.h (struct x_bitmap_record): New member have_mask. | ||
| 4 | |||
| 5 | * xfns.c (x_create_bitmap_from_data): Initialize have_mask member | ||
| 6 | to 0. | ||
| 7 | (x_create_bitmap_from_file): Likewise. | ||
| 8 | (x_destroy_bitmap): Check have_mask member before freeing a mask. | ||
| 9 | (x_destroy_all_bitmaps): Likewise. | ||
| 10 | (x_create_bitmap_mask): Set have_mask member to 1. | ||
| 11 | |||
| 1 | 2003-07-30 Richard M. Stallman <rms@gnu.org> | 12 | 2003-07-30 Richard M. Stallman <rms@gnu.org> |
| 2 | 13 | ||
| 3 | * Makefile.in (CFLAGS) [!OPTIMIZE]: Undo previous change. | 14 | * Makefile.in (CFLAGS) [!OPTIMIZE]: Undo previous change. |
diff --git a/src/xfns.c b/src/xfns.c index 4ce7dec41d7..b567b11d283 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -623,6 +623,7 @@ x_create_bitmap_from_data (f, bits, width, height) | |||
| 623 | 623 | ||
| 624 | id = x_allocate_bitmap_record (f); | 624 | id = x_allocate_bitmap_record (f); |
| 625 | dpyinfo->bitmaps[id - 1].pixmap = bitmap; | 625 | dpyinfo->bitmaps[id - 1].pixmap = bitmap; |
| 626 | dpyinfo->bitmaps[id - 1].have_mask = 0; | ||
| 626 | dpyinfo->bitmaps[id - 1].file = NULL; | 627 | dpyinfo->bitmaps[id - 1].file = NULL; |
| 627 | dpyinfo->bitmaps[id - 1].refcount = 1; | 628 | dpyinfo->bitmaps[id - 1].refcount = 1; |
| 628 | dpyinfo->bitmaps[id - 1].depth = 1; | 629 | dpyinfo->bitmaps[id - 1].depth = 1; |
| @@ -674,6 +675,7 @@ x_create_bitmap_from_file (f, file) | |||
| 674 | 675 | ||
| 675 | id = x_allocate_bitmap_record (f); | 676 | id = x_allocate_bitmap_record (f); |
| 676 | dpyinfo->bitmaps[id - 1].pixmap = bitmap; | 677 | dpyinfo->bitmaps[id - 1].pixmap = bitmap; |
| 678 | dpyinfo->bitmaps[id - 1].have_mask = 0; | ||
| 677 | dpyinfo->bitmaps[id - 1].refcount = 1; | 679 | dpyinfo->bitmaps[id - 1].refcount = 1; |
| 678 | dpyinfo->bitmaps[id - 1].file | 680 | dpyinfo->bitmaps[id - 1].file |
| 679 | = (char *) xmalloc (SBYTES (file) + 1); | 681 | = (char *) xmalloc (SBYTES (file) + 1); |
| @@ -701,7 +703,8 @@ x_destroy_bitmap (f, id) | |||
| 701 | { | 703 | { |
| 702 | BLOCK_INPUT; | 704 | BLOCK_INPUT; |
| 703 | XFreePixmap (FRAME_X_DISPLAY (f), dpyinfo->bitmaps[id - 1].pixmap); | 705 | XFreePixmap (FRAME_X_DISPLAY (f), dpyinfo->bitmaps[id - 1].pixmap); |
| 704 | XFreePixmap (FRAME_X_DISPLAY (f), dpyinfo->bitmaps[id - 1].mask); | 706 | if (dpyinfo->bitmaps[id - 1].have_mask) |
| 707 | XFreePixmap (FRAME_X_DISPLAY (f), dpyinfo->bitmaps[id - 1].mask); | ||
| 705 | if (dpyinfo->bitmaps[id - 1].file) | 708 | if (dpyinfo->bitmaps[id - 1].file) |
| 706 | { | 709 | { |
| 707 | xfree (dpyinfo->bitmaps[id - 1].file); | 710 | xfree (dpyinfo->bitmaps[id - 1].file); |
| @@ -723,7 +726,8 @@ x_destroy_all_bitmaps (dpyinfo) | |||
| 723 | if (dpyinfo->bitmaps[i].refcount > 0) | 726 | if (dpyinfo->bitmaps[i].refcount > 0) |
| 724 | { | 727 | { |
| 725 | XFreePixmap (dpyinfo->display, dpyinfo->bitmaps[i].pixmap); | 728 | XFreePixmap (dpyinfo->display, dpyinfo->bitmaps[i].pixmap); |
| 726 | XFreePixmap (dpyinfo->display, dpyinfo->bitmaps[i].mask); | 729 | if (dpyinfo->bitmaps[i].have_mask) |
| 730 | XFreePixmap (dpyinfo->display, dpyinfo->bitmaps[i].mask); | ||
| 727 | if (dpyinfo->bitmaps[i].file) | 731 | if (dpyinfo->bitmaps[i].file) |
| 728 | xfree (dpyinfo->bitmaps[i].file); | 732 | xfree (dpyinfo->bitmaps[i].file); |
| 729 | } | 733 | } |
| @@ -822,6 +826,7 @@ x_create_bitmap_mask(f, id) | |||
| 822 | width, height); | 826 | width, height); |
| 823 | XFreeGC (FRAME_X_DISPLAY (f), gc); | 827 | XFreeGC (FRAME_X_DISPLAY (f), gc); |
| 824 | 828 | ||
| 829 | dpyinfo->bitmaps[id - 1].have_mask = 1; | ||
| 825 | dpyinfo->bitmaps[id - 1].mask = mask; | 830 | dpyinfo->bitmaps[id - 1].mask = mask; |
| 826 | 831 | ||
| 827 | XDestroyImage (ximg); | 832 | XDestroyImage (ximg); |