aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Djärv2012-09-08 22:16:39 +0200
committerJan Djärv2012-09-08 22:16:39 +0200
commit9d7f18633a3f36de96bb42d856355c5ce12f2b5d (patch)
tree9af332cf22afeb44d4c46b18dd3bb5d163e6da07
parent0979429b332b515b149453277dd7867c76fed51e (diff)
downloademacs-9d7f18633a3f36de96bb42d856355c5ce12f2b5d.tar.gz
emacs-9d7f18633a3f36de96bb42d856355c5ce12f2b5d.zip
* nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
compositeToPoint for OSX < 10.6. Fixes: debbugs:12390
-rw-r--r--src/ChangeLog5
-rw-r--r--src/nsterm.m39
2 files changed, 40 insertions, 4 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 0316e7708af..56b96fda519 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2
3 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
4 compositeToPoint for OSX < 10.6 (Bug#12390).
5
12012-09-08 Paul Eggert <eggert@cs.ucla.edu> 62012-09-08 Paul Eggert <eggert@cs.ucla.edu>
2 7
3 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)). 8 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
diff --git a/src/nsterm.m b/src/nsterm.m
index 583db79b904..01303829d2f 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -650,7 +650,7 @@ ns_update_window_begin (struct window *w)
650 struct frame *f = XFRAME (WINDOW_FRAME (w)); 650 struct frame *f = XFRAME (WINDOW_FRAME (w));
651 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); 651 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
652 NSTRACE (ns_update_window_begin); 652 NSTRACE (ns_update_window_begin);
653 653 fprintf(stderr, "%s\n", __func__);
654 updated_window = w; 654 updated_window = w;
655 set_output_cursor (&w->cursor); 655 set_output_cursor (&w->cursor);
656 656
@@ -683,6 +683,7 @@ ns_update_window_end (struct window *w, int cursor_on_p,
683{ 683{
684 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (w->frame)); 684 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (w->frame));
685 685
686 fprintf(stderr, "%s\n", __func__);
686 /* note: this fn is nearly identical in all terms */ 687 /* note: this fn is nearly identical in all terms */
687 if (!w->pseudo_window_p) 688 if (!w->pseudo_window_p)
688 { 689 {
@@ -1266,6 +1267,7 @@ x_set_window_size (struct frame *f, int change_grav, int cols, int rows)
1266 wr.origin.y += FRAME_PIXEL_HEIGHT (f) - pixelheight; 1267 wr.origin.y += FRAME_PIXEL_HEIGHT (f) - pixelheight;
1267 1268
1268 [view setRows: rows andColumns: cols]; 1269 [view setRows: rows andColumns: cols];
1270 fprintf(stderr, "%s %d %d\n", __func__, cols, (int)wr.origin.x);
1269 [window setFrame: wr display: YES]; 1271 [window setFrame: wr display: YES];
1270 1272
1271/*fprintf (stderr, "\tx_set_window_size %d, %d\t%d, %d\n", cols, rows, pixelwidth, pixelheight); */ 1273/*fprintf (stderr, "\tx_set_window_size %d, %d\t%d, %d\n", cols, rows, pixelwidth, pixelheight); */
@@ -1283,6 +1285,7 @@ x_set_window_size (struct frame *f, int change_grav, int cols, int rows)
1283 - NS_SCROLL_BAR_WIDTH (f), 0) 1285 - NS_SCROLL_BAR_WIDTH (f), 0)
1284 : NSMakePoint (0, 0); 1286 : NSMakePoint (0, 0);
1285 [view setFrame: NSMakeRect (0, 0, pixelwidth, pixelheight)]; 1287 [view setFrame: NSMakeRect (0, 0, pixelwidth, pixelheight)];
1288 fprintf(stderr, "%s origin %d\n", __func__, (int)origin.x);
1286 [view setBoundsOrigin: origin]; 1289 [view setBoundsOrigin: origin];
1287 } 1290 }
1288 1291
@@ -2297,12 +2300,20 @@ ns_draw_fringe_bitmap (struct window *w, struct glyph_row *row,
2297 [ns_lookup_indexed_color(face->background, f) set]; 2300 [ns_lookup_indexed_color(face->background, f) set];
2298 NSRectFill (r); 2301 NSRectFill (r);
2299 [img setXBMColor: ns_lookup_indexed_color(face->foreground, f)]; 2302 [img setXBMColor: ns_lookup_indexed_color(face->foreground, f)];
2303#if !defined (NS_IMPL_COCOA) || MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
2300 [img drawInRect: r 2304 [img drawInRect: r
2301 fromRect: NSZeroRect 2305 fromRect: NSZeroRect
2302 operation: NSCompositeSourceOver 2306 operation: NSCompositeSourceOver
2303 fraction: 1.0 2307 fraction: 1.0
2304 respectFlipped: YES 2308 respectFlipped: YES
2305 hints: nil]; 2309 hints: nil];
2310#else
2311 {
2312 NSPoint pt = r.origin;
2313 pt.y += p->h;
2314 [img compositeToPoint: pt operation: NSCompositeSourceOver];
2315 }
2316#endif
2306 } 2317 }
2307 ns_unfocus (f); 2318 ns_unfocus (f);
2308} 2319}
@@ -2961,12 +2972,19 @@ ns_dumpglyphs_image (struct glyph_string *s, NSRect r)
2961 2972
2962 /* Draw the image.. do we need to draw placeholder if img ==nil? */ 2973 /* Draw the image.. do we need to draw placeholder if img ==nil? */
2963 if (img != nil) 2974 if (img != nil)
2975 {
2976#if !defined (NS_IMPL_COCOA) || MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
2964 [img drawInRect: br 2977 [img drawInRect: br
2965 fromRect: NSZeroRect 2978 fromRect: NSZeroRect
2966 operation: NSCompositeSourceOver 2979 operation: NSCompositeSourceOver
2967 fraction: 1.0 2980 fraction: 1.0
2968 respectFlipped: YES 2981 respectFlipped: YES
2969 hints: nil]; 2982 hints: nil];
2983#else
2984 [img compositeToPoint: NSMakePoint (x, y + s->slice.height)
2985 operation: NSCompositeSourceOver];
2986#endif
2987 }
2970 2988
2971 if (s->hl == DRAW_CURSOR) 2989 if (s->hl == DRAW_CURSOR)
2972 { 2990 {
@@ -5380,6 +5398,7 @@ not_in_argv (NSString *arg)
5380 change_frame_size (emacsframe, rows, cols, 0, 0, 1); 5398 change_frame_size (emacsframe, rows, cols, 0, 0, 1);
5381 SET_FRAME_GARBAGED (emacsframe); 5399 SET_FRAME_GARBAGED (emacsframe);
5382 cancel_mouse_face (emacsframe); 5400 cancel_mouse_face (emacsframe);
5401 fprintf(stderr, "%s %d %d\n", __func__, cols, neww);
5383 [view setFrame: NSMakeRect (0, 0, neww, newh)]; 5402 [view setFrame: NSMakeRect (0, 0, neww, newh)];
5384 } 5403 }
5385} 5404}
@@ -6196,8 +6215,20 @@ not_in_argv (NSString *arg)
6196 NSTRACE (constrainFrameRect); 6215 NSTRACE (constrainFrameRect);
6197 6216
6198 if (nr_screens == 1) 6217 if (nr_screens == 1)
6199 return [super constrainFrameRect:frameRect toScreen:screen]; 6218 {
6200 6219 NSRect r = [super constrainFrameRect:frameRect toScreen:screen];
6220 fprintf(stderr, "%s %d/%d %d/%d => %d/%d %d/%d\n", __func__,
6221 (int)frameRect.origin.x,
6222 (int)frameRect.origin.y,
6223 (int)frameRect.size.width,
6224 (int)frameRect.size.height,
6225 (int)r.origin.x,
6226 (int)r.origin.y,
6227 (int)r.size.width,
6228 (int)r.size.height);
6229 return r;
6230 }
6231
6201 if (f->output_data.ns->dont_constrain 6232 if (f->output_data.ns->dont_constrain
6202 || ns_menu_bar_should_be_hidden ()) 6233 || ns_menu_bar_should_be_hidden ())
6203 return frameRect; 6234 return frameRect;