aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Rumney2002-03-22 22:00:42 +0000
committerJason Rumney2002-03-22 22:00:42 +0000
commit0327b4cc87ada62c2fd72d14b719330cea8eabe9 (patch)
tree14376e2a35c9f02781db85e7158c909d7cb2cfc5 /src
parent483812aebde4dab378866872cb0fef65cd20971d (diff)
downloademacs-0327b4cc87ada62c2fd72d14b719330cea8eabe9.tar.gz
emacs-0327b4cc87ada62c2fd72d14b719330cea8eabe9.zip
(x_set_cursor_color): Set cursor_gc as well.
(clear_image_cache): Block input, fix logic, clear matrices in all frames that share this cache.
Diffstat (limited to 'src')
-rw-r--r--src/w32fns.c39
1 files changed, 29 insertions, 10 deletions
diff --git a/src/w32fns.c b/src/w32fns.c
index dbac0492753..319f8d95573 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -277,7 +277,6 @@ Lisp_Object Qfullboth;
277 277
278extern Lisp_Object Qtop; 278extern Lisp_Object Qtop;
279extern Lisp_Object Qdisplay; 279extern Lisp_Object Qdisplay;
280extern Lisp_Object Qtool_bar_lines;
281 280
282/* State variables for emulating a three button mouse. */ 281/* State variables for emulating a three button mouse. */
283#define LMOUSE 1 282#define LMOUSE 1
@@ -2292,6 +2291,13 @@ x_set_cursor_color (f, arg, oldval)
2292 2291
2293 if (FRAME_W32_WINDOW (f) != 0) 2292 if (FRAME_W32_WINDOW (f) != 0)
2294 { 2293 {
2294 BLOCK_INPUT;
2295 /* Update frame's cursor_gc. */
2296 f->output_data.w32->cursor_gc->foreground = fore_pixel;
2297 f->output_data.w32->cursor_gc->background = pixel;
2298
2299 UNBLOCK_INPUT;
2300
2295 if (FRAME_VISIBLE_P (f)) 2301 if (FRAME_VISIBLE_P (f))
2296 { 2302 {
2297 x_update_cursor (f, 0); 2303 x_update_cursor (f, 0);
@@ -5671,7 +5677,7 @@ This function is an internal primitive--use `make-frame' instead. */)
5671 5677
5672 x_default_parameter (f, parms, Qmenu_bar_lines, make_number (1), 5678 x_default_parameter (f, parms, Qmenu_bar_lines, make_number (1),
5673 "menuBar", "MenuBar", RES_TYPE_NUMBER); 5679 "menuBar", "MenuBar", RES_TYPE_NUMBER);
5674 x_default_parameter (f, parms, Qtool_bar_lines, make_number (0), 5680 x_default_parameter (f, parms, Qtool_bar_lines, make_number (HAVE_IMAGES),
5675 "toolBar", "ToolBar", RES_TYPE_NUMBER); 5681 "toolBar", "ToolBar", RES_TYPE_NUMBER);
5676 x_default_parameter (f, parms, Qbuffer_predicate, Qnil, 5682 x_default_parameter (f, parms, Qbuffer_predicate, Qnil,
5677 "bufferPredicate", "BufferPredicate", RES_TYPE_SYMBOL); 5683 "bufferPredicate", "BufferPredicate", RES_TYPE_SYMBOL);
@@ -8142,7 +8148,6 @@ DEFUN ("x-synchronize", Fx_synchronize, Sx_synchronize, 1, 2, 0,
8142} 8148}
8143 8149
8144 8150
8145
8146/*********************************************************************** 8151/***********************************************************************
8147 Image types 8152 Image types
8148 ***********************************************************************/ 8153 ***********************************************************************/
@@ -8968,20 +8973,23 @@ clear_image_cache (f, force_p)
8968 { 8973 {
8969 EMACS_TIME t; 8974 EMACS_TIME t;
8970 unsigned long old; 8975 unsigned long old;
8971 int i, any_freed_p = 0; 8976 int i, nfreed;
8972 8977
8973 EMACS_GET_TIME (t); 8978 EMACS_GET_TIME (t);
8974 old = EMACS_SECS (t) - XFASTINT (Vimage_cache_eviction_delay); 8979 old = EMACS_SECS (t) - XFASTINT (Vimage_cache_eviction_delay);
8975 8980
8976 for (i = 0; i < c->used; ++i) 8981 /* Block input so that we won't be interrupted by a SIGIO
8982 while being in an inconsistent state. */
8983 BLOCK_INPUT;
8984
8985 for (i = nfreed = 0; i < c->used; ++i)
8977 { 8986 {
8978 struct image *img = c->images[i]; 8987 struct image *img = c->images[i];
8979 if (img != NULL 8988 if (img != NULL
8980 && (force_p 8989 && (force_p || (img->timestamp < old)))
8981 || (img->timestamp > old)))
8982 { 8990 {
8983 free_image (f, img); 8991 free_image (f, img);
8984 any_freed_p = 1; 8992 ++nfreed;
8985 } 8993 }
8986 } 8994 }
8987 8995
@@ -8989,11 +8997,22 @@ clear_image_cache (f, force_p)
8989 Emacs was iconified for a longer period of time. In that 8997 Emacs was iconified for a longer period of time. In that
8990 case, current matrices may still contain references to 8998 case, current matrices may still contain references to
8991 images freed above. So, clear these matrices. */ 8999 images freed above. So, clear these matrices. */
8992 if (any_freed_p) 9000 if (nfreed)
8993 { 9001 {
8994 clear_current_matrices (f); 9002 Lisp_Object tail, frame;
9003
9004 FOR_EACH_FRAME (tail, frame)
9005 {
9006 struct frame *f = XFRAME (frame);
9007 if (FRAME_W32_P (f)
9008 && FRAME_X_IMAGE_CACHE (f) == c)
9009 clear_current_matrices (f);
9010 }
9011
8995 ++windows_or_buffers_changed; 9012 ++windows_or_buffers_changed;
8996 } 9013 }
9014
9015 UNBLOCK_INPUT;
8997 } 9016 }
8998} 9017}
8999 9018