]> git.eshelyaron.com Git - emacs.git/commitdiff
Handle GraphicsExpose events on scroll bars
authorPo Lu <luangruo@yahoo.com>
Tue, 3 May 2022 05:40:54 +0000 (13:40 +0800)
committerPo Lu <luangruo@yahoo.com>
Tue, 3 May 2022 05:40:54 +0000 (13:40 +0800)
* src/xterm.c (x_scroll_bar_expose): Handle GraphicsExpose
events.
(handle_one_xevent): Give graphics exposures to scroll bars.

src/xterm.c

index 367e69fb956d42c00d357223c85553511942a55b..90182a89f1fb275c05ce8a5f806da047156752b0 100644 (file)
@@ -13143,6 +13143,22 @@ x_scroll_bar_expose (struct scroll_bar *bar, const XEvent *event)
 #else
   Drawable w = bar->x_drawable;
 #endif
+  int x, y, width, height;
+
+  if (event->type == Expose)
+    {
+      x = event->xexpose.x;
+      y = event->xexpose.y;
+      width = event->xexpose.width;
+      height = event->xexpose.height;
+    }
+  else
+    {
+      x = event->xgraphicsexpose.x;
+      y = event->xgraphicsexpose.y;
+      width = event->xgraphicsexpose.width;
+      height = event->xgraphicsexpose.height;
+    }
 
   struct frame *f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window)));
   GC gc = f->output_data.x->normal_gc;
@@ -13161,10 +13177,7 @@ x_scroll_bar_expose (struct scroll_bar *bar, const XEvent *event)
 
       XFillRectangle (FRAME_X_DISPLAY (f),
                      bar->x_drawable,
-                     gc, event->xexpose.x,
-                     event->xexpose.y,
-                     event->xexpose.width,
-                     event->xexpose.height);
+                     gc, x, y, width, height);
 
       XSetForeground (FRAME_X_DISPLAY (f), gc,
                      FRAME_FOREGROUND_PIXEL (f));
@@ -14835,6 +14848,16 @@ handle_one_xevent (struct x_display_info *dpyinfo,
          show_back_buffer (f);
 #endif
         }
+#ifndef USE_TOOLKIT_SCROLL_BARS
+      struct scroll_bar *bar
+       = x_window_to_scroll_bar (dpyinfo->display,
+                                 /* Hopefully this is just a window,
+                                    not the back buffer.  */
+                                 event->xgraphicsexpose.drawable, 2);
+
+      if (bar)
+       x_scroll_bar_expose (bar, event);
+#endif
 #ifdef USE_X_TOOLKIT
       else
         goto OTHER;