Skip to content

fix(gui): horizontal scrolling in linux#2229

Merged
skylot merged 2 commits intoskylot:masterfrom
Mino260806:fix_horizontal_scroll_linux
Jul 31, 2024
Merged

fix(gui): horizontal scrolling in linux#2229
skylot merged 2 commits intoskylot:masterfrom
Mino260806:fix_horizontal_scroll_linux

Conversation

@Mino260806
Copy link
Copy Markdown
Contributor

@Mino260806 Mino260806 commented Jul 31, 2024

I had to dig in intellij community source code, as horizontal scrolling works fine there and it also happens to use Java AWT.

I attached jdb debugger to intellij and put a breakpoint on "MouseWheelEvent", simulated horizontal scroll, and it lead me to the code snippets below :

Here's how it's handled in intellij

https://github.com/JetBrains/intellij-community/blob/654dcd7a253d7f527b1d4d6d17be532a40775b1d/platform/platform-impl/src/com/intellij/ide/IdeEventQueue.kt#L1032-L1049

https://github.com/JetBrains/intellij-community/blob/654dcd7a253d7f527b1d4d6d17be532a40775b1d/platform/util/ui/src/com/intellij/util/ui/StartupUiUtil.kt#L184-L189

I copied these three methods in this commit to a custom JadxEventQueue, should I mention the original sources in the code ?

Anyway, horizontal scrolling is now working as expected


@skylot
Copy link
Copy Markdown
Owner

skylot commented Jul 31, 2024

This looks like a black magic to me 🤣
Also, as I remember, mouse buttons number after 3 not fixed and may change depending on hardware.
Anyway, if this works for IntelliJ users and resolve issue for you, so this is fine to merge.
@Mino260806 thank you for your research 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants