aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStefan Monnier2014-11-16 00:22:20 -0500
committerStefan Monnier2014-11-16 00:22:20 -0500
commit9075fcc1937a211bc91e8bc49c332bc55ac99e24 (patch)
tree1cff4991107011e0b5d13fac46b0881c30d31a63 /src
parent86009dd5d886f1101358990e4f8f69a5d1467eb8 (diff)
parent4f4cf9c855f5818d4c3c0fb772db8bbcf4f33780 (diff)
downloademacs-9075fcc1937a211bc91e8bc49c332bc55ac99e24.tar.gz
emacs-9075fcc1937a211bc91e8bc49c332bc55ac99e24.zip
Merge from emacs-24
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog24
-rw-r--r--src/nsfns.m23
-rw-r--r--src/nsmenu.m5
-rw-r--r--src/nsterm.m1
-rw-r--r--src/window.c18
-rw-r--r--src/window.h2
6 files changed, 60 insertions, 13 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index cf352183414..7bb16668406 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,22 @@
12014-11-16 Eli Zaretskii <eliz@gnu.org>
2
3 * window.c (window_scroll_pixel_based): Avoid truncation/rounding
4 errors in computing the number of pixels to scroll. Suggested by
5 Kelly Dean <kelly@prtime.org>. (Bug#19060)
6
72014-11-16 Jan Djärv <jan.h.d@swipnet.se>
8
9 * nsmenu.m (update_frame_tool_bar): If tool bar changes height,
10 call updateFrameSize.
11
12 * nsterm.m (setFrame:): Remove call to display (Bug#18757).
13
142014-11-16 Jan Djärv <jan.h.d@swipnet.se>
15
16 * nsfns.m (x_set_foreground_color, x_set_background_color)
17 (x_set_cursor_color, Fxw_color_values): Block/unblock input,
18 use SET_FRAME_GARBAGED instead of redraw_frame (Bug#19036).
19
12014-11-15 Jan Djärv <jan.h.d@swipnet.se> 202014-11-15 Jan Djärv <jan.h.d@swipnet.se>
2 21
3 * nsterm.m (ns_send_appdefined): Check for application defined 22 * nsterm.m (ns_send_appdefined): Check for application defined
@@ -6,7 +25,7 @@
6 25
72014-11-14 David Reitter <david.reitter@gmail.com> 262014-11-14 David Reitter <david.reitter@gmail.com>
8 27
9 * nsterm.m (run): set timeout for event loop to prevent hang. 28 * nsterm.m (run): Set timeout for event loop to prevent hang.
10 (Bug#18993) 29 (Bug#18993)
11 30
122014-11-14 Paul Eggert <eggert@cs.ucla.edu> 312014-11-14 Paul Eggert <eggert@cs.ucla.edu>
@@ -2856,8 +2875,7 @@
2856 Consider horizontal scroll bar. 2875 Consider horizontal scroll bar.
2857 (check_frame_size, adjust_window_margins): Remove functions and 2876 (check_frame_size, adjust_window_margins): Remove functions and
2858 corresponding calls. 2877 corresponding calls.
2859 (set_window_buffer): Initialize old_pointm and horizontal scroll 2878 (set_window_buffer): Initialize old_pointm and horizontal scroll bars.
2860 bars.
2861 (temp_output_buffer_show): Reset hscroll related fields. 2879 (temp_output_buffer_show): Reset hscroll related fields.
2862 Initialize old_pointm. 2880 Initialize old_pointm.
2863 (make_parent_window): Initialize old_pointm. 2881 (make_parent_window): Initialize old_pointm.
diff --git a/src/nsfns.m b/src/nsfns.m
index c4b273c3bf5..4f158f4c51e 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -280,9 +280,14 @@ x_set_foreground_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
280 NSColor *col; 280 NSColor *col;
281 EmacsCGFloat r, g, b, alpha; 281 EmacsCGFloat r, g, b, alpha;
282 282
283 /* Must block_input, because ns_lisp_to_color does block/unblock_input
284 which means that col may be deallocated in its unblock_input if there
285 is user input, unless we also block_input. */
286 block_input ();
283 if (ns_lisp_to_color (arg, &col)) 287 if (ns_lisp_to_color (arg, &col))
284 { 288 {
285 store_frame_param (f, Qforeground_color, oldval); 289 store_frame_param (f, Qforeground_color, oldval);
290 unblock_input ();
286 error ("Unknown color"); 291 error ("Unknown color");
287 } 292 }
288 293
@@ -299,8 +304,9 @@ x_set_foreground_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
299 update_face_from_frame_parameter (f, Qforeground_color, arg); 304 update_face_from_frame_parameter (f, Qforeground_color, arg);
300 /*recompute_basic_faces (f); */ 305 /*recompute_basic_faces (f); */
301 if (FRAME_VISIBLE_P (f)) 306 if (FRAME_VISIBLE_P (f))
302 redraw_frame (f); 307 SET_FRAME_GARBAGED (f);
303 } 308 }
309 unblock_input ();
304} 310}
305 311
306 312
@@ -312,9 +318,11 @@ x_set_background_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
312 NSView *view = FRAME_NS_VIEW (f); 318 NSView *view = FRAME_NS_VIEW (f);
313 EmacsCGFloat r, g, b, alpha; 319 EmacsCGFloat r, g, b, alpha;
314 320
321 block_input ();
315 if (ns_lisp_to_color (arg, &col)) 322 if (ns_lisp_to_color (arg, &col))
316 { 323 {
317 store_frame_param (f, Qbackground_color, oldval); 324 store_frame_param (f, Qbackground_color, oldval);
325 unblock_input ();
318 error ("Unknown color"); 326 error ("Unknown color");
319 } 327 }
320 328
@@ -351,8 +359,9 @@ x_set_background_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
351 } 359 }
352 360
353 if (FRAME_VISIBLE_P (f)) 361 if (FRAME_VISIBLE_P (f))
354 redraw_frame (f); 362 SET_FRAME_GARBAGED (f);
355 } 363 }
364 unblock_input ();
356} 365}
357 366
358 367
@@ -361,9 +370,11 @@ x_set_cursor_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
361{ 370{
362 NSColor *col; 371 NSColor *col;
363 372
373 block_input ();
364 if (ns_lisp_to_color (arg, &col)) 374 if (ns_lisp_to_color (arg, &col))
365 { 375 {
366 store_frame_param (f, Qcursor_color, oldval); 376 store_frame_param (f, Qcursor_color, oldval);
377 unblock_input ();
367 error ("Unknown color"); 378 error ("Unknown color");
368 } 379 }
369 380
@@ -376,6 +387,7 @@ x_set_cursor_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
376 x_update_cursor (f, 1); 387 x_update_cursor (f, 1);
377 } 388 }
378 update_face_from_frame_parameter (f, Qcursor_color, arg); 389 update_face_from_frame_parameter (f, Qcursor_color, arg);
390 unblock_input ();
379} 391}
380 392
381 393
@@ -2331,11 +2343,16 @@ DEFUN ("xw-color-values", Fxw_color_values, Sxw_color_values, 1, 2, 0,
2331 check_window_system (NULL); 2343 check_window_system (NULL);
2332 CHECK_STRING (color); 2344 CHECK_STRING (color);
2333 2345
2346 block_input ();
2334 if (ns_lisp_to_color (color, &col)) 2347 if (ns_lisp_to_color (color, &col))
2335 return Qnil; 2348 {
2349 unblock_input ();
2350 return Qnil;
2351 }
2336 2352
2337 [[col colorUsingDefaultColorSpace] 2353 [[col colorUsingDefaultColorSpace]
2338 getRed: &red green: &green blue: &blue alpha: &alpha]; 2354 getRed: &red green: &green blue: &blue alpha: &alpha];
2355 unblock_input ();
2339 return list3i (lrint (red * 65280), lrint (green * 65280), 2356 return list3i (lrint (red * 65280), lrint (green * 65280),
2340 lrint (blue * 65280)); 2357 lrint (blue * 65280));
2341} 2358}
diff --git a/src/nsmenu.m b/src/nsmenu.m
index a90cb970874..0e8b68b38f1 100644
--- a/src/nsmenu.m
+++ b/src/nsmenu.m
@@ -1026,10 +1026,13 @@ update_frame_tool_bar (struct frame *f)
1026 EmacsView *view = FRAME_NS_VIEW (f); 1026 EmacsView *view = FRAME_NS_VIEW (f);
1027 NSWindow *window = [view window]; 1027 NSWindow *window = [view window];
1028 EmacsToolbar *toolbar = [view toolbar]; 1028 EmacsToolbar *toolbar = [view toolbar];
1029 int oldh;
1029 1030
1030 if (view == nil || toolbar == nil) return; 1031 if (view == nil || toolbar == nil) return;
1031 block_input (); 1032 block_input ();
1032 1033
1034 oldh = FRAME_TOOLBAR_HEIGHT (f);
1035
1033#ifdef NS_IMPL_COCOA 1036#ifdef NS_IMPL_COCOA
1034 [toolbar clearActive]; 1037 [toolbar clearActive];
1035#else 1038#else
@@ -1136,6 +1139,8 @@ update_frame_tool_bar (struct frame *f)
1136 if (FRAME_TOOLBAR_HEIGHT (f) < 0) // happens if frame is fullscreen. 1139 if (FRAME_TOOLBAR_HEIGHT (f) < 0) // happens if frame is fullscreen.
1137 FRAME_TOOLBAR_HEIGHT (f) = 0; 1140 FRAME_TOOLBAR_HEIGHT (f) = 0;
1138 1141
1142 if (oldh != FRAME_TOOLBAR_HEIGHT (f))
1143 [view updateFrameSize:YES];
1139 if (view->wait_for_tool_bar && FRAME_TOOLBAR_HEIGHT (f) > 0) 1144 if (view->wait_for_tool_bar && FRAME_TOOLBAR_HEIGHT (f) > 0)
1140 { 1145 {
1141 view->wait_for_tool_bar = NO; 1146 view->wait_for_tool_bar = NO;
diff --git a/src/nsterm.m b/src/nsterm.m
index c36b9ed4554..8729fa55a92 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -7213,7 +7213,6 @@ if (cols > 0 && rows > 0)
7213 if (pixel_height == 0) pixel_height = 1; 7213 if (pixel_height == 0) pixel_height = 1;
7214 min_portion = 20 / pixel_height; 7214 min_portion = 20 / pixel_height;
7215 [super setFrame: newRect]; 7215 [super setFrame: newRect];
7216 [self display];
7217/* unblock_input (); */ 7216/* unblock_input (); */
7218} 7217}
7219 7218
diff --git a/src/window.c b/src/window.c
index e4ff2b41806..7c2b3ca29d2 100644
--- a/src/window.c
+++ b/src/window.c
@@ -4950,9 +4950,14 @@ window_scroll_pixel_based (Lisp_Object window, int n, bool whole, int noerror)
4950 { 4950 {
4951 int px; 4951 int px;
4952 int dy = frame_line_height; 4952 int dy = frame_line_height;
4953 /* In the below we divide the window box height by the
4954 frame's line height to make the result predictable when
4955 the window box is not an integral multiple of the line
4956 height. This is important to ensure we get back to the
4957 same position when scrolling up, then down. */
4953 if (whole) 4958 if (whole)
4954 dy = max ((window_box_height (w) 4959 dy = max ((window_box_height (w) / dy
4955 - next_screen_context_lines * dy), 4960 - next_screen_context_lines) * dy,
4956 dy); 4961 dy);
4957 dy *= n; 4962 dy *= n;
4958 4963
@@ -5034,9 +5039,12 @@ window_scroll_pixel_based (Lisp_Object window, int n, bool whole, int noerror)
5034 { 5039 {
5035 ptrdiff_t start_pos = IT_CHARPOS (it); 5040 ptrdiff_t start_pos = IT_CHARPOS (it);
5036 int dy = frame_line_height; 5041 int dy = frame_line_height;
5037 5042 /* In the below we divide the window box height by the frame's
5038 dy = max ((window_box_height (w) 5043 line height to make the result predictable when the window
5039 - next_screen_context_lines * dy), 5044 box is not an integral multiple of the line height. This is
5045 important to ensure we get back to the same position when
5046 scrolling up, then down. */
5047 dy = max ((window_box_height (w) / dy - next_screen_context_lines) * dy,
5040 dy) * n; 5048 dy) * n;
5041 5049
5042 /* Note that move_it_vertically always moves the iterator to the 5050 /* Note that move_it_vertically always moves the iterator to the
diff --git a/src/window.h b/src/window.h
index ea5dddc9fc8..4e4c65b83e6 100644
--- a/src/window.h
+++ b/src/window.h
@@ -519,7 +519,7 @@ wset_next_buffers (struct window *w, Lisp_Object val)
519#define WINDOW_FRAME_COLUMN_WIDTH(W) \ 519#define WINDOW_FRAME_COLUMN_WIDTH(W) \
520 (FRAME_COLUMN_WIDTH (WINDOW_XFRAME ((W)))) 520 (FRAME_COLUMN_WIDTH (WINDOW_XFRAME ((W))))
521 521
522/* Return the canonical column width of the frame of window W. */ 522/* Return the canonical line height of the frame of window W. */
523#define WINDOW_FRAME_LINE_HEIGHT(W) \ 523#define WINDOW_FRAME_LINE_HEIGHT(W) \
524 (FRAME_LINE_HEIGHT (WINDOW_XFRAME ((W)))) 524 (FRAME_LINE_HEIGHT (WINDOW_XFRAME ((W))))
525 525