diff options
| author | Karoly Lorentey | 2006-03-10 11:23:32 +0000 |
|---|---|---|
| committer | Karoly Lorentey | 2006-03-10 11:23:32 +0000 |
| commit | d2b86d7f40873f053489f386f7ab926bbb226bef (patch) | |
| tree | 8c617fed23a63e9dca406fa1aa5daa7f0f0919b6 /src | |
| parent | db9d7d9a54118c277fdc47b2840139e78218b1ae (diff) | |
| parent | 61e66a158a521e1ebdaa2e547dcc98d383674a75 (diff) | |
| download | emacs-d2b86d7f40873f053489f386f7ab926bbb226bef.tar.gz emacs-d2b86d7f40873f053489f386f7ab926bbb226bef.zip | |
Merged from emacs@sv.gnu.org
Patches applied:
* emacs@sv.gnu.org/emacs--devo--0--patch-136
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-137
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-138
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-139
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-140
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-141
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-142
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-143
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/gnus--rel--5.10--patch-49
Merge from emacs--devo--0
* emacs@sv.gnu.org/gnus--rel--5.10--patch-50
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-51
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-52
Merge from emacs--devo--0
* emacs@sv.gnu.org/gnus--rel--5.10--patch-53
Update from CVS: Makefile.in (release-*): New targets.
* emacs@sv.gnu.org/gnus--rel--5.10--patch-54
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-55
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-527
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 11fe6f910e4..db10f46024b 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 3587515f840..ba78a835ef3 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 617167dfc46..92a78a7319b 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 af9079e919b..7f682515f43 100644 --- a/src/macterm.c +++ b/src/macterm.c | |||
| @@ -4265,8 +4265,8 @@ static OSStatus set_scroll_bar_timer P_ ((EventTimerInterval)); | |||
| 4265 | static int control_part_code_to_scroll_bar_part P_ ((ControlPartCode)); | 4265 | static int control_part_code_to_scroll_bar_part P_ ((ControlPartCode)); |
| 4266 | static void construct_scroll_bar_click P_ ((struct scroll_bar *, int, | 4266 | static void construct_scroll_bar_click P_ ((struct scroll_bar *, int, |
| 4267 | struct input_event *)); | 4267 | struct input_event *)); |
| 4268 | static OSErr get_control_part_bounds P_ ((ControlHandle, ControlPartCode, | 4268 | static OSStatus get_control_part_bounds P_ ((ControlHandle, ControlPartCode, |
| 4269 | Rect *)); | 4269 | Rect *)); |
| 4270 | static void x_scroll_bar_handle_press P_ ((struct scroll_bar *, | 4270 | static void x_scroll_bar_handle_press P_ ((struct scroll_bar *, |
| 4271 | ControlPartCode, | 4271 | ControlPartCode, |
| 4272 | struct input_event *)); | 4272 | struct input_event *)); |
| @@ -4387,7 +4387,7 @@ construct_scroll_bar_click (bar, part, bufp) | |||
| 4387 | bufp->modifiers = 0; | 4387 | bufp->modifiers = 0; |
| 4388 | } | 4388 | } |
| 4389 | 4389 | ||
| 4390 | static OSErr | 4390 | static OSStatus |
| 4391 | get_control_part_bounds (ch, part_code, rect) | 4391 | get_control_part_bounds (ch, part_code, rect) |
| 4392 | ControlHandle ch; | 4392 | ControlHandle ch; |
| 4393 | ControlPartCode part_code; | 4393 | ControlPartCode part_code; |
| @@ -4531,7 +4531,10 @@ x_set_toolkit_scroll_bar_thumb (bar, portion, position, whole) | |||
| 4531 | ControlHandle ch = SCROLL_BAR_CONTROL_HANDLE (bar); | 4531 | ControlHandle ch = SCROLL_BAR_CONTROL_HANDLE (bar); |
| 4532 | int value, viewsize, maximum; | 4532 | int value, viewsize, maximum; |
| 4533 | 4533 | ||
| 4534 | if (whole == 0 || XINT (bar->track_height) == 0) | 4534 | if (XINT (bar->track_height) == 0) |
| 4535 | return; | ||
| 4536 | |||
| 4537 | if (whole == 0) | ||
| 4535 | value = 0, viewsize = 1, maximum = 0; | 4538 | value = 0, viewsize = 1, maximum = 0; |
| 4536 | else | 4539 | else |
| 4537 | { | 4540 | { |
| @@ -4542,10 +4545,9 @@ x_set_toolkit_scroll_bar_thumb (bar, portion, position, whole) | |||
| 4542 | 4545 | ||
| 4543 | BLOCK_INPUT; | 4546 | BLOCK_INPUT; |
| 4544 | 4547 | ||
| 4545 | if (IsControlVisible (ch) | 4548 | if (GetControlViewSize (ch) != viewsize |
| 4546 | && (GetControlViewSize (ch) != viewsize | 4549 | || GetControl32BitValue (ch) != value |
| 4547 | || GetControl32BitValue (ch) != value | 4550 | || GetControl32BitMaximum (ch) != maximum) |
| 4548 | || GetControl32BitMaximum (ch) != maximum)) | ||
| 4549 | { | 4551 | { |
| 4550 | /* Temporarily hide the scroll bar to avoid multiple redraws. */ | 4552 | /* Temporarily hide the scroll bar to avoid multiple redraws. */ |
| 4551 | SetControlVisibility (ch, false, false); | 4553 | SetControlVisibility (ch, false, false); |
| @@ -4592,7 +4594,12 @@ x_scroll_bar_create (w, top, left, width, height, disp_top, disp_height) | |||
| 4592 | r.bottom = disp_top + disp_height; | 4594 | r.bottom = disp_top + disp_height; |
| 4593 | 4595 | ||
| 4594 | #if TARGET_API_MAC_CARBON | 4596 | #if TARGET_API_MAC_CARBON |
| 4595 | ch = NewControl (FRAME_MAC_WINDOW (f), &r, "\p", width < disp_height, | 4597 | ch = NewControl (FRAME_MAC_WINDOW (f), &r, "\p", |
| 4598 | #if USE_TOOLKIT_SCROLL_BARS | ||
| 4599 | false, | ||
| 4600 | #else | ||
| 4601 | width < disp_height, | ||
| 4602 | #endif | ||
| 4596 | 0, 0, 0, kControlScrollBarProc, (long) bar); | 4603 | 0, 0, 0, kControlScrollBarProc, (long) bar); |
| 4597 | #else | 4604 | #else |
| 4598 | ch = NewControl (FRAME_MAC_WINDOW (f), &r, "\p", width < disp_height, | 4605 | ch = NewControl (FRAME_MAC_WINDOW (f), &r, "\p", width < disp_height, |
| @@ -4762,6 +4769,7 @@ XTset_vertical_scroll_bar (w, portion, whole, position) | |||
| 4762 | /* Adjustments according to Inside Macintosh to make it look nice */ | 4769 | /* Adjustments according to Inside Macintosh to make it look nice */ |
| 4763 | disp_top = top; | 4770 | disp_top = top; |
| 4764 | disp_height = height; | 4771 | disp_height = height; |
| 4772 | #ifdef MAC_OS8 | ||
| 4765 | if (disp_top == 0) | 4773 | if (disp_top == 0) |
| 4766 | { | 4774 | { |
| 4767 | disp_top = -1; | 4775 | disp_top = -1; |
| @@ -4775,6 +4783,7 @@ XTset_vertical_scroll_bar (w, portion, whole, position) | |||
| 4775 | 4783 | ||
| 4776 | if (sb_left + sb_width == FRAME_PIXEL_WIDTH (f)) | 4784 | if (sb_left + sb_width == FRAME_PIXEL_WIDTH (f)) |
| 4777 | sb_left++; | 4785 | sb_left++; |
| 4786 | #endif | ||
| 4778 | 4787 | ||
| 4779 | /* Does the scroll bar exist yet? */ | 4788 | /* Does the scroll bar exist yet? */ |
| 4780 | if (NILP (w->vertical_scroll_bar)) | 4789 | if (NILP (w->vertical_scroll_bar)) |
| @@ -4810,8 +4819,10 @@ XTset_vertical_scroll_bar (w, portion, whole, position) | |||
| 4810 | MoveControl (ch, sb_left + VERTICAL_SCROLL_BAR_WIDTH_TRIM, disp_top); | 4819 | MoveControl (ch, sb_left + VERTICAL_SCROLL_BAR_WIDTH_TRIM, disp_top); |
| 4811 | SizeControl (ch, sb_width - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2, | 4820 | SizeControl (ch, sb_width - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2, |
| 4812 | disp_height); | 4821 | disp_height); |
| 4822 | #ifndef USE_TOOLKIT_SCROLL_BARS | ||
| 4813 | if (sb_width < disp_height) | 4823 | if (sb_width < disp_height) |
| 4814 | ShowControl (ch); | 4824 | ShowControl (ch); |
| 4825 | #endif | ||
| 4815 | 4826 | ||
| 4816 | /* Remember new settings. */ | 4827 | /* Remember new settings. */ |
| 4817 | XSETINT (bar->left, sb_left); | 4828 | XSETINT (bar->left, sb_left); |
| @@ -4829,30 +4840,41 @@ XTset_vertical_scroll_bar (w, portion, whole, position) | |||
| 4829 | 4840 | ||
| 4830 | #ifdef USE_TOOLKIT_SCROLL_BARS | 4841 | #ifdef USE_TOOLKIT_SCROLL_BARS |
| 4831 | if (NILP (bar->track_top)) | 4842 | if (NILP (bar->track_top)) |
| 4832 | { | 4843 | if (sb_width >= disp_height) |
| 4833 | ControlHandle ch = SCROLL_BAR_CONTROL_HANDLE (bar); | 4844 | { |
| 4834 | Rect r0, r1; | 4845 | XSETINT (bar->track_top, 0); |
| 4846 | XSETINT (bar->track_height, 0); | ||
| 4847 | } | ||
| 4848 | else | ||
| 4849 | { | ||
| 4850 | ControlHandle ch = SCROLL_BAR_CONTROL_HANDLE (bar); | ||
| 4851 | Rect r0, r1; | ||
| 4835 | 4852 | ||
| 4836 | BLOCK_INPUT; | 4853 | BLOCK_INPUT; |
| 4837 | 4854 | ||
| 4838 | SetControl32BitMinimum (ch, 0); | 4855 | SetControl32BitMinimum (ch, 0); |
| 4839 | SetControl32BitMaximum (ch, 1); | 4856 | SetControl32BitMaximum (ch, 1); |
| 4840 | SetControlViewSize (ch, 1); | 4857 | SetControlViewSize (ch, 1); |
| 4841 | 4858 | ||
| 4842 | /* Move the scroll bar thumb to the top. */ | 4859 | /* Move the scroll bar thumb to the top. */ |
| 4843 | SetControl32BitValue (ch, 0); | 4860 | SetControl32BitValue (ch, 0); |
| 4844 | get_control_part_bounds (ch, kControlIndicatorPart, &r0); | 4861 | get_control_part_bounds (ch, kControlIndicatorPart, &r0); |
| 4845 | 4862 | ||
| 4846 | /* Move the scroll bar thumb to the bottom. */ | 4863 | /* Move the scroll bar thumb to the bottom. */ |
| 4847 | SetControl32BitValue (ch, 1); | 4864 | SetControl32BitValue (ch, 1); |
| 4848 | get_control_part_bounds (ch, kControlIndicatorPart, &r1); | 4865 | get_control_part_bounds (ch, kControlIndicatorPart, &r1); |
| 4849 | 4866 | ||
| 4850 | UnionRect (&r0, &r1, &r0); | 4867 | UnionRect (&r0, &r1, &r0); |
| 4851 | XSETINT (bar->track_top, r0.top); | 4868 | XSETINT (bar->track_top, r0.top); |
| 4852 | XSETINT (bar->track_height, r0.bottom - r0.top); | 4869 | XSETINT (bar->track_height, r0.bottom - r0.top); |
| 4853 | 4870 | ||
| 4854 | UNBLOCK_INPUT; | 4871 | /* Don't show the scroll bar if its height is not enough to |
| 4855 | } | 4872 | display the scroll bar thumb. */ |
| 4873 | if (r0.bottom - r0.top > 0) | ||
| 4874 | ShowControl (ch); | ||
| 4875 | |||
| 4876 | UNBLOCK_INPUT; | ||
| 4877 | } | ||
| 4856 | 4878 | ||
| 4857 | x_set_toolkit_scroll_bar_thumb (bar, portion, position, whole); | 4879 | x_set_toolkit_scroll_bar_thumb (bar, portion, position, whole); |
| 4858 | #else /* not USE_TOOLKIT_SCROLL_BARS */ | 4880 | #else /* not USE_TOOLKIT_SCROLL_BARS */ |
| @@ -8387,6 +8409,7 @@ mac_get_mouse_btn (EventRef ref) | |||
| 8387 | XTread_socket loop). */ | 8409 | XTread_socket loop). */ |
| 8388 | static Boolean mac_convert_event_ref (EventRef eventRef, EventRecord *eventRec) | 8410 | static Boolean mac_convert_event_ref (EventRef eventRef, EventRecord *eventRec) |
| 8389 | { | 8411 | { |
| 8412 | OSStatus err; | ||
| 8390 | Boolean result = ConvertEventRefToEventRecord (eventRef, eventRec); | 8413 | Boolean result = ConvertEventRefToEventRecord (eventRef, eventRec); |
| 8391 | 8414 | ||
| 8392 | if (result) | 8415 | if (result) |
| @@ -8420,13 +8443,19 @@ static Boolean mac_convert_event_ref (EventRef eventRef, EventRecord *eventRec) | |||
| 8420 | unsigned char char_codes; | 8443 | unsigned char char_codes; |
| 8421 | UInt32 key_code; | 8444 | UInt32 key_code; |
| 8422 | 8445 | ||
| 8423 | eventRec->what = keyDown; | 8446 | err = GetEventParameter (eventRef, kEventParamKeyMacCharCodes, |
| 8424 | GetEventParameter (eventRef, kEventParamKeyMacCharCodes, typeChar, | 8447 | typeChar, NULL, sizeof (char), |
| 8425 | NULL, sizeof (char), NULL, &char_codes); | 8448 | NULL, &char_codes); |
| 8426 | GetEventParameter (eventRef, kEventParamKeyCode, typeUInt32, | 8449 | if (err == noErr) |
| 8427 | NULL, sizeof (UInt32), NULL, &key_code); | 8450 | err = GetEventParameter (eventRef, kEventParamKeyCode, |
| 8428 | eventRec->message = char_codes | ((key_code & 0xff) << 8); | 8451 | typeUInt32, NULL, sizeof (UInt32), |
| 8429 | result = 1; | 8452 | NULL, &key_code); |
| 8453 | if (err == noErr) | ||
| 8454 | { | ||
| 8455 | eventRec->what = keyDown; | ||
| 8456 | eventRec->message = char_codes | ((key_code & 0xff) << 8); | ||
| 8457 | result = 1; | ||
| 8458 | } | ||
| 8430 | } | 8459 | } |
| 8431 | break; | 8460 | break; |
| 8432 | 8461 | ||
| @@ -8442,7 +8471,7 @@ static Boolean mac_convert_event_ref (EventRef eventRef, EventRecord *eventRec) | |||
| 8442 | if (result) | 8471 | if (result) |
| 8443 | { | 8472 | { |
| 8444 | /* Need where and when. */ | 8473 | /* Need where and when. */ |
| 8445 | UInt32 mods; | 8474 | UInt32 mods = 0; |
| 8446 | 8475 | ||
| 8447 | GetEventParameter (eventRef, kEventParamMouseLocation, typeQDPoint, | 8476 | GetEventParameter (eventRef, kEventParamMouseLocation, typeQDPoint, |
| 8448 | NULL, sizeof (Point), NULL, &eventRec->where); | 8477 | NULL, sizeof (Point), NULL, &eventRec->where); |
| @@ -8852,8 +8881,7 @@ mac_handle_command_event (next_handler, event, data) | |||
| 8852 | EventRef event; | 8881 | EventRef event; |
| 8853 | void *data; | 8882 | void *data; |
| 8854 | { | 8883 | { |
| 8855 | OSStatus result; | 8884 | OSStatus result, err; |
| 8856 | OSErr err; | ||
| 8857 | HICommand command; | 8885 | HICommand command; |
| 8858 | Lisp_Object class_key, id_key, binding; | 8886 | Lisp_Object class_key, id_key, binding; |
| 8859 | 8887 | ||
| @@ -8861,10 +8889,10 @@ mac_handle_command_event (next_handler, event, data) | |||
| 8861 | if (result != eventNotHandledErr) | 8889 | if (result != eventNotHandledErr) |
| 8862 | return result; | 8890 | return result; |
| 8863 | 8891 | ||
| 8864 | GetEventParameter (event, kEventParamDirectObject, typeHICommand, NULL, | 8892 | err = GetEventParameter (event, kEventParamDirectObject, typeHICommand, |
| 8865 | sizeof (HICommand), NULL, &command); | 8893 | NULL, sizeof (HICommand), NULL, &command); |
| 8866 | 8894 | ||
| 8867 | if (command.commandID == 0) | 8895 | if (err != noErr || command.commandID == 0) |
| 8868 | return eventNotHandledErr; | 8896 | return eventNotHandledErr; |
| 8869 | 8897 | ||
| 8870 | /* A HICommand event is mapped to an Apple event whose event class | 8898 | /* A HICommand event is mapped to an Apple event whose event class |
| @@ -8918,12 +8946,14 @@ mac_handle_window_event (next_handler, event, data) | |||
| 8918 | void *data; | 8946 | void *data; |
| 8919 | { | 8947 | { |
| 8920 | WindowPtr wp; | 8948 | WindowPtr wp; |
| 8921 | OSStatus result; | 8949 | OSStatus result, err; |
| 8922 | UInt32 attributes; | 8950 | UInt32 attributes; |
| 8923 | XSizeHints *size_hints; | 8951 | XSizeHints *size_hints; |
| 8924 | 8952 | ||
| 8925 | GetEventParameter (event, kEventParamDirectObject, typeWindowRef, | 8953 | err = GetEventParameter (event, kEventParamDirectObject, typeWindowRef, |
| 8926 | NULL, sizeof (WindowPtr), NULL, &wp); | 8954 | NULL, sizeof (WindowPtr), NULL, &wp); |
| 8955 | if (err != noErr) | ||
| 8956 | return eventNotHandledErr; | ||
| 8927 | 8957 | ||
| 8928 | switch (GetEventKind (event)) | 8958 | switch (GetEventKind (event)) |
| 8929 | { | 8959 | { |
| @@ -8940,8 +8970,11 @@ mac_handle_window_event (next_handler, event, data) | |||
| 8940 | if (result != eventNotHandledErr) | 8970 | if (result != eventNotHandledErr) |
| 8941 | return result; | 8971 | return result; |
| 8942 | 8972 | ||
| 8943 | GetEventParameter (event, kEventParamAttributes, typeUInt32, | 8973 | err = GetEventParameter (event, kEventParamAttributes, typeUInt32, |
| 8944 | NULL, sizeof (UInt32), NULL, &attributes); | 8974 | NULL, sizeof (UInt32), NULL, &attributes); |
| 8975 | if (err != noErr) | ||
| 8976 | break; | ||
| 8977 | |||
| 8945 | size_hints = FRAME_SIZE_HINTS (mac_window_to_frame (wp)); | 8978 | size_hints = FRAME_SIZE_HINTS (mac_window_to_frame (wp)); |
| 8946 | if ((attributes & kWindowBoundsChangeUserResize) | 8979 | if ((attributes & kWindowBoundsChangeUserResize) |
| 8947 | && ((size_hints->flags & (PResizeInc | PBaseSize | PMinSize)) | 8980 | && ((size_hints->flags & (PResizeInc | PBaseSize | PMinSize)) |
| @@ -8950,9 +8983,12 @@ mac_handle_window_event (next_handler, event, data) | |||
| 8950 | Rect bounds; | 8983 | Rect bounds; |
| 8951 | int width, height; | 8984 | int width, height; |
| 8952 | 8985 | ||
| 8953 | GetEventParameter (event, kEventParamCurrentBounds, | 8986 | err = GetEventParameter (event, kEventParamCurrentBounds, |
| 8954 | typeQDRectangle, | 8987 | typeQDRectangle, NULL, sizeof (Rect), |
| 8955 | NULL, sizeof (Rect), NULL, &bounds); | 8988 | NULL, &bounds); |
| 8989 | if (err != noErr) | ||
| 8990 | break; | ||
| 8991 | |||
| 8956 | width = bounds.right - bounds.left; | 8992 | width = bounds.right - bounds.left; |
| 8957 | height = bounds.bottom - bounds.top; | 8993 | height = bounds.bottom - bounds.top; |
| 8958 | 8994 | ||
| @@ -9001,7 +9037,7 @@ mac_handle_mouse_event (next_handler, event, data) | |||
| 9001 | EventRef event; | 9037 | EventRef event; |
| 9002 | void *data; | 9038 | void *data; |
| 9003 | { | 9039 | { |
| 9004 | OSStatus result; | 9040 | OSStatus result, err; |
| 9005 | 9041 | ||
| 9006 | switch (GetEventKind (event)) | 9042 | switch (GetEventKind (event)) |
| 9007 | { | 9043 | { |
| @@ -9017,22 +9053,31 @@ mac_handle_mouse_event (next_handler, event, data) | |||
| 9017 | if (result != eventNotHandledErr || read_socket_inev == NULL) | 9053 | if (result != eventNotHandledErr || read_socket_inev == NULL) |
| 9018 | return result; | 9054 | return result; |
| 9019 | 9055 | ||
| 9020 | GetEventParameter (event, kEventParamWindowRef, typeWindowRef, | 9056 | err = GetEventParameter (event, kEventParamWindowRef, typeWindowRef, |
| 9021 | NULL, sizeof (WindowRef), NULL, &wp); | 9057 | NULL, sizeof (WindowRef), NULL, &wp); |
| 9058 | if (err != noErr) | ||
| 9059 | break; | ||
| 9060 | |||
| 9022 | f = mac_window_to_frame (wp); | 9061 | f = mac_window_to_frame (wp); |
| 9023 | if (f != mac_focus_frame (&one_mac_display_info)) | 9062 | if (f != mac_focus_frame (&one_mac_display_info)) |
| 9024 | break; | 9063 | break; |
| 9025 | 9064 | ||
| 9026 | GetEventParameter (event, kEventParamMouseWheelAxis, | 9065 | err = GetEventParameter (event, kEventParamMouseWheelAxis, |
| 9027 | typeMouseWheelAxis, NULL, | 9066 | typeMouseWheelAxis, NULL, |
| 9028 | sizeof (EventMouseWheelAxis), NULL, &axis); | 9067 | sizeof (EventMouseWheelAxis), NULL, &axis); |
| 9029 | if (axis != kEventMouseWheelAxisY) | 9068 | if (err != noErr || axis != kEventMouseWheelAxisY) |
| 9030 | break; | 9069 | break; |
| 9031 | 9070 | ||
| 9032 | GetEventParameter (event, kEventParamMouseWheelDelta, typeSInt32, | 9071 | err = GetEventParameter (event, kEventParamMouseWheelDelta, |
| 9033 | NULL, sizeof (SInt32), NULL, &delta); | 9072 | typeSInt32, NULL, sizeof (SInt32), |
| 9034 | GetEventParameter (event, kEventParamMouseLocation, typeQDPoint, | 9073 | NULL, &delta); |
| 9035 | NULL, sizeof (Point), NULL, &point); | 9074 | if (err != noErr) |
| 9075 | break; | ||
| 9076 | err = GetEventParameter (event, kEventParamMouseLocation, | ||
| 9077 | typeQDPoint, NULL, sizeof (Point), | ||
| 9078 | NULL, &point); | ||
| 9079 | if (err != noErr) | ||
| 9080 | break; | ||
| 9036 | read_socket_inev->kind = WHEEL_EVENT; | 9081 | read_socket_inev->kind = WHEEL_EVENT; |
| 9037 | read_socket_inev->code = 0; | 9082 | read_socket_inev->code = 0; |
| 9038 | read_socket_inev->modifiers = | 9083 | read_socket_inev->modifiers = |
| @@ -9494,13 +9539,13 @@ convert_fn_keycode (EventRef eventRef, int keyCode, int *newCode) | |||
| 9494 | Fn modifier. That's why we need the table. | 9539 | Fn modifier. That's why we need the table. |
| 9495 | 9540 | ||
| 9496 | */ | 9541 | */ |
| 9497 | 9542 | OSStatus err; | |
| 9498 | UInt32 mods = 0; | 9543 | UInt32 mods = 0; |
| 9499 | if (!NILP(Vmac_function_modifier)) | 9544 | if (!NILP(Vmac_function_modifier)) |
| 9500 | { | 9545 | { |
| 9501 | GetEventParameter (eventRef, kEventParamKeyModifiers, typeUInt32, NULL, | 9546 | err = GetEventParameter (eventRef, kEventParamKeyModifiers, typeUInt32, |
| 9502 | sizeof (UInt32), NULL, &mods); | 9547 | NULL, sizeof (UInt32), NULL, &mods); |
| 9503 | if (mods & kEventKeyModifierFnMask) | 9548 | if (err != noErr && mods & kEventKeyModifierFnMask) |
| 9504 | { *newCode = fn_keycode_to_xkeysym_table [keyCode & 0x7f]; | 9549 | { *newCode = fn_keycode_to_xkeysym_table [keyCode & 0x7f]; |
| 9505 | 9550 | ||
| 9506 | return (*newCode != 0); | 9551 | return (*newCode != 0); |
diff --git a/src/macterm.h b/src/macterm.h index 107814ddb3f..42020811e6c 100644 --- a/src/macterm.h +++ b/src/macterm.h | |||
| @@ -516,6 +516,10 @@ struct scroll_bar { | |||
| 516 | text from glomming up against the scroll bar */ | 516 | text from glomming up against the scroll bar */ |
| 517 | #define VERTICAL_SCROLL_BAR_WIDTH_TRIM (0) | 517 | #define VERTICAL_SCROLL_BAR_WIDTH_TRIM (0) |
| 518 | 518 | ||
| 519 | /* Variations of possible Aqua scroll bar width. */ | ||
| 520 | #define MAC_AQUA_VERTICAL_SCROLL_BAR_WIDTH (15) | ||
| 521 | #define MAC_AQUA_SMALL_VERTICAL_SCROLL_BAR_WIDTH (11) | ||
| 522 | |||
| 519 | /* Size of hourglass controls */ | 523 | /* Size of hourglass controls */ |
| 520 | #define HOURGLASS_WIDTH 16 | 524 | #define HOURGLASS_WIDTH 16 |
| 521 | #define HOURGLASS_HEIGHT 16 | 525 | #define HOURGLASS_HEIGHT 16 |
diff --git a/src/window.c b/src/window.c index 36050ac649e..bc9a956994a 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -217,6 +217,10 @@ Lisp_Object Vscroll_preserve_screen_position; | |||
| 217 | 217 | ||
| 218 | int window_deletion_count; | 218 | int window_deletion_count; |
| 219 | 219 | ||
| 220 | /* Used by the function window_scroll_pixel_based */ | ||
| 221 | |||
| 222 | static int preserve_y; | ||
| 223 | |||
| 220 | #if 0 /* This isn't used anywhere. */ | 224 | #if 0 /* This isn't used anywhere. */ |
| 221 | /* Nonzero means we can split a frame even if it is "unsplittable". */ | 225 | /* Nonzero means we can split a frame even if it is "unsplittable". */ |
| 222 | static int inhibit_frame_unsplittable; | 226 | static int inhibit_frame_unsplittable; |
| @@ -4726,7 +4730,6 @@ window_scroll_pixel_based (window, n, whole, noerror) | |||
| 4726 | int this_scroll_margin; | 4730 | int this_scroll_margin; |
| 4727 | /* True if we fiddled the window vscroll field without really scrolling. */ | 4731 | /* True if we fiddled the window vscroll field without really scrolling. */ |
| 4728 | int vscrolled = 0; | 4732 | int vscrolled = 0; |
| 4729 | static int preserve_y = -1; | ||
| 4730 | 4733 | ||
| 4731 | SET_TEXT_POS_FROM_MARKER (start, w->start); | 4734 | SET_TEXT_POS_FROM_MARKER (start, w->start); |
| 4732 | 4735 | ||
| @@ -7024,6 +7027,8 @@ syms_of_window () | |||
| 7024 | minibuf_selected_window = Qnil; | 7027 | minibuf_selected_window = Qnil; |
| 7025 | staticpro (&minibuf_selected_window); | 7028 | staticpro (&minibuf_selected_window); |
| 7026 | 7029 | ||
| 7030 | preserve_y = -1; | ||
| 7031 | |||
| 7027 | DEFVAR_LISP ("temp-buffer-show-function", &Vtemp_buffer_show_function, | 7032 | DEFVAR_LISP ("temp-buffer-show-function", &Vtemp_buffer_show_function, |
| 7028 | doc: /* Non-nil means call as function to display a help buffer. | 7033 | doc: /* Non-nil means call as function to display a help buffer. |
| 7029 | The function is called with one argument, the buffer to be displayed. | 7034 | The function is called with one argument, the buffer to be displayed. |
diff --git a/src/xdisp.c b/src/xdisp.c index 41c8546aac9..a645efd38a2 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -3649,8 +3649,11 @@ handle_invisible_prop (it) | |||
| 3649 | the invisible text. Otherwise the cursor would be | 3649 | the invisible text. Otherwise the cursor would be |
| 3650 | placed _after_ the ellipsis when the point is after the | 3650 | placed _after_ the ellipsis when the point is after the |
| 3651 | first invisible character. */ | 3651 | first invisible character. */ |
| 3652 | it->position.charpos = IT_CHARPOS (*it) - 1; | 3652 | if (!STRINGP (it->object)) |
| 3653 | it->position.bytepos = CHAR_TO_BYTE (it->position.charpos); | 3653 | { |
| 3654 | it->position.charpos = IT_CHARPOS (*it) - 1; | ||
| 3655 | it->position.bytepos = CHAR_TO_BYTE (it->position.charpos); | ||
| 3656 | } | ||
| 3654 | setup_for_ellipsis (it, 0); | 3657 | setup_for_ellipsis (it, 0); |
| 3655 | } | 3658 | } |
| 3656 | } | 3659 | } |
diff --git a/src/xselect.c b/src/xselect.c index 6776e732734..5e6ffd806f0 100644 --- a/src/xselect.c +++ b/src/xselect.c | |||
| @@ -627,6 +627,7 @@ x_catch_errors_unwind (dummy) | |||
| 627 | BLOCK_INPUT; | 627 | BLOCK_INPUT; |
| 628 | x_uncatch_errors (); | 628 | x_uncatch_errors (); |
| 629 | UNBLOCK_INPUT; | 629 | UNBLOCK_INPUT; |
| 630 | return Qnil; | ||
| 630 | } | 631 | } |
| 631 | 632 | ||
| 632 | 633 | ||