mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
add reverse-mouse-scrolling to configure mouse wheel reverse scrolling
This commit is contained in:
parent
7a01143359
commit
1ba05d1ffa
@ -99,11 +99,12 @@ bool AModule::handleToggle(GdkEventButton* const& e) {
|
|||||||
AModule::SCROLL_DIR AModule::getScrollDir(GdkEventScroll* e) {
|
AModule::SCROLL_DIR AModule::getScrollDir(GdkEventScroll* e) {
|
||||||
// only affects up/down
|
// only affects up/down
|
||||||
bool reverse = config_["reverse-scrolling"].asBool();
|
bool reverse = config_["reverse-scrolling"].asBool();
|
||||||
|
bool reverse_mouse = config_["reverse-mouse-scrolling"].asBool();
|
||||||
|
|
||||||
// ignore reverse-scrolling if event comes from a mouse wheel
|
// ignore reverse-scrolling if event comes from a mouse wheel
|
||||||
GdkDevice* device = gdk_event_get_source_device((GdkEvent *)e);
|
GdkDevice* device = gdk_event_get_source_device((GdkEvent *)e);
|
||||||
if (device != NULL && gdk_device_get_source(device) == GDK_SOURCE_MOUSE) {
|
if (device != NULL && gdk_device_get_source(device) == GDK_SOURCE_MOUSE) {
|
||||||
reverse = false;
|
reverse = reverse_mouse;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (e->direction) {
|
switch (e->direction) {
|
||||||
|
Loading…
Reference in New Issue
Block a user