aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMiles Bader2005-02-06 12:06:02 +0000
committerMiles Bader2005-02-06 12:06:02 +0000
commita359f0e0ff878285654e2f0bcc7bd3b4340c778c (patch)
treecc0aff13c751bb8ab7ccaae29082bab32e15fd13 /src
parentf3d3402885646e6fa79f1ad59fb8a1f9017851d7 (diff)
parent56c30d721096a64f151f9ea6e3c76562380da895 (diff)
downloademacs-a359f0e0ff878285654e2f0bcc7bd3b4340c778c.tar.gz
emacs-a359f0e0ff878285654e2f0bcc7bd3b4340c778c.zip
Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-11
Merge from emacs--cvs-trunk--0 Patches applied: * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-69 - miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-71 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-72 src/dispextern.h (xassert): Enable unconditionally. * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-73 - miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-81 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-82 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-12 Merge from emacs--cvs-trunk--0 * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-13 Update from CVS
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog79
-rw-r--r--src/buffer.c1
-rw-r--r--src/casefiddle.c2
-rw-r--r--src/dispextern.h7
-rw-r--r--src/dispnew.c8
-rw-r--r--src/gtkutil.c2
-rw-r--r--src/insdel.c16
-rw-r--r--src/mac.c2
-rw-r--r--src/macfns.c4
-rw-r--r--src/macterm.c6
-rw-r--r--src/sysdep.c4
-rw-r--r--src/undo.c3
-rw-r--r--src/xdisp.c2
-rw-r--r--src/xfaces.c8
-rw-r--r--src/xfns.c10
-rw-r--r--src/xmenu.c17
-rw-r--r--src/xselect.c48
-rw-r--r--src/xterm.c14
18 files changed, 191 insertions, 42 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 397a34f1be4..b15fba5254c 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,82 @@
12005-02-05 Andreas Schwab <schwab@suse.de>
2
3 * sysdep.c (sys_subshell): Properly terminate execlp argument
4 list.
5
62005-02-05 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
7
8 * xselect.c (Fx_send_client_event, x_handle_dnd_message): Handle
9 the longs in a XClientMessageEvent correctly when long is 64 bits.
10
112005-02-05 Eli Zaretskii <eliz@gnu.org>
12
13 * xfaces.c (face_color_supported_p): Use HAVE_WINDOW_SYSTEM
14 instead of HAVE_X_WINDOWS, for non-X windowed sessions.
15
162005-02-03 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
17
18 * xmenu.c (menubar_selection_callback): Force out GTK buffered
19 events so the menu event comes after them. This is to prevent sit-for
20 from exiting on buffered events directly after a menu selection,
21 lisp code for Help => About Emacs uses sit-for.
22
23 * gtkutil.c (create_menus): Connect selection-done event instead of
24 the deactivate event to deactivate_cb. This will make the last
25 leave event come before the call to deactivate_cb, so the leave
26 event does not make sit-for exit after a menu selection.
27
282005-02-03 Kim F. Storm <storm@cua.dk>
29
30 * dispnew.c (build_frame_matrix_from_leaf_window)
31 [!GLYPH_DEBUG]: Fix xassert.
32
33 * xfaces.c (x_free_gc) [!GLYPH_DEBUG]: Fix xassert.
34
35 * xfns.c (unwind_create_frame) [!GLYPH_DEBUG]: Fix xassert.
36
372005-02-03 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
38
39 * mac.c: Use MAC_OS_X_VERSION_MAX_ALLOWED to conditionalize by
40 the compiling OS version.
41
42 * macfns.c (x_create_tip_frame): Likewise.
43
44 * macterm.c (mac_draw_string_common, x_make_frame_visible):
45 Likewise.
46
472005-02-03 Richard M. Stallman <rms@gnu.org>
48
49 * xterm.c (x_error_quitter): On GCC 3 and up, specify noinline.
50
51 * xdisp.c (echo_area_display): Clear echo_message_buffer.
52
53 * buffer.c (Fbury_buffer): Doc fix.
54
552005-02-02 Steven Tamm <steventamm@mac.com>
56
57 * macfns.c (unwind_create_frame): Fixing compile error due to
58 xassert being uncondition, but predicate is.
59 * dispnew.c (update_window): Fixing compile error due to
60 xassert being uncondition, but predicate is.
61
622005-02-02 Miles Bader <miles@gnu.org>
63
64 * dispextern.h (xassert): Enable unconditionally.
65
662005-02-02 Kim F. Storm <storm@cua.dk>
67
68 * undo.c (Fprimitive_undo): Fix dummy apply undo entry.
69
702005-02-02 Kenichi Handa <handa@m17n.org>
71
72 * casefiddle.c (casify_object): Enable changing characters of
73 different byte length.
74 (casify_region): Fix loop condition, args to replace_range_2, and
75 update opoint_byte.
76
77 * insdel.c (replace_range_2): Fix bugs in adjusting markers and
78 point.
79
12005-02-01 Kim F. Storm <storm@cua.dk> 802005-02-01 Kim F. Storm <storm@cua.dk>
2 81
3 * xdisp.c (back_to_previous_visible_line_start): Reset iterator 82 * xdisp.c (back_to_previous_visible_line_start): Reset iterator
diff --git a/src/buffer.c b/src/buffer.c
index d869388ec72..153b0ca0bb2 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -1953,6 +1953,7 @@ DEFUN ("bury-buffer", Fbury_buffer, Sbury_buffer, 0, 1, "",
1953 doc: /* Put BUFFER at the end of the list of all buffers. 1953 doc: /* Put BUFFER at the end of the list of all buffers.
1954There it is the least likely candidate for `other-buffer' to return; 1954There it is the least likely candidate for `other-buffer' to return;
1955thus, the least likely buffer for \\[switch-to-buffer] to select by default. 1955thus, the least likely buffer for \\[switch-to-buffer] to select by default.
1956You can specify a buffer name as BUFFER, or an actual buffer object.
1956If BUFFER is nil or omitted, bury the current buffer. 1957If BUFFER is nil or omitted, bury the current buffer.
1957Also, if BUFFER is nil or omitted, remove the current buffer from the 1958Also, if BUFFER is nil or omitted, remove the current buffer from the
1958selected window if it is displayed there. */) 1959selected window if it is displayed there. */)
diff --git a/src/casefiddle.c b/src/casefiddle.c
index 297eb82c15b..889c3879cb4 100644
--- a/src/casefiddle.c
+++ b/src/casefiddle.c
@@ -1,5 +1,5 @@
1/* GNU Emacs case conversion functions. 1/* GNU Emacs case conversion functions.
2 Copyright (C) 1985,94,97,98,99, 2001, 2002, 2004 2 Copyright (C) 1985,94,97,98,99, 2001, 2002, 2004, 2005
3 Free Software Foundation, Inc. 3 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
diff --git a/src/dispextern.h b/src/dispextern.h
index 5edc213fba1..a438b305c35 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -1,5 +1,5 @@
1/* Interface definitions for display code. 1/* Interface definitions for display code.
2 Copyright (C) 1985,93,94,97,98,99, 2000,01,02,03, 2004 2 Copyright (C) 1985,93,94,97,98,99, 2000,01,02,03, 2004, 2005
3 Free Software Foundation, Inc. 3 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
@@ -123,12 +123,13 @@ enum window_part
123 123
124#if GLYPH_DEBUG 124#if GLYPH_DEBUG
125#define IF_DEBUG(X) X 125#define IF_DEBUG(X) X
126#define xassert(X) do {if (!(X)) abort ();} while (0)
127#else 126#else
128#define IF_DEBUG(X) (void) 0 127#define IF_DEBUG(X) (void) 0
129#define xassert(X) (void) 0
130#endif 128#endif
131 129
130/* Maybe move this inside the above `#ifdef GLYPH_DEBUG' for release. */
131#define xassert(X) do {if (!(X)) abort ();} while (0)
132
132/* Macro for displaying traces of redisplay. If Emacs was compiled 133/* Macro for displaying traces of redisplay. If Emacs was compiled
133 with GLYPH_DEBUG != 0, the variable trace_redisplay_p can be set to 134 with GLYPH_DEBUG != 0, the variable trace_redisplay_p can be set to
134 a non-zero value in debugging sessions to activate traces. */ 135 a non-zero value in debugging sessions to activate traces. */
diff --git a/src/dispnew.c b/src/dispnew.c
index c07a4cf8395..302095aa1e8 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -1,6 +1,6 @@
1/* Updating of data structures for redisplay. 1/* Updating of data structures for redisplay.
2 Copyright (C) 1985,86,87,88,93,94,95,97,98,1999,2000,01,02,03,04 2 Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, 1997, 1998, 1999,
3 Free Software Foundation, Inc. 3 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
@@ -2763,6 +2763,7 @@ build_frame_matrix_from_leaf_window (frame_matrix, w)
2763 SET_CHAR_GLYPH_FROM_GLYPH (*border, right_border_glyph); 2763 SET_CHAR_GLYPH_FROM_GLYPH (*border, right_border_glyph);
2764 } 2764 }
2765 2765
2766#if GLYPH_DEBUG
2766 /* Window row window_y must be a slice of frame row 2767 /* Window row window_y must be a slice of frame row
2767 frame_y. */ 2768 frame_y. */
2768 xassert (glyph_row_slice_p (window_row, frame_row)); 2769 xassert (glyph_row_slice_p (window_row, frame_row));
@@ -2770,7 +2771,6 @@ build_frame_matrix_from_leaf_window (frame_matrix, w)
2770 /* If rows are in sync, we don't have to copy glyphs because 2771 /* If rows are in sync, we don't have to copy glyphs because
2771 frame and window share glyphs. */ 2772 frame and window share glyphs. */
2772 2773
2773#if GLYPH_DEBUG
2774 strcpy (w->current_matrix->method, w->desired_matrix->method); 2774 strcpy (w->current_matrix->method, w->desired_matrix->method);
2775 add_window_display_history (w, w->current_matrix->method, 0); 2775 add_window_display_history (w, w->current_matrix->method, 0);
2776#endif 2776#endif
@@ -4051,11 +4051,11 @@ update_window (w, force_p)
4051 extern Lisp_Object do_mouse_tracking; 4051 extern Lisp_Object do_mouse_tracking;
4052#if GLYPH_DEBUG 4052#if GLYPH_DEBUG
4053 struct frame *f = XFRAME (WINDOW_FRAME (w)); 4053 struct frame *f = XFRAME (WINDOW_FRAME (w));
4054#endif
4055 4054
4056 /* Check that W's frame doesn't have glyph matrices. */ 4055 /* Check that W's frame doesn't have glyph matrices. */
4057 xassert (FRAME_WINDOW_P (f)); 4056 xassert (FRAME_WINDOW_P (f));
4058 xassert (updating_frame != NULL); 4057 xassert (updating_frame != NULL);
4058#endif
4059 4059
4060 /* Check pending input the first time so that we can quickly return. */ 4060 /* Check pending input the first time so that we can quickly return. */
4061 if (redisplay_dont_pause) 4061 if (redisplay_dont_pause)
diff --git a/src/gtkutil.c b/src/gtkutil.c
index aecc4e2eaea..6bf0c25f350 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -1905,7 +1905,7 @@ create_menus (data, f, select_cb, deactivate_cb, highlight_cb,
1905 1905
1906 if (deactivate_cb) 1906 if (deactivate_cb)
1907 g_signal_connect (G_OBJECT (wmenu), 1907 g_signal_connect (G_OBJECT (wmenu),
1908 "deactivate", deactivate_cb, 0); 1908 "selection-done", deactivate_cb, 0);
1909 1909
1910 g_signal_connect (G_OBJECT (wmenu), 1910 g_signal_connect (G_OBJECT (wmenu),
1911 "grab-notify", G_CALLBACK (menu_grab_callback), 0); 1911 "grab-notify", G_CALLBACK (menu_grab_callback), 0);
diff --git a/src/insdel.c b/src/insdel.c
index aec393692a2..c2ee9a94674 100644
--- a/src/insdel.c
+++ b/src/insdel.c
@@ -1,5 +1,5 @@
1/* Buffer insertion/deletion and gap motion for GNU Emacs. 1/* Buffer insertion/deletion and gap motion for GNU Emacs.
2 Copyright (C) 1985, 86,93,94,95,97,98, 1999, 2000, 01, 2003 2 Copyright (C) 1985, 86,93,94,95,97,98, 1999, 2000, 01, 2003, 2005
3 Free Software Foundation, Inc. 3 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
@@ -1778,17 +1778,21 @@ replace_range_2 (from, from_byte, to, to_byte, ins, inschars, insbytes, markers)
1778 1778
1779 /* Adjust markers for the deletion and the insertion. */ 1779 /* Adjust markers for the deletion and the insertion. */
1780 if (markers 1780 if (markers
1781 && ! (nchars_del == 1 && inschars == 1)) 1781 && ! (nchars_del == 1 && inschars == 1 && nbytes_del == insbytes))
1782 adjust_markers_for_replace (from, from_byte, nchars_del, nbytes_del, 1782 adjust_markers_for_replace (from, from_byte, nchars_del, nbytes_del,
1783 inschars, insbytes); 1783 inschars, insbytes);
1784 1784
1785 offset_intervals (current_buffer, from, inschars - nchars_del); 1785 offset_intervals (current_buffer, from, inschars - nchars_del);
1786 1786
1787 /* Relocate point as if it were a marker. */ 1787 /* Relocate point as if it were a marker. */
1788 if (from < PT && nchars_del != inschars) 1788 if (from < PT && (nchars_del != inschars || nbytes_del != insbytes))
1789 adjust_point ((from + inschars - (PT < to ? PT : to)), 1789 {
1790 (from_byte + insbytes 1790 if (PT < to)
1791 - (PT_BYTE < to_byte ? PT_BYTE : to_byte))); 1791 /* PT was within the deleted text. Move it to FROM. */
1792 adjust_point (from - PT, from_byte - PT_BYTE);
1793 else
1794 adjust_point (inschars - nchars_del, insbytes - nbytes_del);
1795 }
1792 1796
1793 if (insbytes == 0) 1797 if (insbytes == 0)
1794 evaporate_overlays (from); 1798 evaporate_overlays (from);
diff --git a/src/mac.c b/src/mac.c
index 99e0d44830b..cce1b858cb3 100644
--- a/src/mac.c
+++ b/src/mac.c
@@ -2858,7 +2858,7 @@ select_and_poll_event (n, rfds, wfds, efds, timeout)
2858 return r; 2858 return r;
2859} 2859}
2860 2860
2861#ifndef MAC_OS_X_VERSION_10_2 2861#if MAC_OS_X_VERSION_MAX_ALLOWED < 1020
2862#undef SELECT_INVALIDATE_CFSOCKET 2862#undef SELECT_INVALIDATE_CFSOCKET
2863#endif 2863#endif
2864 2864
diff --git a/src/macfns.c b/src/macfns.c
index 7254ac41752..e46b8469fe2 100644
--- a/src/macfns.c
+++ b/src/macfns.c
@@ -2527,9 +2527,11 @@ unwind_create_frame (frame)
2527 2527
2528 x_free_frame_resources (f); 2528 x_free_frame_resources (f);
2529 2529
2530#if GLYPH_DEBUG
2530 /* Check that reference counts are indeed correct. */ 2531 /* Check that reference counts are indeed correct. */
2531 xassert (dpyinfo->reference_count == dpyinfo_refcount); 2532 xassert (dpyinfo->reference_count == dpyinfo_refcount);
2532 xassert (dpyinfo->image_cache->refcount == image_cache_refcount); 2533 xassert (dpyinfo->image_cache->refcount == image_cache_refcount);
2534#endif
2533 return Qt; 2535 return Qt;
2534 } 2536 }
2535 2537
@@ -3880,7 +3882,7 @@ x_create_tip_frame (dpyinfo, parms, text)
3880 SetRect (&r, 0, 0, 1, 1); 3882 SetRect (&r, 0, 0, 1, 1);
3881#if TARGET_API_MAC_CARBON 3883#if TARGET_API_MAC_CARBON
3882 if (CreateNewWindow (kHelpWindowClass, 3884 if (CreateNewWindow (kHelpWindowClass,
3883#ifdef MAC_OS_X_VERSION_10_2 3885#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020
3884 kWindowIgnoreClicksAttribute | 3886 kWindowIgnoreClicksAttribute |
3885#endif 3887#endif
3886 kWindowNoUpdatesAttribute | 3888 kWindowNoUpdatesAttribute |
diff --git a/src/macterm.c b/src/macterm.c
index 5a7db8e04e2..2ee881e8d49 100644
--- a/src/macterm.c
+++ b/src/macterm.c
@@ -731,7 +731,7 @@ mac_draw_string_common (display, w, gc, x, y, buf, nchars, mode,
731 int nchars, mode, bytes_per_char; 731 int nchars, mode, bytes_per_char;
732{ 732{
733 SetPortWindowPort (w); 733 SetPortWindowPort (w);
734#ifdef MAC_OS_X_VERSION_10_2 734#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020
735 UInt32 textFlags, savedFlags; 735 UInt32 textFlags, savedFlags;
736 if (!NILP(Vmac_use_core_graphics)) { 736 if (!NILP(Vmac_use_core_graphics)) {
737 textFlags = kQDUseCGTextRendering; 737 textFlags = kQDUseCGTextRendering;
@@ -748,7 +748,7 @@ mac_draw_string_common (display, w, gc, x, y, buf, nchars, mode,
748 748
749 MoveTo (x, y); 749 MoveTo (x, y);
750 DrawText (buf, 0, nchars * bytes_per_char); 750 DrawText (buf, 0, nchars * bytes_per_char);
751#ifdef MAC_OS_X_VERSION_10_2 751#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020
752 if (!NILP(Vmac_use_core_graphics)) 752 if (!NILP(Vmac_use_core_graphics))
753 SwapQDTextFlags(savedFlags); 753 SwapQDTextFlags(savedFlags);
754#endif 754#endif
@@ -5468,7 +5468,7 @@ x_make_frame_visible (f)
5468 else 5468 else
5469 RepositionWindow (FRAME_MAC_WINDOW (f), 5469 RepositionWindow (FRAME_MAC_WINDOW (f),
5470 FRAME_MAC_WINDOW (sf), 5470 FRAME_MAC_WINDOW (sf),
5471#ifdef MAC_OS_X_VERSION_10_2 5471#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020
5472 kWindowCascadeStartAtParentWindowScreen 5472 kWindowCascadeStartAtParentWindowScreen
5473#else 5473#else
5474 kWindowCascadeOnParentWindowScreen 5474 kWindowCascadeOnParentWindowScreen
diff --git a/src/sysdep.c b/src/sysdep.c
index 1884c0ccffa..f1345e591ab 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -1,6 +1,6 @@
1/* Interfaces to system-dependent kernel and library entries. 1/* Interfaces to system-dependent kernel and library entries.
2 Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, 1999, 2000, 2001, 2 Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, 1999, 2000, 2001,
3 2003, 2004 Free Software Foundation, Inc. 3 2003, 2004, 2005 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
@@ -869,7 +869,7 @@ sys_subshell ()
869 if (pid == -1) 869 if (pid == -1)
870 write (1, "Can't execute subshell", 22); 870 write (1, "Can't execute subshell", 22);
871#else /* not WINDOWSNT */ 871#else /* not WINDOWSNT */
872 execlp (sh, sh, 0); 872 execlp (sh, sh, (char *) 0);
873 write (1, "Can't execute subshell", 22); 873 write (1, "Can't execute subshell", 22);
874 _exit (1); 874 _exit (1);
875#endif /* not WINDOWSNT */ 875#endif /* not WINDOWSNT */
diff --git a/src/undo.c b/src/undo.c
index ea4f35397a9..eaf312be676 100644
--- a/src/undo.c
+++ b/src/undo.c
@@ -560,12 +560,13 @@ Return what remains of the list. */)
560 } 560 }
561 cdr = Fcdr (cdr); 561 cdr = Fcdr (cdr);
562 apply1 (car, cdr); 562 apply1 (car, cdr);
563
563 /* Make sure this produces at least one undo entry, 564 /* Make sure this produces at least one undo entry,
564 so the test in `undo' for continuing an undo series 565 so the test in `undo' for continuing an undo series
565 will work right. */ 566 will work right. */
566 if (EQ (oldlist, current_buffer->undo_list)) 567 if (EQ (oldlist, current_buffer->undo_list))
567 current_buffer->undo_list 568 current_buffer->undo_list
568 = Fcons (list2 (Qcdr, Qnil), current_buffer->undo_list); 569 = Fcons (list3 (Qapply, Qcdr, Qnil), current_buffer->undo_list);
569 } 570 }
570 else if (STRINGP (car) && INTEGERP (cdr)) 571 else if (STRINGP (car) && INTEGERP (cdr))
571 { 572 {
diff --git a/src/xdisp.c b/src/xdisp.c
index 31a6074b61f..6ee9efafc62 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -8200,6 +8200,8 @@ echo_area_display (update_frame_p)
8200 8200
8201 /* Last displayed message is now the current message. */ 8201 /* Last displayed message is now the current message. */
8202 echo_area_buffer[1] = echo_area_buffer[0]; 8202 echo_area_buffer[1] = echo_area_buffer[0];
8203 /* Inform read_char that we're not echoing. */
8204 echo_message_buffer = Qnil;
8203 8205
8204 /* Prevent redisplay optimization in redisplay_internal by resetting 8206 /* Prevent redisplay optimization in redisplay_internal by resetting
8205 this_line_start_pos. This is done because the mini-buffer now 8207 this_line_start_pos. This is done because the mini-buffer now
diff --git a/src/xfaces.c b/src/xfaces.c
index a4920d893ee..29b342a8f1e 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -1,5 +1,5 @@
1/* xfaces.c -- "Face" primitives. 1/* xfaces.c -- "Face" primitives.
2 Copyright (C) 1993, 1994, 1998, 1999, 2000, 2001, 2002, 2003, 2004 2 Copyright (C) 1993, 1994, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
3 Free Software Foundation. 3 Free Software Foundation.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
@@ -738,7 +738,7 @@ x_free_gc (f, gc)
738 GC gc; 738 GC gc;
739{ 739{
740 BLOCK_INPUT; 740 BLOCK_INPUT;
741 xassert (--ngcs >= 0); 741 IF_DEBUG (xassert (--ngcs >= 0));
742 XFreeGC (FRAME_X_DISPLAY (f), gc); 742 XFreeGC (FRAME_X_DISPLAY (f), gc);
743 UNBLOCK_INPUT; 743 UNBLOCK_INPUT;
744} 744}
@@ -771,7 +771,7 @@ x_free_gc (f, gc)
771 GC gc; 771 GC gc;
772{ 772{
773 BLOCK_INPUT; 773 BLOCK_INPUT;
774 xassert (--ngcs >= 0); 774 IF_DEBUG (xassert (--ngcs >= 0));
775 xfree (gc); 775 xfree (gc);
776 UNBLOCK_INPUT; 776 UNBLOCK_INPUT;
777} 777}
@@ -1511,7 +1511,7 @@ face_color_supported_p (f, color_name, background_p)
1511 1511
1512 XSETFRAME (frame, f); 1512 XSETFRAME (frame, f);
1513 return 1513 return
1514#ifdef HAVE_X_WINDOWS 1514#ifdef HAVE_WINDOW_SYSTEM
1515 FRAME_WINDOW_P (f) 1515 FRAME_WINDOW_P (f)
1516 ? (!NILP (Fxw_display_color_p (frame)) 1516 ? (!NILP (Fxw_display_color_p (frame))
1517 || xstricmp (color_name, "black") == 0 1517 || xstricmp (color_name, "black") == 0
diff --git a/src/xfns.c b/src/xfns.c
index 2bb5fa31327..2732a1be051 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -1,6 +1,6 @@
1/* Functions for the X window system. 1/* Functions for the X window system.
2 Copyright (C) 1989, 92, 93, 94, 95, 96, 97, 98, 99, 2000,01,02,03,04 2 Copyright (C) 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
3 Free Software Foundation. 3 2001, 2002, 2003, 2004, 2005 Free Software Foundation.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
@@ -2843,9 +2843,11 @@ unwind_create_frame (frame)
2843 2843
2844 x_free_frame_resources (f); 2844 x_free_frame_resources (f);
2845 2845
2846#if GLYPH_DEBUG
2846 /* Check that reference counts are indeed correct. */ 2847 /* Check that reference counts are indeed correct. */
2847 xassert (dpyinfo->reference_count == dpyinfo_refcount); 2848 xassert (dpyinfo->reference_count == dpyinfo_refcount);
2848 xassert (dpyinfo->image_cache->refcount == image_cache_refcount); 2849 xassert (dpyinfo->image_cache->refcount == image_cache_refcount);
2850#endif
2849 return Qt; 2851 return Qt;
2850 } 2852 }
2851 2853
@@ -4071,7 +4073,7 @@ Value is VALUE. */)
4071 4073
4072 if (! NILP (outer_p)) w = FRAME_OUTER_WINDOW (f); 4074 if (! NILP (outer_p)) w = FRAME_OUTER_WINDOW (f);
4073 else w = FRAME_X_WINDOW (f); 4075 else w = FRAME_X_WINDOW (f);
4074 4076
4075 XChangeProperty (FRAME_X_DISPLAY (f), w, 4077 XChangeProperty (FRAME_X_DISPLAY (f), w,
4076 prop_atom, target_type, element_format, PropModeReplace, 4078 prop_atom, target_type, element_format, PropModeReplace,
4077 data, nelements); 4079 data, nelements);
@@ -5240,7 +5242,7 @@ or directory must exist. ONLY-DIR-P is ignored." */)
5240 if (keysym == XK_g && (event.xkey.state & ControlMask) != 0) 5242 if (keysym == XK_g && (event.xkey.state & ControlMask) != 0)
5241 XtUnmanageChild (dialog); 5243 XtUnmanageChild (dialog);
5242 } 5244 }
5243 5245
5244 (void) x_dispatch_event (&event, FRAME_X_DISPLAY (f)); 5246 (void) x_dispatch_event (&event, FRAME_X_DISPLAY (f));
5245 } 5247 }
5246 5248
diff --git a/src/xmenu.c b/src/xmenu.c
index 850b8f4ddf4..e98ee7534a4 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -1445,9 +1445,9 @@ menu_highlight_callback (widget, id, call_data)
1445/* Find the menu selection and store it in the keyboard buffer. 1445/* Find the menu selection and store it in the keyboard buffer.
1446 F is the frame the menu is on. 1446 F is the frame the menu is on.
1447 MENU_BAR_ITEMS_USED is the length of VECTOR. 1447 MENU_BAR_ITEMS_USED is the length of VECTOR.
1448 VECTOR is an array of menu events for the whole menu. 1448 VECTOR is an array of menu events for the whole menu. */
1449 */ 1449
1450void 1450static void
1451find_and_call_menu_selection (f, menu_bar_items_used, vector, client_data) 1451find_and_call_menu_selection (f, menu_bar_items_used, vector, client_data)
1452 FRAME_PTR f; 1452 FRAME_PTR f;
1453 EMACS_INT menu_bar_items_used; 1453 EMACS_INT menu_bar_items_used;
@@ -1554,6 +1554,17 @@ menubar_selection_callback (widget, client_data)
1554 if (! cb_data || ! cb_data->cl_data || ! cb_data->cl_data->f) 1554 if (! cb_data || ! cb_data->cl_data || ! cb_data->cl_data->f)
1555 return; 1555 return;
1556 1556
1557 /* When a menu is popped down, X generates a focus event (i.e. focus
1558 goes back to the frame below the menu). Since GTK buffers events,
1559 we force it out here before the menu selection event. Otherwise
1560 sit-for will exit at once if the focus event follows the menu selection
1561 event. */
1562
1563 BLOCK_INPUT;
1564 while (gtk_events_pending ())
1565 gtk_main_iteration ();
1566 UNBLOCK_INPUT;
1567
1557 find_and_call_menu_selection (cb_data->cl_data->f, 1568 find_and_call_menu_selection (cb_data->cl_data->f,
1558 cb_data->cl_data->menu_bar_items_used, 1569 cb_data->cl_data->menu_bar_items_used,
1559 cb_data->cl_data->menu_bar_vector, 1570 cb_data->cl_data->menu_bar_vector,
diff --git a/src/xselect.c b/src/xselect.c
index 5dd63b9c735..daae84b276c 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -2536,7 +2536,7 @@ x_property_data_to_lisp (f, data, type, format, size)
2536 data, size*format/8, type, format); 2536 data, size*format/8, type, format);
2537} 2537}
2538 2538
2539/* Get the mouse position frame relative coordinates. */ 2539/* Get the mouse position in frame relative coordinates. */
2540 2540
2541static void 2541static void
2542mouse_position_for_drop (f, x, y) 2542mouse_position_for_drop (f, x, y)
@@ -2635,16 +2635,31 @@ x_handle_dnd_message (f, event, dpyinfo, bufp)
2635 Lisp_Object frame; 2635 Lisp_Object frame;
2636 unsigned long size = (8*sizeof (event->data))/event->format; 2636 unsigned long size = (8*sizeof (event->data))/event->format;
2637 int x, y; 2637 int x, y;
2638 unsigned char *data = (unsigned char *) event->data.b;
2639 int idata[5];
2638 2640
2639 XSETFRAME (frame, f); 2641 XSETFRAME (frame, f);
2640 2642
2643 /* On a 64 bit machine, the event->data.l array members are 64 bits (long),
2644 but the x_property_data_to_lisp (or rather selection_data_to_lisp_data)
2645 function expects them to be of size int (i.e. 32). So to be able to
2646 use that function, put the data in the form it expects if format is 32. */
2647
2648 if (event->format == 32 && event->format < BITS_PER_LONG)
2649 {
2650 int i;
2651 for (i = 0; i < 5; ++i) /* There are only 5 longs in a ClientMessage. */
2652 idata[i] = (int) event->data.l[i];
2653 data = (unsigned char *) idata;
2654 }
2655
2641 vec = Fmake_vector (make_number (4), Qnil); 2656 vec = Fmake_vector (make_number (4), Qnil);
2642 AREF (vec, 0) = SYMBOL_NAME (x_atom_to_symbol (FRAME_X_DISPLAY (f), 2657 AREF (vec, 0) = SYMBOL_NAME (x_atom_to_symbol (FRAME_X_DISPLAY (f),
2643 event->message_type)); 2658 event->message_type));
2644 AREF (vec, 1) = frame; 2659 AREF (vec, 1) = frame;
2645 AREF (vec, 2) = make_number (event->format); 2660 AREF (vec, 2) = make_number (event->format);
2646 AREF (vec, 3) = x_property_data_to_lisp (f, 2661 AREF (vec, 3) = x_property_data_to_lisp (f,
2647 event->data.b, 2662 data,
2648 event->message_type, 2663 event->message_type,
2649 event->format, 2664 event->format,
2650 size); 2665 size);
@@ -2697,6 +2712,8 @@ are ignored. */)
2697 struct frame *f = check_x_frame (from); 2712 struct frame *f = check_x_frame (from);
2698 int count; 2713 int count;
2699 int to_root; 2714 int to_root;
2715 int idata[5];
2716 void *data;
2700 2717
2701 CHECK_STRING (message_type); 2718 CHECK_STRING (message_type);
2702 CHECK_NUMBER (format); 2719 CHECK_NUMBER (format);
@@ -2756,10 +2773,31 @@ are ignored. */)
2756 when sending to the root window. */ 2773 when sending to the root window. */
2757 event.xclient.window = to_root ? FRAME_OUTER_WINDOW (f) : wdest; 2774 event.xclient.window = to_root ? FRAME_OUTER_WINDOW (f) : wdest;
2758 2775
2759 memset (event.xclient.data.b, 0, sizeof (event.xclient.data.b)); 2776
2760 x_fill_property_data (dpyinfo->display, values, event.xclient.data.b, 2777 if (event.xclient.format == 32 && event.xclient.format < BITS_PER_LONG)
2761 event.xclient.format); 2778 {
2779 /* x_fill_property_data expects data to hold 32 bit values when
2780 format == 32, but on a 64 bit machine long is 64 bits.
2781 event.xclient.l is an array of long, so we must compensate. */
2762 2782
2783 memset (idata, 0, sizeof (idata));
2784 data = idata;
2785 }
2786 else
2787 {
2788 memset (event.xclient.data.b, 0, sizeof (event.xclient.data.b));
2789 data = event.xclient.data.b;
2790 }
2791
2792 x_fill_property_data (dpyinfo->display, values, data, event.xclient.format);
2793
2794 if (data == idata)
2795 {
2796 int i;
2797 for (i = 0; i < 5; ++i) /* There are only 5 longs in a ClientMessage. */
2798 event.xclient.data.l[i] = (long) idata[i];
2799 }
2800
2763 /* If event mask is 0 the event is sent to the client that created 2801 /* If event mask is 0 the event is sent to the client that created
2764 the destination window. But if we are sending to the root window, 2802 the destination window. But if we are sending to the root window,
2765 there is no such client. Then we set the event mask to 0xffff. The 2803 there is no such client. Then we set the event mask to 0xffff. The
diff --git a/src/xterm.c b/src/xterm.c
index c54b96a19b7..137e0d2ae9e 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -7777,10 +7777,18 @@ x_error_handler (display, error)
7777 It kills all frames on the display that we got the error for. 7777 It kills all frames on the display that we got the error for.
7778 If that was the only one, it prints an error message and kills Emacs. */ 7778 If that was the only one, it prints an error message and kills Emacs. */
7779 7779
7780/* It is after x_error_handler so that it won't get inlined in 7780/* .gdbinit puts a breakpoint here, so make sure it is not inlined. */
7781 x_error_handler. */
7782 7781
7783static void 7782#if __GNUC__ >= 3 /* On GCC 3.0 we might get a warning. */
7783#define NO_INLINE __attribute__((noinline))
7784#else
7785#define NO_INLINE
7786#endif
7787
7788/* On older GCC versions, just putting x_error_quitter
7789 after x_error_handler prevents inlining into the former. */
7790
7791static void NO_INLINE
7784x_error_quitter (display, error) 7792x_error_quitter (display, error)
7785 Display *display; 7793 Display *display;
7786 XErrorEvent *error; 7794 XErrorEvent *error;