]> code.delx.au - gnu-emacs/commitdiff
* dispextern.h (last_tool_bar_item): Remove declaration.
authorDmitry Antipov <dmantipov@yandex.ru>
Tue, 10 Jun 2014 04:55:03 +0000 (08:55 +0400)
committerDmitry Antipov <dmantipov@yandex.ru>
Tue, 10 Jun 2014 04:55:03 +0000 (08:55 +0400)
* 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.

src/ChangeLog
src/dispextern.h
src/frame.c
src/frame.h
src/w32term.c
src/xdisp.c
src/xterm.c

index e050baeb935c86737ee6980dcfcfd42548a334a1..f15c0f5f7989bf6096a19cecbf6b84430348497f 100644 (file)
        * 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.
index 21ed5f70ad2fce148214b04da170c92616d2af34..e710f8e35d700ffd73b961894c07215f4a2c2d8e 100644 (file)
@@ -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 *,
index e75a74be93889bd0be5cfd102578010fb00b300f..9d8208196232d4baca26093098da59a20baba61b 100644 (file)
@@ -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 ();
index 0ee97f0b3f392c0f6d4386d674862af2322b861a..a962e91ce2dd00e1e67ee990688d1bd11ebacb68 100644 (file)
@@ -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;
 
index fc45bdd30a3842dbdfb363d0579b3a808689bc91..553764a8de53c2717468e3fb37b93867c602452a 100644 (file)
@@ -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
index 71398b833e82d23b28b68a61225f8c96bad6dcca..c592e0c311699db7e8cbe7a9233dc89b864b1649 100644 (file)
@@ -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;
index 422800f3765c91f0fbb103c7f38901dd2766965f..b6728880f5d3644fcf96a2149d97120b224c8854 100644 (file)
@@ -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;