Commit bfd55935 authored by Dmitry Antipov's avatar Dmitry Antipov

* dispextern.h (last_tool_bar_item): Remove declaration.

* frame.h (struct frame): New member last_tool_bar_item.
* frame.c (make_frame): Initialize it.
* xdisp.c (toplevel): Remove last_tool_bar_item.
(handle_tool_bar_click, note_tool_bar_highlight):
* w32term.c (w32_read_socket, w32_initialize):
* xterm.c (handle_one_xevent, x_initialize): Adjust users.
parent 24ce6a02
......@@ -14,6 +14,14 @@
* xftfont.c (xftfont_prepare_face): Likewise. Use xmalloc.
(xftfont_done_face): Use xfree.
* dispextern.h (last_tool_bar_item): Remove declaration.
* frame.h (struct frame): New member last_tool_bar_item.
* frame.c (make_frame): Initialize it.
* xdisp.c (toplevel): Remove last_tool_bar_item.
(handle_tool_bar_click, note_tool_bar_highlight):
* w32term.c (w32_read_socket, w32_initialize):
* xterm.c (handle_one_xevent, x_initialize): Adjust users.
2014-06-09 Paul Eggert <eggert@cs.ucla.edu>
Say (accept-process-output P)'s result pertains to P if P is non-nil.
......
......@@ -3194,7 +3194,6 @@ extern bool help_echo_showing_p;
extern Lisp_Object help_echo_string, help_echo_window;
extern Lisp_Object help_echo_object, previous_help_echo_string;
extern ptrdiff_t help_echo_pos;
extern int last_tool_bar_item;
extern void reseat_at_previous_visible_line_start (struct it *);
extern Lisp_Object lookup_glyphless_char_display (int, struct it *);
extern ptrdiff_t compute_display_string_pos (struct text_pos *,
......
......@@ -352,6 +352,9 @@ make_frame (bool mini_p)
f->line_height = 1; /* !FRAME_WINDOW_P value. */
#ifdef HAVE_WINDOW_SYSTEM
f->want_fullscreen = FULLSCREEN_NONE;
#if ! defined (USE_GTK) && ! defined (HAVE_NS)
f->last_tool_bar_item = -1;
#endif
#endif
root_window = make_window ();
......
......@@ -164,6 +164,11 @@ struct frame
/* Cache of realized faces. */
struct face_cache *face_cache;
#if defined (HAVE_WINDOW_SYSTEM) && ! defined (USE_GTK) && ! defined (HAVE_NS)
/* Tool-bar item index of the item on which a mouse button was pressed. */
int last_tool_bar_item;
#endif
/* Number of elements in `menu_bar_vector' that have meaningful data. */
int menu_bar_items_used;
......
......@@ -4536,10 +4536,11 @@ w32_read_socket (struct terminal *terminal,
Emacs events should reflect only motion after
the ButtonPress. */
if (f != 0)
f->mouse_moved = 0;
if (!tool_bar_p)
last_tool_bar_item = -1;
{
f->mouse_moved = 0;
if (!tool_bar_p)
f->last_tool_bar_item = -1;
}
}
break;
}
......@@ -4564,9 +4565,9 @@ w32_read_socket (struct terminal *terminal,
should reflect only motion after the
ButtonPress. */
f->mouse_moved = 0;
f->last_tool_bar_item = -1;
}
dpyinfo->last_mouse_frame = f;
last_tool_bar_item = -1;
}
break;
......@@ -6454,7 +6455,6 @@ w32_initialize (void)
&w32_use_visible_system_caret, 0))
w32_use_visible_system_caret = 0;
last_tool_bar_item = -1;
any_help_event_p = 0;
/* Initialize input mode: interrupt_input off, no flow control, allow
......
......@@ -11806,11 +11806,6 @@ update_menu_bar (struct frame *f, int save_match_data, int hooks_run)
#ifdef HAVE_WINDOW_SYSTEM
/* Tool-bar item index of the item on which a mouse button was pressed
or -1. */
int last_tool_bar_item;
/* Select `frame' temporarily without running all the code in
do_switch_frame.
FIXME: Maybe do_switch_frame should be trimmed down similarly
......@@ -12612,7 +12607,7 @@ handle_tool_bar_click (struct frame *f, int x, int y, int down_p,
where the button was pressed, disregarding where it was
released. */
if (NILP (Vmouse_highlight) && !down_p)
prop_idx = last_tool_bar_item;
prop_idx = f->last_tool_bar_item;
/* If item is disabled, do nothing. */
enabled_p = AREF (f->tool_bar_items, prop_idx + TOOL_BAR_ITEM_ENABLED_P);
......@@ -12624,7 +12619,7 @@ handle_tool_bar_click (struct frame *f, int x, int y, int down_p,
/* Show item in pressed state. */
if (!NILP (Vmouse_highlight))
show_mouse_face (hlinfo, DRAW_IMAGE_SUNKEN);
last_tool_bar_item = prop_idx;
f->last_tool_bar_item = prop_idx;
}
else
{
......@@ -12649,7 +12644,7 @@ handle_tool_bar_click (struct frame *f, int x, int y, int down_p,
event.arg = key;
event.modifiers = modifiers;
kbd_buffer_store_event (&event);
last_tool_bar_item = -1;
f->last_tool_bar_item = -1;
}
}
......@@ -12699,8 +12694,7 @@ note_tool_bar_highlight (struct frame *f, int x, int y)
mouse_down_p = (x_mouse_grabbed (dpyinfo)
&& f == dpyinfo->last_mouse_frame);
if (mouse_down_p
&& last_tool_bar_item != prop_idx)
if (mouse_down_p && f->last_tool_bar_item != prop_idx)
return;
draw = mouse_down_p ? DRAW_IMAGE_SUNKEN : DRAW_IMAGE_RAISED;
......
......@@ -6809,9 +6809,10 @@ handle_one_xevent (struct x_display_info *dpyinfo,
{
dpyinfo->grabbed |= (1 << event->xbutton.button);
dpyinfo->last_mouse_frame = f;
if (!tool_bar_p)
last_tool_bar_item = -1;
#if ! defined (USE_GTK)
if (f && !tool_bar_p)
f->last_tool_bar_item = -1;
#endif /* not USE_GTK */
}
else
dpyinfo->grabbed &= ~(1 << event->xbutton.button);
......@@ -10555,7 +10556,6 @@ x_initialize (void)
baud_rate = 19200;
x_noop_count = 0;
last_tool_bar_item = -1;
any_help_event_p = 0;
ignore_next_mouse_click_timeout = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment