mirror of
				https://github.com/Ryujinx/SDL.git
				synced 2025-11-04 14:24:53 +00:00 
			
		
		
		
	Fixed bug 3550 - No mouse move messages send while over the titlebar and windows edges
Matthew Its possible to set SDL_CaptureMouse() so you continue receiving mouse input while the mouse is outside your window. This works however There is then a gap where no messages send, which is when the mouse is hovering the title bar and the window edges.
This commit is contained in:
		
							parent
							
								
									c3eea703ee
								
							
						
					
					
						commit
						869b7fe314
					
				| 
						 | 
					@ -524,9 +524,14 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
 | 
				
			||||||
                } else if (isCapture) {
 | 
					                } else if (isCapture) {
 | 
				
			||||||
                    /* we check for where Windows thinks the system cursor lives in this case, so we don't really lose mouse accel, etc. */
 | 
					                    /* we check for where Windows thinks the system cursor lives in this case, so we don't really lose mouse accel, etc. */
 | 
				
			||||||
                    POINT pt;
 | 
					                    POINT pt;
 | 
				
			||||||
 | 
					                    RECT hwndRect;
 | 
				
			||||||
                    GetCursorPos(&pt);
 | 
					                    GetCursorPos(&pt);
 | 
				
			||||||
                    if (WindowFromPoint(pt) != hwnd) {  /* if in the window, WM_MOUSEMOVE, etc, will cover it. */
 | 
					                    HWND currentHnd = WindowFromPoint( pt );
 | 
				
			||||||
                        ScreenToClient(hwnd, &pt);
 | 
					                    ScreenToClient( hwnd, &pt );
 | 
				
			||||||
 | 
					                    GetClientRect( hwnd, &hwndRect );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    /* if in the window, WM_MOUSEMOVE, etc, will cover it. */
 | 
				
			||||||
 | 
					                    if( currentHnd != hwnd || pt.x < 0 || pt.y < 0 || pt.x > hwndRect.right || pt.y > hwndRect.right ) {
 | 
				
			||||||
                        SDL_SendMouseMotion(data->window, 0, 0, (int) pt.x, (int) pt.y);
 | 
					                        SDL_SendMouseMotion(data->window, 0, 0, (int) pt.x, (int) pt.y);
 | 
				
			||||||
                        SDL_SendMouseButton(data->window, 0, GetAsyncKeyState(VK_LBUTTON) & 0x8000 ? SDL_PRESSED : SDL_RELEASED, SDL_BUTTON_LEFT);
 | 
					                        SDL_SendMouseButton(data->window, 0, GetAsyncKeyState(VK_LBUTTON) & 0x8000 ? SDL_PRESSED : SDL_RELEASED, SDL_BUTTON_LEFT);
 | 
				
			||||||
                        SDL_SendMouseButton(data->window, 0, GetAsyncKeyState(VK_RBUTTON) & 0x8000 ? SDL_PRESSED : SDL_RELEASED, SDL_BUTTON_RIGHT);
 | 
					                        SDL_SendMouseButton(data->window, 0, GetAsyncKeyState(VK_RBUTTON) & 0x8000 ? SDL_PRESSED : SDL_RELEASED, SDL_BUTTON_RIGHT);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue