aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog45
-rw-r--r--src/fringe.c2
-rw-r--r--src/indent.c3
-rw-r--r--src/macgui.h8
-rw-r--r--src/macmenu.c5
-rw-r--r--src/macterm.c80
-rw-r--r--src/window.c3
7 files changed, 93 insertions, 53 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index c016dc46e4b..2630efe73b7 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,35 @@
12006-02-22 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * window.c (Fwindow_list): Check `window' before doing XWINDOW.
4 The default `window' should not be "on a different frame".
5
62006-02-22 Kim F. Storm <storm@cua.dk>
7
8 * indent.c (Fvertical_motion): Only try to move back if we can.
9
102006-02-22 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11
12 * macgui.h (struct _XGC) [!MAC_OSX || !USE_ATSUI]: New member
13 n_clip_rects.
14
15 * macmenu.c (digest_single_submenu): Apply 2006-02-19 change for
16 xmenu.c.
17
18 * macterm.c (GC_CLIP_REGION): Remove macro.
19 (mac_begin_clip, mac_end_clip): Take arg GC instead of REGION.
20 All uses changed. Don't do clipping if n_clip_rects is zero.
21 (mac_set_clip_rectangles): Use xassert instead of abort.
22 Set n_clip_rects. Don't make clip_region empty when number of
23 clipping rectangles is zero.
24 (mac_reset_clip_rectangles): Set n_clip_rects directly instead of
25 calling mac_set_clip_rectangles.
26 (x_set_toolkit_scroll_bar_thumb): Temporarily hide scroll bar to
27 avoid multiple redraws.
28
292006-02-22 Kim F. Storm <storm@cua.dk>
30
31 * fringe.c (draw_fringe_bitmap): Fix overlay-arrow display.
32
12006-02-21 Kim F. Storm <storm@cua.dk> 332006-02-21 Kim F. Storm <storm@cua.dk>
2 34
3 * fringe.c (syms_of_fringe) <fringe-bitmaps>: Doc fix. 35 * fringe.c (syms_of_fringe) <fringe-bitmaps>: Doc fix.
@@ -18,8 +50,8 @@
18 BG_WIDTH. All uses changed. Draw background if BG_WIDTH is not zero. 50 BG_WIDTH. All uses changed. Draw background if BG_WIDTH is not zero.
19 (mac_draw_image_string, mac_draw_image_string_16): New arg BG_WIDTH. 51 (mac_draw_image_string, mac_draw_image_string_16): New arg BG_WIDTH.
20 [USE_CG_TEXT_DRAWING] (mac_draw_image_string_cg): Rename from 52 [USE_CG_TEXT_DRAWING] (mac_draw_image_string_cg): Rename from
21 mac_draw_string_cg. New arg BG_WIDTH. All uses changed. Draw 53 mac_draw_string_cg. New arg BG_WIDTH. All uses changed.
22 background if BG_WIDTH is not zero. Use float constants as 54 Draw background if BG_WIDTH is not zero. Use float constants as
23 divisors instead of double. Use alloca instead of xmalloc/xfree. 55 divisors instead of double. Use alloca instead of xmalloc/xfree.
24 (x_draw_glyph_string_background, x_draw_glyph_string_foreground) 56 (x_draw_glyph_string_background, x_draw_glyph_string_foreground)
25 [!MAC_OS8 || USE_ATSUI]: Background may be drawn using 57 [!MAC_OS8 || USE_ATSUI]: Background may be drawn using
@@ -30,6 +62,11 @@
30 (mac_set_clip_rectangles): When resetting clip region, make it 62 (mac_set_clip_rectangles): When resetting clip region, make it
31 empty instead of disposing of it. 63 empty instead of disposing of it.
32 64
652006-02-20 Stefan Monnier <monnier@iro.umontreal.ca>
66
67 * keymap.c (store_in_keymap): Change `def' arg to not be `register'.
68 Seems to trigger a bug in gcc-amd64 4.0.2 20051125 (Red Hat 4.0.2-8).
69
332006-02-20 Kim F. Storm <storm@cua.dk> 702006-02-20 Kim F. Storm <storm@cua.dk>
34 71
35 * Makefile.in: Add fringe.elc to WINDOW_SUPPORT. 72 * Makefile.in: Add fringe.elc to WINDOW_SUPPORT.
@@ -55,10 +92,10 @@
55 (left_curly_arrow_bits): Rename from continuation_bits. 92 (left_curly_arrow_bits): Rename from continuation_bits.
56 (right_curly_arrow_bits): Rename from continued_bits. 93 (right_curly_arrow_bits): Rename from continued_bits.
57 (left_triangle_bits): Rename from ov_bits. 94 (left_triangle_bits): Rename from ov_bits.
58 (right_triangle_bits): Added. 95 (right_triangle_bits): Add.
59 (filled_rectangle_bits): Rename from filled_box_cursor_bits. 96 (filled_rectangle_bits): Rename from filled_box_cursor_bits.
60 (hollow_rectangle_bits): Rename from hollow_box_cursor_bits. 97 (hollow_rectangle_bits): Rename from hollow_box_cursor_bits.
61 (filled_square_bits): Added. 98 (filled_square_bits): Add.
62 (vertical_bar_bits): Rename from bar_cursor_bits. 99 (vertical_bar_bits): Rename from bar_cursor_bits.
63 (horizontal_bar_bits): Rename from hbar_cursor_bits. 100 (horizontal_bar_bits): Rename from hbar_cursor_bits.
64 (empty_line_bits): Rename from zv_bits. 101 (empty_line_bits): Rename from zv_bits.
diff --git a/src/fringe.c b/src/fringe.c
index 6a98b852e3e..721b572e373 100644
--- a/src/fringe.c
+++ b/src/fringe.c
@@ -869,7 +869,7 @@ draw_fringe_bitmap (w, row, left_p)
869 if (left_p && row->overlay_arrow_bitmap != NO_FRINGE_BITMAP) 869 if (left_p && row->overlay_arrow_bitmap != NO_FRINGE_BITMAP)
870 draw_fringe_bitmap_1 (w, row, 1, 1, 870 draw_fringe_bitmap_1 (w, row, 1, 1,
871 (row->overlay_arrow_bitmap < 0 871 (row->overlay_arrow_bitmap < 0
872 ? get_logical_cursor_bitmap (w, Qoverlay_arrow) 872 ? get_logical_fringe_bitmap (w, Qoverlay_arrow, 0, 0)
873 : row->overlay_arrow_bitmap)); 873 : row->overlay_arrow_bitmap));
874} 874}
875 875
diff --git a/src/indent.c b/src/indent.c
index 9b5a9e32c79..efc375e27f7 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -2109,7 +2109,8 @@ whether or not it is currently displayed in some window. */)
2109 it.vpos = 0; 2109 it.vpos = 0;
2110 /* Do this even if LINES is 0, so that we move back 2110 /* Do this even if LINES is 0, so that we move back
2111 to the beginning of the current line as we ought. */ 2111 to the beginning of the current line as we ought. */
2112 move_it_by_lines (&it, XINT (lines), 0); 2112 if (XINT (lines) >= 0 || IT_CHARPOS (it) > 0)
2113 move_it_by_lines (&it, XINT (lines), 0);
2113 2114
2114 SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it)); 2115 SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it));
2115 } 2116 }
diff --git a/src/macgui.h b/src/macgui.h
index cfe35e82945..a84fea1ae91 100644
--- a/src/macgui.h
+++ b/src/macgui.h
@@ -217,13 +217,13 @@ typedef struct _XGC
217 RGBColor back_color; 217 RGBColor back_color;
218 218
219#define MAX_CLIP_RECTS 2 219#define MAX_CLIP_RECTS 2
220 /* QuickDraw clipping region. */ 220 /* Number of clipping rectangles. */
221 int n_clip_rects;
222
223 /* QuickDraw clipping region. Ignored if n_clip_rects == 0. */
221 RgnHandle clip_region; 224 RgnHandle clip_region;
222 225
223#if defined (MAC_OSX) && USE_ATSUI 226#if defined (MAC_OSX) && USE_ATSUI
224 /* Number of clipping rectangles used in Quartz 2D drawing. */
225 int n_clip_rects;
226
227 /* Clipping rectangles used in Quartz 2D drawing. The y-coordinate 227 /* Clipping rectangles used in Quartz 2D drawing. The y-coordinate
228 is in QuickDraw's. */ 228 is in QuickDraw's. */
229 CGRect clip_rects[MAX_CLIP_RECTS]; 229 CGRect clip_rects[MAX_CLIP_RECTS];
diff --git a/src/macmenu.c b/src/macmenu.c
index fccbbe6402c..8cce41114de 100644
--- a/src/macmenu.c
+++ b/src/macmenu.c
@@ -1257,8 +1257,11 @@ digest_single_submenu (start, end, top_level_items)
1257 wv->enabled = 1; 1257 wv->enabled = 1;
1258 wv->button_type = BUTTON_TYPE_NONE; 1258 wv->button_type = BUTTON_TYPE_NONE;
1259 wv->help = Qnil; 1259 wv->help = Qnil;
1260 save_wv = wv;
1260 } 1261 }
1261 save_wv = wv; 1262 else
1263 save_wv = first_wv;
1264
1262 prev_wv = 0; 1265 prev_wv = 0;
1263 i += MENU_ITEMS_PANE_LENGTH; 1266 i += MENU_ITEMS_PANE_LENGTH;
1264 } 1267 }
diff --git a/src/macterm.c b/src/macterm.c
index 5e341a4eeae..697bfd58556 100644
--- a/src/macterm.c
+++ b/src/macterm.c
@@ -267,14 +267,13 @@ extern void menubar_selection_callback (FRAME_PTR, int);
267#define GC_FORE_COLOR(gc) (&(gc)->fore_color) 267#define GC_FORE_COLOR(gc) (&(gc)->fore_color)
268#define GC_BACK_COLOR(gc) (&(gc)->back_color) 268#define GC_BACK_COLOR(gc) (&(gc)->back_color)
269#define GC_FONT(gc) ((gc)->xgcv.font) 269#define GC_FONT(gc) ((gc)->xgcv.font)
270#define GC_CLIP_REGION(gc) ((gc)->clip_region)
271#define FRAME_NORMAL_GC(f) ((f)->output_data.mac->normal_gc) 270#define FRAME_NORMAL_GC(f) ((f)->output_data.mac->normal_gc)
272 271
273static RgnHandle saved_port_clip_region = NULL; 272static RgnHandle saved_port_clip_region = NULL;
274 273
275static void 274static void
276mac_begin_clip (region) 275mac_begin_clip (gc)
277 RgnHandle region; 276 GC gc;
278{ 277{
279 static RgnHandle new_region = NULL; 278 static RgnHandle new_region = NULL;
280 279
@@ -283,19 +282,19 @@ mac_begin_clip (region)
283 if (new_region == NULL) 282 if (new_region == NULL)
284 new_region = NewRgn (); 283 new_region = NewRgn ();
285 284
286 if (region && !EmptyRgn (region)) 285 if (gc->n_clip_rects)
287 { 286 {
288 GetClip (saved_port_clip_region); 287 GetClip (saved_port_clip_region);
289 SectRgn (saved_port_clip_region, region, new_region); 288 SectRgn (saved_port_clip_region, gc->clip_region, new_region);
290 SetClip (new_region); 289 SetClip (new_region);
291 } 290 }
292} 291}
293 292
294static void 293static void
295mac_end_clip (region) 294mac_end_clip (gc)
296 RgnHandle region; 295 GC gc;
297{ 296{
298 if (region && !EmptyRgn (region)) 297 if (gc->n_clip_rects)
299 SetClip (saved_port_clip_region); 298 SetClip (saved_port_clip_region);
300} 299}
301 300
@@ -323,10 +322,10 @@ mac_draw_line (f, gc, x1, y1, x2, y2)
323 322
324 RGBForeColor (GC_FORE_COLOR (gc)); 323 RGBForeColor (GC_FORE_COLOR (gc));
325 324
326 mac_begin_clip (GC_CLIP_REGION (gc)); 325 mac_begin_clip (gc);
327 MoveTo (x1, y1); 326 MoveTo (x1, y1);
328 LineTo (x2, y2); 327 LineTo (x2, y2);
329 mac_end_clip (GC_CLIP_REGION (gc)); 328 mac_end_clip (gc);
330} 329}
331 330
332void 331void
@@ -367,9 +366,9 @@ mac_erase_rectangle (f, gc, x, y, width, height)
367 RGBBackColor (GC_BACK_COLOR (gc)); 366 RGBBackColor (GC_BACK_COLOR (gc));
368 SetRect (&r, x, y, x + width, y + height); 367 SetRect (&r, x, y, x + width, y + height);
369 368
370 mac_begin_clip (GC_CLIP_REGION (gc)); 369 mac_begin_clip (gc);
371 EraseRect (&r); 370 EraseRect (&r);
372 mac_end_clip (GC_CLIP_REGION (gc)); 371 mac_end_clip (gc);
373 372
374 RGBBackColor (GC_BACK_COLOR (FRAME_NORMAL_GC (f))); 373 RGBBackColor (GC_BACK_COLOR (FRAME_NORMAL_GC (f)));
375} 374}
@@ -432,7 +431,7 @@ mac_draw_bitmap (f, gc, x, y, width, height, bits, overlay_p)
432 RGBBackColor (GC_BACK_COLOR (gc)); 431 RGBBackColor (GC_BACK_COLOR (gc));
433 SetRect (&r, x, y, x + width, y + height); 432 SetRect (&r, x, y, x + width, y + height);
434 433
435 mac_begin_clip (GC_CLIP_REGION (gc)); 434 mac_begin_clip (gc);
436#if TARGET_API_MAC_CARBON 435#if TARGET_API_MAC_CARBON
437 { 436 {
438 CGrafPtr port; 437 CGrafPtr port;
@@ -447,7 +446,7 @@ mac_draw_bitmap (f, gc, x, y, width, height, bits, overlay_p)
447 CopyBits (&bitmap, &(FRAME_MAC_WINDOW (f)->portBits), &(bitmap.bounds), &r, 446 CopyBits (&bitmap, &(FRAME_MAC_WINDOW (f)->portBits), &(bitmap.bounds), &r,
448 overlay_p ? srcOr : srcCopy, 0); 447 overlay_p ? srcOr : srcCopy, 0);
449#endif /* not TARGET_API_MAC_CARBON */ 448#endif /* not TARGET_API_MAC_CARBON */
450 mac_end_clip (GC_CLIP_REGION (gc)); 449 mac_end_clip (gc);
451 450
452 RGBBackColor (GC_BACK_COLOR (FRAME_NORMAL_GC (f))); 451 RGBBackColor (GC_BACK_COLOR (FRAME_NORMAL_GC (f)));
453} 452}
@@ -579,9 +578,9 @@ mac_fill_rectangle (f, gc, x, y, width, height)
579 RGBForeColor (GC_FORE_COLOR (gc)); 578 RGBForeColor (GC_FORE_COLOR (gc));
580 SetRect (&r, x, y, x + width, y + height); 579 SetRect (&r, x, y, x + width, y + height);
581 580
582 mac_begin_clip (GC_CLIP_REGION (gc)); 581 mac_begin_clip (gc);
583 PaintRect (&r); /* using foreground color of gc */ 582 PaintRect (&r); /* using foreground color of gc */
584 mac_end_clip (GC_CLIP_REGION (gc)); 583 mac_end_clip (gc);
585} 584}
586 585
587 586
@@ -601,9 +600,9 @@ mac_draw_rectangle (f, gc, x, y, width, height)
601 RGBForeColor (GC_FORE_COLOR (gc)); 600 RGBForeColor (GC_FORE_COLOR (gc));
602 SetRect (&r, x, y, x + width + 1, y + height + 1); 601 SetRect (&r, x, y, x + width + 1, y + height + 1);
603 602
604 mac_begin_clip (GC_CLIP_REGION (gc)); 603 mac_begin_clip (gc);
605 FrameRect (&r); /* using foreground color of gc */ 604 FrameRect (&r); /* using foreground color of gc */
606 mac_end_clip (GC_CLIP_REGION (gc)); 605 mac_end_clip (gc);
607} 606}
608 607
609 608
@@ -718,7 +717,7 @@ mac_draw_string_common (f, gc, x, y, buf, nchars, bg_width, bytes_per_char)
718 if (!mac_use_core_graphics) 717 if (!mac_use_core_graphics)
719 { 718 {
720#endif 719#endif
721 mac_begin_clip (GC_CLIP_REGION (gc)); 720 mac_begin_clip (gc);
722 RGBForeColor (GC_FORE_COLOR (gc)); 721 RGBForeColor (GC_FORE_COLOR (gc));
723 if (bg_width) 722 if (bg_width)
724 { 723 {
@@ -734,7 +733,7 @@ mac_draw_string_common (f, gc, x, y, buf, nchars, bg_width, bytes_per_char)
734 ATSUDrawText (text_layout, 733 ATSUDrawText (text_layout,
735 kATSUFromTextBeginning, kATSUToTextEnd, 734 kATSUFromTextBeginning, kATSUToTextEnd,
736 kATSUUseGrafPortPenLoc, kATSUUseGrafPortPenLoc); 735 kATSUUseGrafPortPenLoc, kATSUUseGrafPortPenLoc);
737 mac_end_clip (GC_CLIP_REGION (gc)); 736 mac_end_clip (gc);
738#ifdef MAC_OSX 737#ifdef MAC_OSX
739 } 738 }
740 else 739 else
@@ -807,7 +806,7 @@ mac_draw_string_common (f, gc, x, y, buf, nchars, bg_width, bytes_per_char)
807 if (mac_use_core_graphics) 806 if (mac_use_core_graphics)
808 savedFlags = SwapQDTextFlags (kQDUseCGTextRendering); 807 savedFlags = SwapQDTextFlags (kQDUseCGTextRendering);
809#endif 808#endif
810 mac_begin_clip (GC_CLIP_REGION (gc)); 809 mac_begin_clip (gc);
811 RGBForeColor (GC_FORE_COLOR (gc)); 810 RGBForeColor (GC_FORE_COLOR (gc));
812#ifdef MAC_OS8 811#ifdef MAC_OS8
813 if (bg_width) 812 if (bg_width)
@@ -843,7 +842,7 @@ mac_draw_string_common (f, gc, x, y, buf, nchars, bg_width, bytes_per_char)
843 DrawText (buf, 0, nchars * bytes_per_char); 842 DrawText (buf, 0, nchars * bytes_per_char);
844 if (bg_width) 843 if (bg_width)
845 RGBBackColor (GC_BACK_COLOR (FRAME_NORMAL_GC (f))); 844 RGBBackColor (GC_BACK_COLOR (FRAME_NORMAL_GC (f)));
846 mac_end_clip (GC_CLIP_REGION (gc)); 845 mac_end_clip (gc);
847 846
848#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020 847#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020
849 if (mac_use_core_graphics) 848 if (mac_use_core_graphics)
@@ -1185,7 +1184,7 @@ mac_copy_area (src, f, gc, src_x, src_y, width, height, dest_x, dest_y)
1185 ForeColor (blackColor); 1184 ForeColor (blackColor);
1186 BackColor (whiteColor); 1185 BackColor (whiteColor);
1187 1186
1188 mac_begin_clip (GC_CLIP_REGION (gc)); 1187 mac_begin_clip (gc);
1189 LockPixels (GetGWorldPixMap (src)); 1188 LockPixels (GetGWorldPixMap (src));
1190#if TARGET_API_MAC_CARBON 1189#if TARGET_API_MAC_CARBON
1191 { 1190 {
@@ -1203,7 +1202,7 @@ mac_copy_area (src, f, gc, src_x, src_y, width, height, dest_x, dest_y)
1203 &src_r, &dest_r, srcCopy, 0); 1202 &src_r, &dest_r, srcCopy, 0);
1204#endif /* not TARGET_API_MAC_CARBON */ 1203#endif /* not TARGET_API_MAC_CARBON */
1205 UnlockPixels (GetGWorldPixMap (src)); 1204 UnlockPixels (GetGWorldPixMap (src));
1206 mac_end_clip (GC_CLIP_REGION (gc)); 1205 mac_end_clip (gc);
1207 1206
1208 RGBBackColor (GC_BACK_COLOR (FRAME_NORMAL_GC (f))); 1207 RGBBackColor (GC_BACK_COLOR (FRAME_NORMAL_GC (f)));
1209} 1208}
@@ -1229,7 +1228,7 @@ mac_copy_area_with_mask (src, mask, f, gc, src_x, src_y,
1229 ForeColor (blackColor); 1228 ForeColor (blackColor);
1230 BackColor (whiteColor); 1229 BackColor (whiteColor);
1231 1230
1232 mac_begin_clip (GC_CLIP_REGION (gc)); 1231 mac_begin_clip (gc);
1233 LockPixels (GetGWorldPixMap (src)); 1232 LockPixels (GetGWorldPixMap (src));
1234 LockPixels (GetGWorldPixMap (mask)); 1233 LockPixels (GetGWorldPixMap (mask));
1235#if TARGET_API_MAC_CARBON 1234#if TARGET_API_MAC_CARBON
@@ -1249,7 +1248,7 @@ mac_copy_area_with_mask (src, mask, f, gc, src_x, src_y,
1249#endif /* not TARGET_API_MAC_CARBON */ 1248#endif /* not TARGET_API_MAC_CARBON */
1250 UnlockPixels (GetGWorldPixMap (mask)); 1249 UnlockPixels (GetGWorldPixMap (mask));
1251 UnlockPixels (GetGWorldPixMap (src)); 1250 UnlockPixels (GetGWorldPixMap (src));
1252 mac_end_clip (GC_CLIP_REGION (gc)); 1251 mac_end_clip (gc);
1253 1252
1254 RGBBackColor (GC_BACK_COLOR (FRAME_NORMAL_GC (f))); 1253 RGBBackColor (GC_BACK_COLOR (FRAME_NORMAL_GC (f)));
1255} 1254}
@@ -1287,9 +1286,9 @@ mac_scroll_area (f, gc, src_x, src_y, width, height, dest_x, dest_y)
1287 color mapping in CopyBits. Otherwise, it will be slow. */ 1286 color mapping in CopyBits. Otherwise, it will be slow. */
1288 ForeColor (blackColor); 1287 ForeColor (blackColor);
1289 BackColor (whiteColor); 1288 BackColor (whiteColor);
1290 mac_begin_clip (GC_CLIP_REGION (gc)); 1289 mac_begin_clip (gc);
1291 CopyBits (&(w->portBits), &(w->portBits), &src_r, &dest_r, srcCopy, 0); 1290 CopyBits (&(w->portBits), &(w->portBits), &src_r, &dest_r, srcCopy, 0);
1292 mac_end_clip (GC_CLIP_REGION (gc)); 1291 mac_end_clip (gc);
1293 1292
1294 RGBBackColor (GC_BACK_COLOR (FRAME_NORMAL_GC (f))); 1293 RGBBackColor (GC_BACK_COLOR (FRAME_NORMAL_GC (f)));
1295#endif /* not TARGET_API_MAC_CARBON */ 1294#endif /* not TARGET_API_MAC_CARBON */
@@ -1425,14 +1424,10 @@ mac_set_clip_rectangles (display, gc, rectangles, n)
1425{ 1424{
1426 int i; 1425 int i;
1427 1426
1428 if (n < 0 || n > MAX_CLIP_RECTS) 1427 xassert (n >= 0 && n <= MAX_CLIP_RECTS);
1429 abort (); 1428
1430 if (n == 0) 1429 gc->n_clip_rects = n;
1431 { 1430 if (n > 0)
1432 if (gc->clip_region)
1433 SetEmptyRgn (gc->clip_region);
1434 }
1435 else
1436 { 1431 {
1437 if (gc->clip_region == NULL) 1432 if (gc->clip_region == NULL)
1438 gc->clip_region = NewRgn (); 1433 gc->clip_region = NewRgn ();
@@ -1450,8 +1445,6 @@ mac_set_clip_rectangles (display, gc, rectangles, n)
1450 } 1445 }
1451 } 1446 }
1452#if defined (MAC_OSX) && USE_ATSUI 1447#if defined (MAC_OSX) && USE_ATSUI
1453 gc->n_clip_rects = n;
1454
1455 for (i = 0; i < n; i++) 1448 for (i = 0; i < n; i++)
1456 { 1449 {
1457 Rect *rect = rectangles + i; 1450 Rect *rect = rectangles + i;
@@ -1471,7 +1464,7 @@ mac_reset_clip_rectangles (display, gc)
1471 Display *display; 1464 Display *display;
1472 GC gc; 1465 GC gc;
1473{ 1466{
1474 mac_set_clip_rectangles (display, gc, NULL, 0); 1467 gc->n_clip_rects = 0;
1475} 1468}
1476 1469
1477 1470
@@ -4536,8 +4529,7 @@ x_set_toolkit_scroll_bar_thumb (bar, portion, position, whole)
4536 int portion, position, whole; 4529 int portion, position, whole;
4537{ 4530{
4538 ControlHandle ch = SCROLL_BAR_CONTROL_HANDLE (bar); 4531 ControlHandle ch = SCROLL_BAR_CONTROL_HANDLE (bar);
4539 4532 int value, viewsize, maximum, visible_p;
4540 int value, viewsize, maximum;
4541 4533
4542 if (whole == 0 || XINT (bar->track_height) == 0) 4534 if (whole == 0 || XINT (bar->track_height) == 0)
4543 value = 0, viewsize = 1, maximum = 0; 4535 value = 0, viewsize = 1, maximum = 0;
@@ -4550,11 +4542,17 @@ x_set_toolkit_scroll_bar_thumb (bar, portion, position, whole)
4550 4542
4551 BLOCK_INPUT; 4543 BLOCK_INPUT;
4552 4544
4545 /* Temporarily hide the scroll bar to avoid multiple redraws. */
4546 visible_p = IsControlVisible (ch);
4547 SetControlVisibility (ch, false, false);
4548
4553 SetControl32BitMinimum (ch, 0); 4549 SetControl32BitMinimum (ch, 0);
4554 SetControl32BitMaximum (ch, maximum); 4550 SetControl32BitMaximum (ch, maximum);
4555 SetControl32BitValue (ch, value); 4551 SetControl32BitValue (ch, value);
4556 SetControlViewSize (ch, viewsize); 4552 SetControlViewSize (ch, viewsize);
4557 4553
4554 SetControlVisibility (ch, visible_p, true);
4555
4558 UNBLOCK_INPUT; 4556 UNBLOCK_INPUT;
4559} 4557}
4560 4558
diff --git a/src/window.c b/src/window.c
index 350b4753491..29701a1ac62 100644
--- a/src/window.c
+++ b/src/window.c
@@ -1863,7 +1863,8 @@ MINIBUF neither nil nor t means never include the minibuffer window. */)
1863 Lisp_Object frame, minibuf, window; 1863 Lisp_Object frame, minibuf, window;
1864{ 1864{
1865 if (NILP (window)) 1865 if (NILP (window))
1866 window = selected_window; 1866 window = FRAMEP (frame) ? XFRAME (frame)->selected_window : selected_window;
1867 CHECK_WINDOW (window);
1867 if (NILP (frame)) 1868 if (NILP (frame))
1868 frame = selected_frame; 1869 frame = selected_frame;
1869 1870