diff options
| author | Miles Bader | 2006-03-09 07:15:37 +0000 |
|---|---|---|
| committer | Miles Bader | 2006-03-09 07:15:37 +0000 |
| commit | b1af5d6a27620aacc93a9a34bc242488c15e668b (patch) | |
| tree | 6f6fe2a93497d6149a5deb60dbd3e204315ed31b /src | |
| parent | 845df8100b62cafb758936ff333a0a1088d2220f (diff) | |
| parent | 61e66a158a521e1ebdaa2e547dcc98d383674a75 (diff) | |
| download | emacs-b1af5d6a27620aacc93a9a34bc242488c15e668b.tar.gz emacs-b1af5d6a27620aacc93a9a34bc242488c15e668b.zip | |
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-40
Merge from emacs--devo--0
Patches applied:
* emacs--devo--0 (patch 135-143)
- Update from CVS
- Merge from gnus--rel--5.10
* gnus--rel--5.10 (patch 49-55)
- Merge from emacs--devo--0
- Update from CVS
- Update from CVS: Makefile.in (release-*): New targets.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 45 | ||||
| -rw-r--r-- | src/image.c | 4 | ||||
| -rw-r--r-- | src/macfns.c | 31 | ||||
| -rw-r--r-- | src/macterm.c | 171 | ||||
| -rw-r--r-- | src/macterm.h | 4 | ||||
| -rw-r--r-- | src/window.c | 7 | ||||
| -rw-r--r-- | src/xdisp.c | 7 | ||||
| -rw-r--r-- | src/xselect.c | 1 |
8 files changed, 191 insertions, 79 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 6edf4d43587..a72b3fc7956 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,48 @@ | |||
| 1 | 2006-03-08 Luc Teirlinck <teirllm@auburn.edu> | ||
| 2 | |||
| 3 | * window.c: Declare preserve_y as a static global variable. | ||
| 4 | (window_scroll_pixel_based): No longer declare preserve_y; | ||
| 5 | it is global now. | ||
| 6 | (syms_of_window): set preserve_y to -1. | ||
| 7 | |||
| 8 | 2006-03-08 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | ||
| 9 | |||
| 10 | * image.c [MAC_OS] (XPutPixel): Set alpha channel bits if pixmap | ||
| 11 | depth is 32. | ||
| 12 | [MAC_OS] (XGetPixel): Strip off alpha channel bits if pixmap | ||
| 13 | depth is 32. | ||
| 14 | |||
| 15 | 2006-03-06 Chong Yidong <cyd@stupidchicken.com> | ||
| 16 | |||
| 17 | * xdisp.c (handle_invisible_prop): Don't update it->position with | ||
| 18 | a buffer position if we're in a display string. | ||
| 19 | |||
| 20 | 2006-03-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | ||
| 21 | |||
| 22 | * macterm.h (MAC_AQUA_VERTICAL_SCROLL_BAR_WIDTH) | ||
| 23 | (MAC_AQUA_SMALL_VERTICAL_SCROLL_BAR_WIDTH): New defines. | ||
| 24 | |||
| 25 | * macfns.c (x_default_scroll_bar_color_parameter) | ||
| 26 | (x_set_scroll_bar_foreground, x_set_scroll_bar_background): Remove | ||
| 27 | unnecessary prototypes. | ||
| 28 | (x_set_scroll_bar_default_width): Use | ||
| 29 | MAC_AQUA_VERTICAL_SCROLL_BAR_WIDTH. | ||
| 30 | (mac_set_scroll_bar_width): New function. | ||
| 31 | (mac_frame_parm_handlers): Set it as handler for scroll-bar-width. | ||
| 32 | |||
| 33 | * macterm.c (get_control_part_bounds): Fix type of return value. | ||
| 34 | (x_set_toolkit_scroll_bar_thumb, x_scroll_bar_create) | ||
| 35 | (XTset_vertical_scroll_bar) [USE_TOOLKIT_SCROLL_BARS]: Don't show | ||
| 36 | scroll bar if it is not tall enough to display scroll bar thumb. | ||
| 37 | [USE_CARBON_EVENTS] (mac_convert_event_ref) | ||
| 38 | (mac_handle_command_event, mac_handle_window_event) | ||
| 39 | (mac_handle_mouse_event): Check error code of GetEventParameter. | ||
| 40 | (convert_fn_keycode) [MAC_OSX]: Likewise. | ||
| 41 | |||
| 42 | 2006-03-05 Andreas Schwab <schwab@suse.de> | ||
| 43 | |||
| 44 | * xselect.c (x_catch_errors_unwind): Fix missing return value. | ||
| 45 | |||
| 1 | 2006-03-02 Kim F. Storm <storm@cua.dk> | 46 | 2006-03-02 Kim F. Storm <storm@cua.dk> |
| 2 | 47 | ||
| 3 | * frame.h (struct frame): New member n_tool_bar_rows. | 48 | * frame.h (struct frame): New member n_tool_bar_rows. |
diff --git a/src/image.c b/src/image.c index 879bbf745a3..cbdff81eba7 100644 --- a/src/image.c +++ b/src/image.c | |||
| @@ -194,7 +194,7 @@ XPutPixel (ximage, x, y, pixel) | |||
| 194 | char *base_addr = GetPixBaseAddr (pixmap); | 194 | char *base_addr = GetPixBaseAddr (pixmap); |
| 195 | short row_bytes = GetPixRowBytes (pixmap); | 195 | short row_bytes = GetPixRowBytes (pixmap); |
| 196 | 196 | ||
| 197 | ((unsigned long *) (base_addr + y * row_bytes))[x] = pixel; | 197 | ((unsigned long *) (base_addr + y * row_bytes))[x] = 0xff000000 | pixel; |
| 198 | } | 198 | } |
| 199 | else if (depth == 1) | 199 | else if (depth == 1) |
| 200 | { | 200 | { |
| @@ -238,7 +238,7 @@ XGetPixel (ximage, x, y) | |||
| 238 | char *base_addr = GetPixBaseAddr (pixmap); | 238 | char *base_addr = GetPixBaseAddr (pixmap); |
| 239 | short row_bytes = GetPixRowBytes (pixmap); | 239 | short row_bytes = GetPixRowBytes (pixmap); |
| 240 | 240 | ||
| 241 | return ((unsigned long *) (base_addr + y * row_bytes))[x]; | 241 | return ((unsigned long *) (base_addr + y * row_bytes))[x] & 0x00ffffff; |
| 242 | } | 242 | } |
| 243 | else if (depth == 1) | 243 | else if (depth == 1) |
| 244 | { | 244 | { |
diff --git a/src/macfns.c b/src/macfns.c index 92c8b28adce..dfe7fc31050 100644 --- a/src/macfns.c +++ b/src/macfns.c | |||
| @@ -210,15 +210,6 @@ void x_explicitly_set_name P_ ((struct frame *, Lisp_Object, Lisp_Object)); | |||
| 210 | void x_set_menu_bar_lines P_ ((struct frame *, Lisp_Object, Lisp_Object)); | 210 | void x_set_menu_bar_lines P_ ((struct frame *, Lisp_Object, Lisp_Object)); |
| 211 | void x_set_title P_ ((struct frame *, Lisp_Object, Lisp_Object)); | 211 | void x_set_title P_ ((struct frame *, Lisp_Object, Lisp_Object)); |
| 212 | void x_set_tool_bar_lines P_ ((struct frame *, Lisp_Object, Lisp_Object)); | 212 | void x_set_tool_bar_lines P_ ((struct frame *, Lisp_Object, Lisp_Object)); |
| 213 | void x_set_scroll_bar_foreground P_ ((struct frame *, Lisp_Object, | ||
| 214 | Lisp_Object)); | ||
| 215 | void x_set_scroll_bar_background P_ ((struct frame *, Lisp_Object, | ||
| 216 | Lisp_Object)); | ||
| 217 | static Lisp_Object x_default_scroll_bar_color_parameter P_ ((struct frame *, | ||
| 218 | Lisp_Object, | ||
| 219 | Lisp_Object, | ||
| 220 | char *, char *, | ||
| 221 | int)); | ||
| 222 | 213 | ||
| 223 | extern void mac_get_window_bounds P_ ((struct frame *, Rect *, Rect *)); | 214 | extern void mac_get_window_bounds P_ ((struct frame *, Rect *, Rect *)); |
| 224 | 215 | ||
| @@ -1897,7 +1888,7 @@ x_set_scroll_bar_default_width (f) | |||
| 1897 | int wid = FRAME_COLUMN_WIDTH (f); | 1888 | int wid = FRAME_COLUMN_WIDTH (f); |
| 1898 | 1889 | ||
| 1899 | #ifdef MAC_OSX | 1890 | #ifdef MAC_OSX |
| 1900 | FRAME_CONFIG_SCROLL_BAR_WIDTH (f) = 16; /* Aqua scroll bars. */ | 1891 | FRAME_CONFIG_SCROLL_BAR_WIDTH (f) = MAC_AQUA_VERTICAL_SCROLL_BAR_WIDTH; |
| 1901 | FRAME_CONFIG_SCROLL_BAR_COLS (f) = (FRAME_CONFIG_SCROLL_BAR_WIDTH (f) + | 1892 | FRAME_CONFIG_SCROLL_BAR_COLS (f) = (FRAME_CONFIG_SCROLL_BAR_WIDTH (f) + |
| 1902 | wid - 1) / wid; | 1893 | wid - 1) / wid; |
| 1903 | #else /* not MAC_OSX */ | 1894 | #else /* not MAC_OSX */ |
| @@ -1911,6 +1902,24 @@ x_set_scroll_bar_default_width (f) | |||
| 1911 | #endif /* not MAC_OSX */ | 1902 | #endif /* not MAC_OSX */ |
| 1912 | } | 1903 | } |
| 1913 | 1904 | ||
| 1905 | void | ||
| 1906 | mac_set_scroll_bar_width (f, arg, oldval) | ||
| 1907 | struct frame *f; | ||
| 1908 | Lisp_Object arg, oldval; | ||
| 1909 | { | ||
| 1910 | #ifdef MAC_OSX | ||
| 1911 | if (INTEGERP (arg) && XINT (arg) > 0) | ||
| 1912 | { | ||
| 1913 | if (XINT (arg) < (MAC_AQUA_SMALL_VERTICAL_SCROLL_BAR_WIDTH | ||
| 1914 | + MAC_AQUA_VERTICAL_SCROLL_BAR_WIDTH) / 2) | ||
| 1915 | XSETINT (arg, MAC_AQUA_SMALL_VERTICAL_SCROLL_BAR_WIDTH); | ||
| 1916 | else | ||
| 1917 | XSETINT (arg, MAC_AQUA_VERTICAL_SCROLL_BAR_WIDTH); | ||
| 1918 | } | ||
| 1919 | #endif | ||
| 1920 | x_set_scroll_bar_width (f, arg, oldval); | ||
| 1921 | } | ||
| 1922 | |||
| 1914 | 1923 | ||
| 1915 | /* Subroutines of creating a frame. */ | 1924 | /* Subroutines of creating a frame. */ |
| 1916 | 1925 | ||
| @@ -4373,7 +4382,7 @@ frame_parm_handler mac_frame_parm_handlers[] = | |||
| 4373 | x_set_menu_bar_lines, | 4382 | x_set_menu_bar_lines, |
| 4374 | x_set_mouse_color, | 4383 | x_set_mouse_color, |
| 4375 | x_explicitly_set_name, | 4384 | x_explicitly_set_name, |
| 4376 | x_set_scroll_bar_width, | 4385 | mac_set_scroll_bar_width, |
| 4377 | x_set_title, | 4386 | x_set_title, |
| 4378 | x_set_unsplittable, | 4387 | x_set_unsplittable, |
| 4379 | x_set_vertical_scroll_bars, | 4388 | x_set_vertical_scroll_bars, |
diff --git a/src/macterm.c b/src/macterm.c index 5f7c5dac637..d9b08d4f9d6 100644 --- a/src/macterm.c +++ b/src/macterm.c | |||
| @@ -4267,8 +4267,8 @@ static OSStatus set_scroll_bar_timer P_ ((EventTimerInterval)); | |||
| 4267 | static int control_part_code_to_scroll_bar_part P_ ((ControlPartCode)); | 4267 | static int control_part_code_to_scroll_bar_part P_ ((ControlPartCode)); |
| 4268 | static void construct_scroll_bar_click P_ ((struct scroll_bar *, int, | 4268 | static void construct_scroll_bar_click P_ ((struct scroll_bar *, int, |
| 4269 | struct input_event *)); | 4269 | struct input_event *)); |
| 4270 | static OSErr get_control_part_bounds P_ ((ControlHandle, ControlPartCode, | 4270 | static OSStatus get_control_part_bounds P_ ((ControlHandle, ControlPartCode, |
| 4271 | Rect *)); | 4271 | Rect *)); |
| 4272 | static void x_scroll_bar_handle_press P_ ((struct scroll_bar *, | 4272 | static void x_scroll_bar_handle_press P_ ((struct scroll_bar *, |
| 4273 | ControlPartCode, | 4273 | ControlPartCode, |
| 4274 | struct input_event *)); | 4274 | struct input_event *)); |
| @@ -4389,7 +4389,7 @@ construct_scroll_bar_click (bar, part, bufp) | |||
| 4389 | bufp->modifiers = 0; | 4389 | bufp->modifiers = 0; |
| 4390 | } | 4390 | } |
| 4391 | 4391 | ||
| 4392 | static OSErr | 4392 | static OSStatus |
| 4393 | get_control_part_bounds (ch, part_code, rect) | 4393 | get_control_part_bounds (ch, part_code, rect) |
| 4394 | ControlHandle ch; | 4394 | ControlHandle ch; |
| 4395 | ControlPartCode part_code; | 4395 | ControlPartCode part_code; |
| @@ -4533,7 +4533,10 @@ x_set_toolkit_scroll_bar_thumb (bar, portion, position, whole) | |||
| 4533 | ControlHandle ch = SCROLL_BAR_CONTROL_HANDLE (bar); | 4533 | ControlHandle ch = SCROLL_BAR_CONTROL_HANDLE (bar); |
| 4534 | int value, viewsize, maximum; | 4534 | int value, viewsize, maximum; |
| 4535 | 4535 | ||
| 4536 | if (whole == 0 || XINT (bar->track_height) == 0) | 4536 | if (XINT (bar->track_height) == 0) |
| 4537 | return; | ||
| 4538 | |||
| 4539 | if (whole == 0) | ||
| 4537 | value = 0, viewsize = 1, maximum = 0; | 4540 | value = 0, viewsize = 1, maximum = 0; |
| 4538 | else | 4541 | else |
| 4539 | { | 4542 | { |
| @@ -4544,10 +4547,9 @@ x_set_toolkit_scroll_bar_thumb (bar, portion, position, whole) | |||
| 4544 | 4547 | ||
| 4545 | BLOCK_INPUT; | 4548 | BLOCK_INPUT; |
| 4546 | 4549 | ||
| 4547 | if (IsControlVisible (ch) | 4550 | if (GetControlViewSize (ch) != viewsize |
| 4548 | && (GetControlViewSize (ch) != viewsize | 4551 | || GetControl32BitValue (ch) != value |
| 4549 | || GetControl32BitValue (ch) != value | 4552 | || GetControl32BitMaximum (ch) != maximum) |
| 4550 | || GetControl32BitMaximum (ch) != maximum)) | ||
| 4551 | { | 4553 | { |
| 4552 | /* Temporarily hide the scroll bar to avoid multiple redraws. */ | 4554 | /* Temporarily hide the scroll bar to avoid multiple redraws. */ |
| 4553 | SetControlVisibility (ch, false, false); | 4555 | SetControlVisibility (ch, false, false); |
| @@ -4594,7 +4596,12 @@ x_scroll_bar_create (w, top, left, width, height, disp_top, disp_height) | |||
| 4594 | r.bottom = disp_top + disp_height; | 4596 | r.bottom = disp_top + disp_height; |
| 4595 | 4597 | ||
| 4596 | #if TARGET_API_MAC_CARBON | 4598 | #if TARGET_API_MAC_CARBON |
| 4597 | ch = NewControl (FRAME_MAC_WINDOW (f), &r, "\p", width < disp_height, | 4599 | ch = NewControl (FRAME_MAC_WINDOW (f), &r, "\p", |
| 4600 | #if USE_TOOLKIT_SCROLL_BARS | ||
| 4601 | false, | ||
| 4602 | #else | ||
| 4603 | width < disp_height, | ||
| 4604 | #endif | ||
| 4598 | 0, 0, 0, kControlScrollBarProc, (long) bar); | 4605 | 0, 0, 0, kControlScrollBarProc, (long) bar); |
| 4599 | #else | 4606 | #else |
| 4600 | ch = NewControl (FRAME_MAC_WINDOW (f), &r, "\p", width < disp_height, | 4607 | ch = NewControl (FRAME_MAC_WINDOW (f), &r, "\p", width < disp_height, |
| @@ -4764,6 +4771,7 @@ XTset_vertical_scroll_bar (w, portion, whole, position) | |||
| 4764 | /* Adjustments according to Inside Macintosh to make it look nice */ | 4771 | /* Adjustments according to Inside Macintosh to make it look nice */ |
| 4765 | disp_top = top; | 4772 | disp_top = top; |
| 4766 | disp_height = height; | 4773 | disp_height = height; |
| 4774 | #ifdef MAC_OS8 | ||
| 4767 | if (disp_top == 0) | 4775 | if (disp_top == 0) |
| 4768 | { | 4776 | { |
| 4769 | disp_top = -1; | 4777 | disp_top = -1; |
| @@ -4777,6 +4785,7 @@ XTset_vertical_scroll_bar (w, portion, whole, position) | |||
| 4777 | 4785 | ||
| 4778 | if (sb_left + sb_width == FRAME_PIXEL_WIDTH (f)) | 4786 | if (sb_left + sb_width == FRAME_PIXEL_WIDTH (f)) |
| 4779 | sb_left++; | 4787 | sb_left++; |
| 4788 | #endif | ||
| 4780 | 4789 | ||
| 4781 | /* Does the scroll bar exist yet? */ | 4790 | /* Does the scroll bar exist yet? */ |
| 4782 | if (NILP (w->vertical_scroll_bar)) | 4791 | if (NILP (w->vertical_scroll_bar)) |
| @@ -4812,8 +4821,10 @@ XTset_vertical_scroll_bar (w, portion, whole, position) | |||
| 4812 | MoveControl (ch, sb_left + VERTICAL_SCROLL_BAR_WIDTH_TRIM, disp_top); | 4821 | MoveControl (ch, sb_left + VERTICAL_SCROLL_BAR_WIDTH_TRIM, disp_top); |
| 4813 | SizeControl (ch, sb_width - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2, | 4822 | SizeControl (ch, sb_width - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2, |
| 4814 | disp_height); | 4823 | disp_height); |
| 4824 | #ifndef USE_TOOLKIT_SCROLL_BARS | ||
| 4815 | if (sb_width < disp_height) | 4825 | if (sb_width < disp_height) |
| 4816 | ShowControl (ch); | 4826 | ShowControl (ch); |
| 4827 | #endif | ||
| 4817 | 4828 | ||
| 4818 | /* Remember new settings. */ | 4829 | /* Remember new settings. */ |
| 4819 | XSETINT (bar->left, sb_left); | 4830 | XSETINT (bar->left, sb_left); |
| @@ -4831,30 +4842,41 @@ XTset_vertical_scroll_bar (w, portion, whole, position) | |||
| 4831 | 4842 | ||
| 4832 | #ifdef USE_TOOLKIT_SCROLL_BARS | 4843 | #ifdef USE_TOOLKIT_SCROLL_BARS |
| 4833 | if (NILP (bar->track_top)) | 4844 | if (NILP (bar->track_top)) |
| 4834 | { | 4845 | if (sb_width >= disp_height) |
| 4835 | ControlHandle ch = SCROLL_BAR_CONTROL_HANDLE (bar); | 4846 | { |
| 4836 | Rect r0, r1; | 4847 | XSETINT (bar->track_top, 0); |
| 4848 | XSETINT (bar->track_height, 0); | ||
| 4849 | } | ||
| 4850 | else | ||
| 4851 | { | ||
| 4852 | ControlHandle ch = SCROLL_BAR_CONTROL_HANDLE (bar); | ||
| 4853 | Rect r0, r1; | ||
| 4837 | 4854 | ||
| 4838 | BLOCK_INPUT; | 4855 | BLOCK_INPUT; |
| 4839 | 4856 | ||
| 4840 | SetControl32BitMinimum (ch, 0); | 4857 | SetControl32BitMinimum (ch, 0); |
| 4841 | SetControl32BitMaximum (ch, 1); | 4858 | SetControl32BitMaximum (ch, 1); |
| 4842 | SetControlViewSize (ch, 1); | 4859 | SetControlViewSize (ch, 1); |
| 4843 | 4860 | ||
| 4844 | /* Move the scroll bar thumb to the top. */ | 4861 | /* Move the scroll bar thumb to the top. */ |
| 4845 | SetControl32BitValue (ch, 0); | 4862 | SetControl32BitValue (ch, 0); |
| 4846 | get_control_part_bounds (ch, kControlIndicatorPart, &r0); | 4863 | get_control_part_bounds (ch, kControlIndicatorPart, &r0); |
| 4847 | 4864 | ||
| 4848 | /* Move the scroll bar thumb to the bottom. */ | 4865 | /* Move the scroll bar thumb to the bottom. */ |
| 4849 | SetControl32BitValue (ch, 1); | 4866 | SetControl32BitValue (ch, 1); |
| 4850 | get_control_part_bounds (ch, kControlIndicatorPart, &r1); | 4867 | get_control_part_bounds (ch, kControlIndicatorPart, &r1); |
| 4851 | 4868 | ||
| 4852 | UnionRect (&r0, &r1, &r0); | 4869 | UnionRect (&r0, &r1, &r0); |
| 4853 | XSETINT (bar->track_top, r0.top); | 4870 | XSETINT (bar->track_top, r0.top); |
| 4854 | XSETINT (bar->track_height, r0.bottom - r0.top); | 4871 | XSETINT (bar->track_height, r0.bottom - r0.top); |
| 4855 | 4872 | ||
| 4856 | UNBLOCK_INPUT; | 4873 | /* Don't show the scroll bar if its height is not enough to |
| 4857 | } | 4874 | display the scroll bar thumb. */ |
| 4875 | if (r0.bottom - r0.top > 0) | ||
| 4876 | ShowControl (ch); | ||
| 4877 | |||
| 4878 | UNBLOCK_INPUT; | ||
| 4879 | } | ||
| 4858 | 4880 | ||
| 4859 | x_set_toolkit_scroll_bar_thumb (bar, portion, position, whole); | 4881 | x_set_toolkit_scroll_bar_thumb (bar, portion, position, whole); |
| 4860 | #else /* not USE_TOOLKIT_SCROLL_BARS */ | 4882 | #else /* not USE_TOOLKIT_SCROLL_BARS */ |
| @@ -8408,6 +8430,7 @@ mac_get_mouse_btn (EventRef ref) | |||
| 8408 | XTread_socket loop). */ | 8430 | XTread_socket loop). */ |
| 8409 | static Boolean mac_convert_event_ref (EventRef eventRef, EventRecord *eventRec) | 8431 | static Boolean mac_convert_event_ref (EventRef eventRef, EventRecord *eventRec) |
| 8410 | { | 8432 | { |
| 8433 | OSStatus err; | ||
| 8411 | Boolean result = ConvertEventRefToEventRecord (eventRef, eventRec); | 8434 | Boolean result = ConvertEventRefToEventRecord (eventRef, eventRec); |
| 8412 | 8435 | ||
| 8413 | if (result) | 8436 | if (result) |
| @@ -8441,13 +8464,19 @@ static Boolean mac_convert_event_ref (EventRef eventRef, EventRecord *eventRec) | |||
| 8441 | unsigned char char_codes; | 8464 | unsigned char char_codes; |
| 8442 | UInt32 key_code; | 8465 | UInt32 key_code; |
| 8443 | 8466 | ||
| 8444 | eventRec->what = keyDown; | 8467 | err = GetEventParameter (eventRef, kEventParamKeyMacCharCodes, |
| 8445 | GetEventParameter (eventRef, kEventParamKeyMacCharCodes, typeChar, | 8468 | typeChar, NULL, sizeof (char), |
| 8446 | NULL, sizeof (char), NULL, &char_codes); | 8469 | NULL, &char_codes); |
| 8447 | GetEventParameter (eventRef, kEventParamKeyCode, typeUInt32, | 8470 | if (err == noErr) |
| 8448 | NULL, sizeof (UInt32), NULL, &key_code); | 8471 | err = GetEventParameter (eventRef, kEventParamKeyCode, |
| 8449 | eventRec->message = char_codes | ((key_code & 0xff) << 8); | 8472 | typeUInt32, NULL, sizeof (UInt32), |
| 8450 | result = 1; | 8473 | NULL, &key_code); |
| 8474 | if (err == noErr) | ||
| 8475 | { | ||
| 8476 | eventRec->what = keyDown; | ||
| 8477 | eventRec->message = char_codes | ((key_code & 0xff) << 8); | ||
| 8478 | result = 1; | ||
| 8479 | } | ||
| 8451 | } | 8480 | } |
| 8452 | break; | 8481 | break; |
| 8453 | 8482 | ||
| @@ -8463,7 +8492,7 @@ static Boolean mac_convert_event_ref (EventRef eventRef, EventRecord *eventRec) | |||
| 8463 | if (result) | 8492 | if (result) |
| 8464 | { | 8493 | { |
| 8465 | /* Need where and when. */ | 8494 | /* Need where and when. */ |
| 8466 | UInt32 mods; | 8495 | UInt32 mods = 0; |
| 8467 | 8496 | ||
| 8468 | GetEventParameter (eventRef, kEventParamMouseLocation, typeQDPoint, | 8497 | GetEventParameter (eventRef, kEventParamMouseLocation, typeQDPoint, |
| 8469 | NULL, sizeof (Point), NULL, &eventRec->where); | 8498 | NULL, sizeof (Point), NULL, &eventRec->where); |
| @@ -8873,8 +8902,7 @@ mac_handle_command_event (next_handler, event, data) | |||
| 8873 | EventRef event; | 8902 | EventRef event; |
| 8874 | void *data; | 8903 | void *data; |
| 8875 | { | 8904 | { |
| 8876 | OSStatus result; | 8905 | OSStatus result, err; |
| 8877 | OSErr err; | ||
| 8878 | HICommand command; | 8906 | HICommand command; |
| 8879 | Lisp_Object class_key, id_key, binding; | 8907 | Lisp_Object class_key, id_key, binding; |
| 8880 | 8908 | ||
| @@ -8882,10 +8910,10 @@ mac_handle_command_event (next_handler, event, data) | |||
| 8882 | if (result != eventNotHandledErr) | 8910 | if (result != eventNotHandledErr) |
| 8883 | return result; | 8911 | return result; |
| 8884 | 8912 | ||
| 8885 | GetEventParameter (event, kEventParamDirectObject, typeHICommand, NULL, | 8913 | err = GetEventParameter (event, kEventParamDirectObject, typeHICommand, |
| 8886 | sizeof (HICommand), NULL, &command); | 8914 | NULL, sizeof (HICommand), NULL, &command); |
| 8887 | 8915 | ||
| 8888 | if (command.commandID == 0) | 8916 | if (err != noErr || command.commandID == 0) |
| 8889 | return eventNotHandledErr; | 8917 | return eventNotHandledErr; |
| 8890 | 8918 | ||
| 8891 | /* A HICommand event is mapped to an Apple event whose event class | 8919 | /* A HICommand event is mapped to an Apple event whose event class |
| @@ -8939,12 +8967,14 @@ mac_handle_window_event (next_handler, event, data) | |||
| 8939 | void *data; | 8967 | void *data; |
| 8940 | { | 8968 | { |
| 8941 | WindowPtr wp; | 8969 | WindowPtr wp; |
| 8942 | OSStatus result; | 8970 | OSStatus result, err; |
| 8943 | UInt32 attributes; | 8971 | UInt32 attributes; |
| 8944 | XSizeHints *size_hints; | 8972 | XSizeHints *size_hints; |
| 8945 | 8973 | ||
| 8946 | GetEventParameter (event, kEventParamDirectObject, typeWindowRef, | 8974 | err = GetEventParameter (event, kEventParamDirectObject, typeWindowRef, |
| 8947 | NULL, sizeof (WindowPtr), NULL, &wp); | 8975 | NULL, sizeof (WindowPtr), NULL, &wp); |
| 8976 | if (err != noErr) | ||
| 8977 | return eventNotHandledErr; | ||
| 8948 | 8978 | ||
| 8949 | switch (GetEventKind (event)) | 8979 | switch (GetEventKind (event)) |
| 8950 | { | 8980 | { |
| @@ -8961,8 +8991,11 @@ mac_handle_window_event (next_handler, event, data) | |||
| 8961 | if (result != eventNotHandledErr) | 8991 | if (result != eventNotHandledErr) |
| 8962 | return result; | 8992 | return result; |
| 8963 | 8993 | ||
| 8964 | GetEventParameter (event, kEventParamAttributes, typeUInt32, | 8994 | err = GetEventParameter (event, kEventParamAttributes, typeUInt32, |
| 8965 | NULL, sizeof (UInt32), NULL, &attributes); | 8995 | NULL, sizeof (UInt32), NULL, &attributes); |
| 8996 | if (err != noErr) | ||
| 8997 | break; | ||
| 8998 | |||
| 8966 | size_hints = FRAME_SIZE_HINTS (mac_window_to_frame (wp)); | 8999 | size_hints = FRAME_SIZE_HINTS (mac_window_to_frame (wp)); |
| 8967 | if ((attributes & kWindowBoundsChangeUserResize) | 9000 | if ((attributes & kWindowBoundsChangeUserResize) |
| 8968 | && ((size_hints->flags & (PResizeInc | PBaseSize | PMinSize)) | 9001 | && ((size_hints->flags & (PResizeInc | PBaseSize | PMinSize)) |
| @@ -8971,9 +9004,12 @@ mac_handle_window_event (next_handler, event, data) | |||
| 8971 | Rect bounds; | 9004 | Rect bounds; |
| 8972 | int width, height; | 9005 | int width, height; |
| 8973 | 9006 | ||
| 8974 | GetEventParameter (event, kEventParamCurrentBounds, | 9007 | err = GetEventParameter (event, kEventParamCurrentBounds, |
| 8975 | typeQDRectangle, | 9008 | typeQDRectangle, NULL, sizeof (Rect), |
| 8976 | NULL, sizeof (Rect), NULL, &bounds); | 9009 | NULL, &bounds); |
| 9010 | if (err != noErr) | ||
| 9011 | break; | ||
| 9012 | |||
| 8977 | width = bounds.right - bounds.left; | 9013 | width = bounds.right - bounds.left; |
| 8978 | height = bounds.bottom - bounds.top; | 9014 | height = bounds.bottom - bounds.top; |
| 8979 | 9015 | ||
| @@ -9022,7 +9058,7 @@ mac_handle_mouse_event (next_handler, event, data) | |||
| 9022 | EventRef event; | 9058 | EventRef event; |
| 9023 | void *data; | 9059 | void *data; |
| 9024 | { | 9060 | { |
| 9025 | OSStatus result; | 9061 | OSStatus result, err; |
| 9026 | 9062 | ||
| 9027 | switch (GetEventKind (event)) | 9063 | switch (GetEventKind (event)) |
| 9028 | { | 9064 | { |
| @@ -9038,22 +9074,31 @@ mac_handle_mouse_event (next_handler, event, data) | |||
| 9038 | if (result != eventNotHandledErr || read_socket_inev == NULL) | 9074 | if (result != eventNotHandledErr || read_socket_inev == NULL) |
| 9039 | return result; | 9075 | return result; |
| 9040 | 9076 | ||
| 9041 | GetEventParameter (event, kEventParamWindowRef, typeWindowRef, | 9077 | err = GetEventParameter (event, kEventParamWindowRef, typeWindowRef, |
| 9042 | NULL, sizeof (WindowRef), NULL, &wp); | 9078 | NULL, sizeof (WindowRef), NULL, &wp); |
| 9079 | if (err != noErr) | ||
| 9080 | break; | ||
| 9081 | |||
| 9043 | f = mac_window_to_frame (wp); | 9082 | f = mac_window_to_frame (wp); |
| 9044 | if (f != mac_focus_frame (&one_mac_display_info)) | 9083 | if (f != mac_focus_frame (&one_mac_display_info)) |
| 9045 | break; | 9084 | break; |
| 9046 | 9085 | ||
| 9047 | GetEventParameter (event, kEventParamMouseWheelAxis, | 9086 | err = GetEventParameter (event, kEventParamMouseWheelAxis, |
| 9048 | typeMouseWheelAxis, NULL, | 9087 | typeMouseWheelAxis, NULL, |
| 9049 | sizeof (EventMouseWheelAxis), NULL, &axis); | 9088 | sizeof (EventMouseWheelAxis), NULL, &axis); |
| 9050 | if (axis != kEventMouseWheelAxisY) | 9089 | if (err != noErr || axis != kEventMouseWheelAxisY) |
| 9051 | break; | 9090 | break; |
| 9052 | 9091 | ||
| 9053 | GetEventParameter (event, kEventParamMouseWheelDelta, typeSInt32, | 9092 | err = GetEventParameter (event, kEventParamMouseWheelDelta, |
| 9054 | NULL, sizeof (SInt32), NULL, &delta); | 9093 | typeSInt32, NULL, sizeof (SInt32), |
| 9055 | GetEventParameter (event, kEventParamMouseLocation, typeQDPoint, | 9094 | NULL, &delta); |
| 9056 | NULL, sizeof (Point), NULL, &point); | 9095 | if (err != noErr) |
| 9096 | break; | ||
| 9097 | err = GetEventParameter (event, kEventParamMouseLocation, | ||
| 9098 | typeQDPoint, NULL, sizeof (Point), | ||
| 9099 | NULL, &point); | ||
| 9100 | if (err != noErr) | ||
| 9101 | break; | ||
| 9057 | read_socket_inev->kind = WHEEL_EVENT; | 9102 | read_socket_inev->kind = WHEEL_EVENT; |
| 9058 | read_socket_inev->code = 0; | 9103 | read_socket_inev->code = 0; |
| 9059 | read_socket_inev->modifiers = | 9104 | read_socket_inev->modifiers = |
| @@ -9515,13 +9560,13 @@ convert_fn_keycode (EventRef eventRef, int keyCode, int *newCode) | |||
| 9515 | Fn modifier. That's why we need the table. | 9560 | Fn modifier. That's why we need the table. |
| 9516 | 9561 | ||
| 9517 | */ | 9562 | */ |
| 9518 | 9563 | OSStatus err; | |
| 9519 | UInt32 mods = 0; | 9564 | UInt32 mods = 0; |
| 9520 | if (!NILP(Vmac_function_modifier)) | 9565 | if (!NILP(Vmac_function_modifier)) |
| 9521 | { | 9566 | { |
| 9522 | GetEventParameter (eventRef, kEventParamKeyModifiers, typeUInt32, NULL, | 9567 | err = GetEventParameter (eventRef, kEventParamKeyModifiers, typeUInt32, |
| 9523 | sizeof (UInt32), NULL, &mods); | 9568 | NULL, sizeof (UInt32), NULL, &mods); |
| 9524 | if (mods & kEventKeyModifierFnMask) | 9569 | if (err != noErr && mods & kEventKeyModifierFnMask) |
| 9525 | { *newCode = fn_keycode_to_xkeysym_table [keyCode & 0x7f]; | 9570 | { *newCode = fn_keycode_to_xkeysym_table [keyCode & 0x7f]; |
| 9526 | 9571 | ||
| 9527 | return (*newCode != 0); | 9572 | return (*newCode != 0); |
diff --git a/src/macterm.h b/src/macterm.h index 6714add1878..54208354e2c 100644 --- a/src/macterm.h +++ b/src/macterm.h | |||
| @@ -519,6 +519,10 @@ struct scroll_bar { | |||
| 519 | text from glomming up against the scroll bar */ | 519 | text from glomming up against the scroll bar */ |
| 520 | #define VERTICAL_SCROLL_BAR_WIDTH_TRIM (0) | 520 | #define VERTICAL_SCROLL_BAR_WIDTH_TRIM (0) |
| 521 | 521 | ||
| 522 | /* Variations of possible Aqua scroll bar width. */ | ||
| 523 | #define MAC_AQUA_VERTICAL_SCROLL_BAR_WIDTH (15) | ||
| 524 | #define MAC_AQUA_SMALL_VERTICAL_SCROLL_BAR_WIDTH (11) | ||
| 525 | |||
| 522 | /* Size of hourglass controls */ | 526 | /* Size of hourglass controls */ |
| 523 | #define HOURGLASS_WIDTH 16 | 527 | #define HOURGLASS_WIDTH 16 |
| 524 | #define HOURGLASS_HEIGHT 16 | 528 | #define HOURGLASS_HEIGHT 16 |
diff --git a/src/window.c b/src/window.c index 3e94885a810..d023889f5f4 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -215,6 +215,10 @@ Lisp_Object Vscroll_preserve_screen_position; | |||
| 215 | 215 | ||
| 216 | int window_deletion_count; | 216 | int window_deletion_count; |
| 217 | 217 | ||
| 218 | /* Used by the function window_scroll_pixel_based */ | ||
| 219 | |||
| 220 | static int preserve_y; | ||
| 221 | |||
| 218 | #if 0 /* This isn't used anywhere. */ | 222 | #if 0 /* This isn't used anywhere. */ |
| 219 | /* Nonzero means we can split a frame even if it is "unsplittable". */ | 223 | /* Nonzero means we can split a frame even if it is "unsplittable". */ |
| 220 | static int inhibit_frame_unsplittable; | 224 | static int inhibit_frame_unsplittable; |
| @@ -4724,7 +4728,6 @@ window_scroll_pixel_based (window, n, whole, noerror) | |||
| 4724 | int this_scroll_margin; | 4728 | int this_scroll_margin; |
| 4725 | /* True if we fiddled the window vscroll field without really scrolling. */ | 4729 | /* True if we fiddled the window vscroll field without really scrolling. */ |
| 4726 | int vscrolled = 0; | 4730 | int vscrolled = 0; |
| 4727 | static int preserve_y = -1; | ||
| 4728 | 4731 | ||
| 4729 | SET_TEXT_POS_FROM_MARKER (start, w->start); | 4732 | SET_TEXT_POS_FROM_MARKER (start, w->start); |
| 4730 | 4733 | ||
| @@ -7022,6 +7025,8 @@ syms_of_window () | |||
| 7022 | minibuf_selected_window = Qnil; | 7025 | minibuf_selected_window = Qnil; |
| 7023 | staticpro (&minibuf_selected_window); | 7026 | staticpro (&minibuf_selected_window); |
| 7024 | 7027 | ||
| 7028 | preserve_y = -1; | ||
| 7029 | |||
| 7025 | DEFVAR_LISP ("temp-buffer-show-function", &Vtemp_buffer_show_function, | 7030 | DEFVAR_LISP ("temp-buffer-show-function", &Vtemp_buffer_show_function, |
| 7026 | doc: /* Non-nil means call as function to display a help buffer. | 7031 | doc: /* Non-nil means call as function to display a help buffer. |
| 7027 | The function is called with one argument, the buffer to be displayed. | 7032 | The function is called with one argument, the buffer to be displayed. |
diff --git a/src/xdisp.c b/src/xdisp.c index 7cdaf4f746c..717bab005f9 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -3661,8 +3661,11 @@ handle_invisible_prop (it) | |||
| 3661 | the invisible text. Otherwise the cursor would be | 3661 | the invisible text. Otherwise the cursor would be |
| 3662 | placed _after_ the ellipsis when the point is after the | 3662 | placed _after_ the ellipsis when the point is after the |
| 3663 | first invisible character. */ | 3663 | first invisible character. */ |
| 3664 | it->position.charpos = IT_CHARPOS (*it) - 1; | 3664 | if (!STRINGP (it->object)) |
| 3665 | it->position.bytepos = CHAR_TO_BYTE (it->position.charpos); | 3665 | { |
| 3666 | it->position.charpos = IT_CHARPOS (*it) - 1; | ||
| 3667 | it->position.bytepos = CHAR_TO_BYTE (it->position.charpos); | ||
| 3668 | } | ||
| 3666 | setup_for_ellipsis (it, 0); | 3669 | setup_for_ellipsis (it, 0); |
| 3667 | } | 3670 | } |
| 3668 | } | 3671 | } |
diff --git a/src/xselect.c b/src/xselect.c index 30739c74331..9c2c221c021 100644 --- a/src/xselect.c +++ b/src/xselect.c | |||
| @@ -620,6 +620,7 @@ x_catch_errors_unwind (dummy) | |||
| 620 | BLOCK_INPUT; | 620 | BLOCK_INPUT; |
| 621 | x_uncatch_errors (); | 621 | x_uncatch_errors (); |
| 622 | UNBLOCK_INPUT; | 622 | UNBLOCK_INPUT; |
| 623 | return Qnil; | ||
| 623 | } | 624 | } |
| 624 | 625 | ||
| 625 | 626 | ||