dtfile: Add scroll wheel support
authorJon Trulson <jon@radscan.com>
Mon, 14 Oct 2019 20:34:56 +0000 (14:34 -0600)
committerJon Trulson <jon@radscan.com>
Mon, 14 Oct 2019 20:34:56 +0000 (14:34 -0600)
This patch was manually added via a diff supplied from a user on the
CDE mailing list: Michele Ghisolfo <ghisolfo.m@gmail.com>

cde/programs/dtfile/IconWindow.c

index 3892448e68c90745fff4f07061528ac0125f4931..a4bbeaf6c33b6457175580dc054384bd04d50dc4 100644 (file)
@@ -300,7 +300,6 @@ FileWindowInputCallback(
    Modifiers modif;
    int offset;
    Boolean found;
-
    /* Do nothing if a Button 2 drag is already ramping up */
    if (B2DragPossible)
       return;
@@ -835,7 +834,15 @@ FileWindowInputCallback(
       }
       else
       {
-         event = (XButtonPressedEvent *)new_event;
+         event = (XButtonPressedEvent *)new_event;             /* %%% */
+         if(event->button == Button4 || event->button == Button5) {
+                String p = event->button == Button4 ? "up" : "down";
+                String q = event->button == Button4 ? "IncrementUpOrLeft" : "IncrementDownOrRight";
+                  if( VerticalScrollbarIsVisible(
+                              file_mgr_rec->vertical_scroll_bar,
+                              file_mgr_rec->scroll_window))
+                      XtCallActionProc( file_mgr_rec->vertical_scroll_bar, q, new_event, &p, 1 );
+         } 
          if(event->button != Button1)
             return;
       }