changeset 2982:44ed08628516

* xterm.c (x_scroll_bar_report_motion): Set *TIME whether or not the mouse is over a scroll bar.
author Jim Blandy <jimb@redhat.com>
date Sun, 23 May 1993 20:04:26 +0000
parents c257860fda02
children 355fee3a2100
files src/xterm.c
diffstat 1 files changed, 54 insertions(+), 58 deletions(-) [+]
line wrap: on
line diff
--- a/src/xterm.c	Sun May 23 20:01:34 1993 +0000
+++ b/src/xterm.c	Sun May 23 20:04:26 1993 +0000
@@ -2388,69 +2388,65 @@
 {
   struct scroll_bar *bar = XSCROLL_BAR (last_mouse_scroll_bar);
   int win_x, win_y;
+  Window dummy_window;
+  int dummy_coord;
+  unsigned int dummy_mask;
 
   BLOCK_INPUT;
 
   /* Get the mouse's position relative to the scroll bar window, and
      report that.  */
-  {
-    Window dummy_window;
-    int dummy_coord;
-    unsigned int dummy_mask;
-
-    if (! XQueryPointer (x_current_display,
-			 SCROLL_BAR_X_WINDOW (bar),
-
-			 /* Root, child, root x and root y.  */
-			 &dummy_window, &dummy_window,
-			 &dummy_coord, &dummy_coord,
-
-			 /* Position relative to scroll bar.  */
-			 &win_x, &win_y,
-
-			 /* Mouse buttons and modifier keys.  */
-			 &dummy_mask))
-      {
-	*f = 0;
-	goto done;
-      }
-  }
-
-  {
-    int inside_height = VERTICAL_SCROLL_BAR_INSIDE_HEIGHT (XINT (bar->height));
-    int top_range     = VERTICAL_SCROLL_BAR_TOP_RANGE     (XINT (bar->height));
-
-    win_y -= VERTICAL_SCROLL_BAR_TOP_BORDER;
-
-    if (! NILP (bar->dragging))
-      win_y -= XINT (bar->dragging);
-
-    if (win_y < 0)
-      win_y = 0;
-    if (win_y > top_range)
-      win_y = top_range;
-
-    *f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window)));
-    *bar_window = bar->window;
-
-    if (! NILP (bar->dragging))
-      *part = scroll_bar_handle;
-    else if (win_y < XINT (bar->start))
-      *part = scroll_bar_above_handle;
-    else if (win_y < XINT (bar->end) + VERTICAL_SCROLL_BAR_MIN_HANDLE)
-      *part = scroll_bar_handle;
-    else
-      *part = scroll_bar_below_handle;
-
-    XSET (*x, Lisp_Int, win_y);
-    XSET (*y, Lisp_Int, top_range);
-    *time = last_mouse_movement_time;
-  }
-
-  mouse_moved = 0;
-  last_mouse_scroll_bar = Qnil;
-
- done:
+  if (! XQueryPointer (x_current_display,
+		       SCROLL_BAR_X_WINDOW (bar),
+
+		       /* Root, child, root x and root y.  */
+		       &dummy_window, &dummy_window,
+		       &dummy_coord, &dummy_coord,
+
+		       /* Position relative to scroll bar.  */
+		       &win_x, &win_y,
+
+		       /* Mouse buttons and modifier keys.  */
+		       &dummy_mask))
+    *f = 0;
+  else
+    {
+      int inside_height
+	= VERTICAL_SCROLL_BAR_INSIDE_HEIGHT (XINT (bar->height));
+      int top_range
+	= VERTICAL_SCROLL_BAR_TOP_RANGE     (XINT (bar->height));
+
+      win_y -= VERTICAL_SCROLL_BAR_TOP_BORDER;
+
+      if (! NILP (bar->dragging))
+	win_y -= XINT (bar->dragging);
+
+      if (win_y < 0)
+	win_y = 0;
+      if (win_y > top_range)
+	win_y = top_range;
+
+      *f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window)));
+      *bar_window = bar->window;
+
+      if (! NILP (bar->dragging))
+	*part = scroll_bar_handle;
+      else if (win_y < XINT (bar->start))
+	*part = scroll_bar_above_handle;
+      else if (win_y < XINT (bar->end) + VERTICAL_SCROLL_BAR_MIN_HANDLE)
+	*part = scroll_bar_handle;
+      else
+	*part = scroll_bar_below_handle;
+
+      XSET (*x, Lisp_Int, win_y);
+      XSET (*y, Lisp_Int, top_range);
+
+      mouse_moved = 0;
+      last_mouse_scroll_bar = Qnil;
+    }
+
+  *time = last_mouse_movement_time;
+
   UNBLOCK_INPUT;
 }