mirror of
				https://github.com/rad4day/Waybar.git
				synced 2025-10-31 16:02:43 +01:00 
			
		
		
		
	ignore reverse-scrolling from mouse wheel
This commit is contained in:
		| @@ -100,6 +100,12 @@ 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(); | ||||||
|  |  | ||||||
|  |   // ignore reverse-scrolling if event comes from a mouse wheel | ||||||
|  |   GdkDevice* device = gdk_event_get_source_device((GdkEvent *)e); | ||||||
|  |   if (device != NULL && gdk_device_get_source(device) == GDK_SOURCE_MOUSE) { | ||||||
|  |     reverse = false; | ||||||
|  |   } | ||||||
|  |  | ||||||
|   switch (e->direction) { |   switch (e->direction) { | ||||||
|     case GDK_SCROLL_UP: |     case GDK_SCROLL_UP: | ||||||
|       return reverse ? SCROLL_DIR::DOWN : SCROLL_DIR::UP; |       return reverse ? SCROLL_DIR::DOWN : SCROLL_DIR::UP; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Kory Prince
					Kory Prince