Tree/Table on Win32 receive SWT.MouseHorizontalWheel but scroll vertically instead of horizontally

Đang mở
#3,462 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
55/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
java
Lĩnh vực
desktop

Hướng nghiên cứu

Start by reading Scrollable.WM_MOUSEHWHEEL() and the wmScrollWheel(..., true) path mentioned in the report, then compare how Tree and StyledText handle horizontal wheel events. Reproduce with a Tree or Table using SWT.H_SCROLL on Win32 and check whether horizontal input scrolls horizontally rather than vertically. The report does not name a test file.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Environment:

  • Windows 10
  • Eclipse Platform 4.40
  • SWT Win32
  • Logitech MX Master 3S (thumb wheel)

Observed behavior:

When using the horizontal mouse wheel over SWT Tree and Table controls, SWT correctly generates SWT.MouseHorizontalWheel events.

However, the controls do not scroll horizontally. Instead, the content scrolls vertically, behaving as if a normal mouse wheel event had been received.

The same horizontal wheel works as expected in StyledText controls.

Reproduction:

  1. Create a Tree or Table with SWT.H_SCROLL.
  2. Ensure horizontal scrolling is possible.
  3. Move the horizontal wheel (thumb wheel on MX Master 3S).

Expected result:

The Tree/Table content scrolls horizontally.

Actual result:

The content scrolls vertically.

Additional observations:

The following SWT event is received:

SWT.MouseHorizontalWheel

For example:

HORIZONTAL
count: -3
class: class org.eclipse.swt.widgets.Tree

The control has a valid horizontal scrollbar:

org.eclipse.swt.widgets.Tree hBar=ScrollBar {}

The same behavior occurs with:

  • Tree
  • Table
  • TreeViewer
  • TableViewer
  • CommonNavigator

StyledText behaves correctly and scrolls horizontally.

Source investigation:

While debugging SWT Win32 sources I found that
Scrollable.WM_MOUSEHWHEEL() delegates to:

wmScrollWheel(..., true)

For Tree controls, the 'update' parameter is false because
(state & CANVAS) == 0.

Consequently execution follows the non-update code path:

long code = callWindowProc(
    handle,
    OS.WM_MOUSEWHEEL,
    wParam,
    lParam);

which appears to invoke WM_MOUSEWHEEL even for WM_MOUSEHWHEEL processing.

I am not yet sure whether this is the root cause, but it seemed noteworthy enough to mention.

Ngôn ngữ chính
Java
Star
202
Fork
206
Merge trung bình
1 ngày 12 giờ
Pull request đã merge (30 ngày)
115

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của eclipse-platform/eclipse.platform.swt

Tất cả issue của eclipse-platform/eclipse.platform.swt

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.