XQuartz: Don't report mouse events while X11 is not the foreground application
(cherry picked from commit 5d1dd35096334b59564d77caef7a97bd58845c5d)
This commit is contained in:
		
							parent
							
								
									89887fadc9
								
							
						
					
					
						commit
						3311ef6ec9
					
				| 
						 | 
					@ -1067,15 +1067,14 @@ static inline int ensure_flag(int flags, int device_independent, int device_depe
 | 
				
			||||||
                pDev = darwinTabletCurrent;
 | 
					                pDev = darwinTabletCurrent;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            if(!quartzServerVisible) {
 | 
				
			||||||
 | 
					#if 0
 | 
				
			||||||
/* Seems this has somehow triggered 100% CPU usage while X11.app is in the
 | 
					/* Seems this has somehow triggered 100% CPU usage while X11.app is in the
 | 
				
			||||||
 * background on some obscure HW configurations.
 | 
					 * background on some obscure HW configurations.
 | 
				
			||||||
 * http://xquartz.macosforge.org/trac/ticket/241
 | 
					 * http://xquartz.macosforge.org/trac/ticket/241
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
#if 0
 | 
					//#if defined(XPLUGIN_VERSION) && XPLUGIN_VERSION > 0
 | 
				
			||||||
/* Older libXplugin (Tiger/"Stock" Leopard) aren't thread safe, so we can't call xp_find_window from the Appkit thread */
 | 
					/* Older libXplugin (Tiger/"Stock" Leopard) aren't thread safe, so we can't call xp_find_window from the Appkit thread */
 | 
				
			||||||
#ifdef XPLUGIN_VERSION
 | 
					 | 
				
			||||||
#if XPLUGIN_VERSION > 0
 | 
					 | 
				
			||||||
            if(!quartzServerVisible) {
 | 
					 | 
				
			||||||
                xp_window_id wid;
 | 
					                xp_window_id wid;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                /* Sigh. Need to check that we're really over one of
 | 
					                /* Sigh. Need to check that we're really over one of
 | 
				
			||||||
| 
						 | 
					@ -1088,11 +1087,9 @@ static inline int ensure_flag(int flags, int device_independent, int device_depe
 | 
				
			||||||
                
 | 
					                
 | 
				
			||||||
                if (xp_find_window(pointer_x, pointer_y, 0, &wid) == XP_Success &&
 | 
					                if (xp_find_window(pointer_x, pointer_y, 0, &wid) == XP_Success &&
 | 
				
			||||||
                    wid == 0)
 | 
					                    wid == 0)
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
                    return;        
 | 
					                    return;        
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
            
 | 
					            
 | 
				
			||||||
            DarwinSendPointerEvents(pDev, ev_type, ev_button, pointer_x, pointer_y,
 | 
					            DarwinSendPointerEvents(pDev, ev_type, ev_button, pointer_x, pointer_y,
 | 
				
			||||||
                                    pressure, tilt_x, tilt_y);
 | 
					                                    pressure, tilt_x, tilt_y);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue