Skip to content

Commit f90dc6a

Browse files
committed
ignore reverse-scrolling from mouse wheel
1 parent 99c512d commit f90dc6a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/AModule.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,12 @@ AModule::SCROLL_DIR AModule::getScrollDir(GdkEventScroll* e) {
100100
// only affects up/down
101101
bool reverse = config_["reverse-scrolling"].asBool();
102102

103+
// ignore reverse-scrolling if event comes from a mouse wheel
104+
GdkDevice* device = gdk_event_get_source_device((GdkEvent *)e);
105+
if (device != NULL && gdk_device_get_source(device) == GDK_SOURCE_MOUSE) {
106+
reverse = false;
107+
}
108+
103109
switch (e->direction) {
104110
case GDK_SCROLL_UP:
105111
return reverse ? SCROLL_DIR::DOWN : SCROLL_DIR::UP;

0 commit comments

Comments
 (0)