aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDmitry Antipov2014-06-10 08:55:03 +0400
committerDmitry Antipov2014-06-10 08:55:03 +0400
commitbfd559357dd906f4fe57b67346cf2bd8bdb8f2a3 (patch)
tree9eb702d4208c1b32de82269bf061b5d720cadb8f /src
parent24ce6a0214e7b885363990e07dabf2935a8c1e11 (diff)
downloademacs-bfd559357dd906f4fe57b67346cf2bd8bdb8f2a3.tar.gz
emacs-bfd559357dd906f4fe57b67346cf2bd8bdb8f2a3.zip
* 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.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog8
-rw-r--r--src/dispextern.h1
-rw-r--r--src/frame.c3
-rw-r--r--src/frame.h5
-rw-r--r--src/w32term.c12
-rw-r--r--src/xdisp.c14
-rw-r--r--src/xterm.c8
7 files changed, 30 insertions, 21 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index e050baeb935..f15c0f5f798 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -14,6 +14,14 @@
14 * xftfont.c (xftfont_prepare_face): Likewise. Use xmalloc. 14 * xftfont.c (xftfont_prepare_face): Likewise. Use xmalloc.
15 (xftfont_done_face): Use xfree. 15 (xftfont_done_face): Use xfree.
16 16
17 * dispextern.h (last_tool_bar_item): Remove declaration.
18 * frame.h (struct frame): New member last_tool_bar_item.
19 * frame.c (make_frame): Initialize it.
20 * xdisp.c (toplevel): Remove last_tool_bar_item.
21 (handle_tool_bar_click, note_tool_bar_highlight):
22 * w32term.c (w32_read_socket, w32_initialize):
23 * xterm.c (handle_one_xevent, x_initialize): Adjust users.
24
172014-06-09 Paul Eggert <eggert@cs.ucla.edu> 252014-06-09 Paul Eggert <eggert@cs.ucla.edu>
18 26
19 Say (accept-process-output P)'s result pertains to P if P is non-nil. 27 Say (accept-process-output P)'s result pertains to P if P is non-nil.
diff --git a/src/dispextern.h b/src/dispextern.h
index 21ed5f70ad2..e710f8e35d7 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -3194,7 +3194,6 @@ extern bool help_echo_showing_p;
3194extern Lisp_Object help_echo_string, help_echo_window; 3194extern Lisp_Object help_echo_string, help_echo_window;
3195extern Lisp_Object help_echo_object, previous_help_echo_string; 3195extern Lisp_Object help_echo_object, previous_help_echo_string;
3196extern ptrdiff_t help_echo_pos; 3196extern ptrdiff_t help_echo_pos;
3197extern int last_tool_bar_item;
3198extern void reseat_at_previous_visible_line_start (struct it *); 3197extern void reseat_at_previous_visible_line_start (struct it *);
3199extern Lisp_Object lookup_glyphless_char_display (int, struct it *); 3198extern Lisp_Object lookup_glyphless_char_display (int, struct it *);
3200extern ptrdiff_t compute_display_string_pos (struct text_pos *, 3199extern ptrdiff_t compute_display_string_pos (struct text_pos *,
diff --git a/src/frame.c b/src/frame.c
index e75a74be938..9d820819623 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -352,6 +352,9 @@ make_frame (bool mini_p)
352 f->line_height = 1; /* !FRAME_WINDOW_P value. */ 352 f->line_height = 1; /* !FRAME_WINDOW_P value. */
353#ifdef HAVE_WINDOW_SYSTEM 353#ifdef HAVE_WINDOW_SYSTEM
354 f->want_fullscreen = FULLSCREEN_NONE; 354 f->want_fullscreen = FULLSCREEN_NONE;
355#if ! defined (USE_GTK) && ! defined (HAVE_NS)
356 f->last_tool_bar_item = -1;
357#endif
355#endif 358#endif
356 359
357 root_window = make_window (); 360 root_window = make_window ();
diff --git a/src/frame.h b/src/frame.h
index 0ee97f0b3f3..a962e91ce2d 100644
--- a/src/frame.h
+++ b/src/frame.h
@@ -164,6 +164,11 @@ struct frame
164 /* Cache of realized faces. */ 164 /* Cache of realized faces. */
165 struct face_cache *face_cache; 165 struct face_cache *face_cache;
166 166
167#if defined (HAVE_WINDOW_SYSTEM) && ! defined (USE_GTK) && ! defined (HAVE_NS)
168 /* Tool-bar item index of the item on which a mouse button was pressed. */
169 int last_tool_bar_item;
170#endif
171
167 /* Number of elements in `menu_bar_vector' that have meaningful data. */ 172 /* Number of elements in `menu_bar_vector' that have meaningful data. */
168 int menu_bar_items_used; 173 int menu_bar_items_used;
169 174
diff --git a/src/w32term.c b/src/w32term.c
index fc45bdd30a3..553764a8de5 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -4536,10 +4536,11 @@ w32_read_socket (struct terminal *terminal,
4536 Emacs events should reflect only motion after 4536 Emacs events should reflect only motion after
4537 the ButtonPress. */ 4537 the ButtonPress. */
4538 if (f != 0) 4538 if (f != 0)
4539 f->mouse_moved = 0; 4539 {
4540 4540 f->mouse_moved = 0;
4541 if (!tool_bar_p) 4541 if (!tool_bar_p)
4542 last_tool_bar_item = -1; 4542 f->last_tool_bar_item = -1;
4543 }
4543 } 4544 }
4544 break; 4545 break;
4545 } 4546 }
@@ -4564,9 +4565,9 @@ w32_read_socket (struct terminal *terminal,
4564 should reflect only motion after the 4565 should reflect only motion after the
4565 ButtonPress. */ 4566 ButtonPress. */
4566 f->mouse_moved = 0; 4567 f->mouse_moved = 0;
4568 f->last_tool_bar_item = -1;
4567 } 4569 }
4568 dpyinfo->last_mouse_frame = f; 4570 dpyinfo->last_mouse_frame = f;
4569 last_tool_bar_item = -1;
4570 } 4571 }
4571 break; 4572 break;
4572 4573
@@ -6454,7 +6455,6 @@ w32_initialize (void)
6454 &w32_use_visible_system_caret, 0)) 6455 &w32_use_visible_system_caret, 0))
6455 w32_use_visible_system_caret = 0; 6456 w32_use_visible_system_caret = 0;
6456 6457
6457 last_tool_bar_item = -1;
6458 any_help_event_p = 0; 6458 any_help_event_p = 0;
6459 6459
6460 /* Initialize input mode: interrupt_input off, no flow control, allow 6460 /* Initialize input mode: interrupt_input off, no flow control, allow
diff --git a/src/xdisp.c b/src/xdisp.c
index 71398b833e8..c592e0c3116 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -11806,11 +11806,6 @@ update_menu_bar (struct frame *f, int save_match_data, int hooks_run)
11806 11806
11807#ifdef HAVE_WINDOW_SYSTEM 11807#ifdef HAVE_WINDOW_SYSTEM
11808 11808
11809/* Tool-bar item index of the item on which a mouse button was pressed
11810 or -1. */
11811
11812int last_tool_bar_item;
11813
11814/* Select `frame' temporarily without running all the code in 11809/* Select `frame' temporarily without running all the code in
11815 do_switch_frame. 11810 do_switch_frame.
11816 FIXME: Maybe do_switch_frame should be trimmed down similarly 11811 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,
12612 where the button was pressed, disregarding where it was 12607 where the button was pressed, disregarding where it was
12613 released. */ 12608 released. */
12614 if (NILP (Vmouse_highlight) && !down_p) 12609 if (NILP (Vmouse_highlight) && !down_p)
12615 prop_idx = last_tool_bar_item; 12610 prop_idx = f->last_tool_bar_item;
12616 12611
12617 /* If item is disabled, do nothing. */ 12612 /* If item is disabled, do nothing. */
12618 enabled_p = AREF (f->tool_bar_items, prop_idx + TOOL_BAR_ITEM_ENABLED_P); 12613 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,
12624 /* Show item in pressed state. */ 12619 /* Show item in pressed state. */
12625 if (!NILP (Vmouse_highlight)) 12620 if (!NILP (Vmouse_highlight))
12626 show_mouse_face (hlinfo, DRAW_IMAGE_SUNKEN); 12621 show_mouse_face (hlinfo, DRAW_IMAGE_SUNKEN);
12627 last_tool_bar_item = prop_idx; 12622 f->last_tool_bar_item = prop_idx;
12628 } 12623 }
12629 else 12624 else
12630 { 12625 {
@@ -12649,7 +12644,7 @@ handle_tool_bar_click (struct frame *f, int x, int y, int down_p,
12649 event.arg = key; 12644 event.arg = key;
12650 event.modifiers = modifiers; 12645 event.modifiers = modifiers;
12651 kbd_buffer_store_event (&event); 12646 kbd_buffer_store_event (&event);
12652 last_tool_bar_item = -1; 12647 f->last_tool_bar_item = -1;
12653 } 12648 }
12654} 12649}
12655 12650
@@ -12699,8 +12694,7 @@ note_tool_bar_highlight (struct frame *f, int x, int y)
12699 mouse_down_p = (x_mouse_grabbed (dpyinfo) 12694 mouse_down_p = (x_mouse_grabbed (dpyinfo)
12700 && f == dpyinfo->last_mouse_frame); 12695 && f == dpyinfo->last_mouse_frame);
12701 12696
12702 if (mouse_down_p 12697 if (mouse_down_p && f->last_tool_bar_item != prop_idx)
12703 && last_tool_bar_item != prop_idx)
12704 return; 12698 return;
12705 12699
12706 draw = mouse_down_p ? DRAW_IMAGE_SUNKEN : DRAW_IMAGE_RAISED; 12700 draw = mouse_down_p ? DRAW_IMAGE_SUNKEN : DRAW_IMAGE_RAISED;
diff --git a/src/xterm.c b/src/xterm.c
index 422800f3765..b6728880f5d 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -6809,9 +6809,10 @@ handle_one_xevent (struct x_display_info *dpyinfo,
6809 { 6809 {
6810 dpyinfo->grabbed |= (1 << event->xbutton.button); 6810 dpyinfo->grabbed |= (1 << event->xbutton.button);
6811 dpyinfo->last_mouse_frame = f; 6811 dpyinfo->last_mouse_frame = f;
6812 6812#if ! defined (USE_GTK)
6813 if (!tool_bar_p) 6813 if (f && !tool_bar_p)
6814 last_tool_bar_item = -1; 6814 f->last_tool_bar_item = -1;
6815#endif /* not USE_GTK */
6815 } 6816 }
6816 else 6817 else
6817 dpyinfo->grabbed &= ~(1 << event->xbutton.button); 6818 dpyinfo->grabbed &= ~(1 << event->xbutton.button);
@@ -10555,7 +10556,6 @@ x_initialize (void)
10555 baud_rate = 19200; 10556 baud_rate = 19200;
10556 10557
10557 x_noop_count = 0; 10558 x_noop_count = 0;
10558 last_tool_bar_item = -1;
10559 any_help_event_p = 0; 10559 any_help_event_p = 0;
10560 ignore_next_mouse_click_timeout = 0; 10560 ignore_next_mouse_click_timeout = 0;
10561 10561