aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1994-02-21 21:54:33 +0000
committerRichard M. Stallman1994-02-21 21:54:33 +0000
commitb849c41360f7e6ac7ca6e22c25bebb5951fd7077 (patch)
treec5d980e5235368259854d09f27b447dc8d0ba96a /src
parentc6ec9f6e897f881a616367f3fbf6c4692dd6b9e1 (diff)
downloademacs-b849c41360f7e6ac7ca6e22c25bebb5951fd7077.tar.gz
emacs-b849c41360f7e6ac7ca6e22c25bebb5951fd7077.zip
(x_had_errors_p): New function.
(construct_menu_click): Convert x pos from pixels to glyphs. Move function after pixel_to_glyph_coords. [!USE_X_TOOLKIT] (x_any_window_to_frame): Define as x_window_to_frame.
Diffstat (limited to 'src')
-rw-r--r--src/xterm.c68
1 files changed, 43 insertions, 25 deletions
diff --git a/src/xterm.c b/src/xterm.c
index 6be11f7e9a9..f9eb67128a9 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -98,6 +98,10 @@ extern Widget Xt_app_shell;
98extern void free_frame_menubar (); 98extern void free_frame_menubar ();
99#endif /* USE_X_TOOLKIT */ 99#endif /* USE_X_TOOLKIT */
100 100
101#ifndef USE_X_TOOLKIT
102#define x_any_window_to_frame x_window_to_frame
103#endif
104
101#ifdef HAVE_X11 105#ifdef HAVE_X11
102#define XMapWindow XMapRaised /* Raise them when mapping. */ 106#define XMapWindow XMapRaised /* Raise them when mapping. */
103#else /* ! defined (HAVE_X11) */ 107#else /* ! defined (HAVE_X11) */
@@ -1619,31 +1623,6 @@ x_find_modifier_meanings ()
1619 XFreeModifiermap (mods); 1623 XFreeModifiermap (mods);
1620} 1624}
1621 1625
1622/* Prepare a menu-event in *RESULT for placement in the input queue. */
1623
1624static Lisp_Object
1625construct_menu_click (result, event, f)
1626 struct input_event *result;
1627 XButtonEvent *event;
1628 struct frame *f;
1629{
1630 /* Make the event type no_event; we'll change that when we decide
1631 otherwise. */
1632 result->kind = mouse_click;
1633 XSET (result->code, Lisp_Int, event->button - Button1);
1634 result->timestamp = event->time;
1635 result->modifiers = (x_x_to_emacs_modifiers (event->state)
1636 | (event->type == ButtonRelease
1637 ? up_modifier
1638 : down_modifier));
1639
1640 {
1641 XFASTINT (result->x) = event->x;
1642 XFASTINT (result->y) = -1; /* special meaning for menubar */
1643 XSET (result->frame_or_window, Lisp_Frame, f);
1644 }
1645}
1646
1647/* Convert between the modifier bits X uses and the modifier bits 1626/* Convert between the modifier bits X uses and the modifier bits
1648 Emacs uses. */ 1627 Emacs uses. */
1649static unsigned int 1628static unsigned int
@@ -1782,6 +1761,34 @@ construct_mouse_click (result, event, f)
1782 XSET (result->frame_or_window, Lisp_Frame, f); 1761 XSET (result->frame_or_window, Lisp_Frame, f);
1783 } 1762 }
1784} 1763}
1764
1765/* Prepare a menu-event in *RESULT for placement in the input queue. */
1766
1767static Lisp_Object
1768construct_menu_click (result, event, f)
1769 struct input_event *result;
1770 XButtonEvent *event;
1771 struct frame *f;
1772{
1773 /* Make the event type no_event; we'll change that when we decide
1774 otherwise. */
1775 result->kind = mouse_click;
1776 XSET (result->code, Lisp_Int, event->button - Button1);
1777 result->timestamp = event->time;
1778 result->modifiers = (x_x_to_emacs_modifiers (event->state)
1779 | (event->type == ButtonRelease
1780 ? up_modifier
1781 : down_modifier));
1782
1783 {
1784 int row, column;
1785
1786 pixel_to_glyph_coords (f, event->x, event->y, &column, &row, NULL, 0);
1787 XFASTINT (result->x) = column;
1788 XFASTINT (result->y) = -1;
1789 XSET (result->frame_or_window, Lisp_Frame, f);
1790 }
1791}
1785 1792
1786/* Function to report a mouse movement to the mainstream Emacs code. 1793/* Function to report a mouse movement to the mainstream Emacs code.
1787 The input handler calls this. 1794 The input handler calls this.
@@ -4291,6 +4298,17 @@ x_check_errors (format)
4291 } 4298 }
4292} 4299}
4293 4300
4301/* Nonzero if we had any X protocol errors since we did x_catch_errors. */
4302
4303int
4304x_had_errors_p ()
4305{
4306 /* Make sure to catch any errors incurred so far. */
4307 XSync (x_current_display, False);
4308
4309 return x_caught_error_message[0] != 0;
4310}
4311
4294/* Stop catching X protocol errors and let them make Emacs die. */ 4312/* Stop catching X protocol errors and let them make Emacs die. */
4295 4313
4296void 4314void