mirror of
				https://github.com/rad4day/Waybar.git
				synced 2025-11-04 01:32:42 +01:00 
			
		
		
		
	fix(sway/workspaces): ignore emulated scroll events
GDK Wayland backend can emit two events for mouse scroll: one is a GDK_SCROLL_SMOOTH and the other one is an emulated scroll event with direction. We only receive emulated events on a window, thus it is not possible to handle these in a module and stop propagation. Ignoring emulated events should be safe since those are duplicates of smooth scroll events anyways. Fixes #386
This commit is contained in:
		@@ -291,6 +291,12 @@ std::string Workspaces::getIcon(const std::string &name, const Json::Value &node
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bool Workspaces::handleScroll(GdkEventScroll *e) {
 | 
					bool Workspaces::handleScroll(GdkEventScroll *e) {
 | 
				
			||||||
 | 
					  if (gdk_event_get_pointer_emulated((GdkEvent *)e)) {
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Ignore emulated scroll events on window
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    return false;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
  auto dir = AModule::getScrollDir(e);
 | 
					  auto dir = AModule::getScrollDir(e);
 | 
				
			||||||
  if (dir == SCROLL_DIR::NONE) {
 | 
					  if (dir == SCROLL_DIR::NONE) {
 | 
				
			||||||
    return true;
 | 
					    return true;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user