mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-31 12:41:20 -06:00 
			
		
		
		
	Fix of #1512
"Printer Host Upload Queue vanishes in the background [1.42.0-alpha1]" the canvas3d used to grab focus when mouse entered a window even if the top level window was not active. This was now changed and the top level must be active for the canvas3d to grab the focus.
This commit is contained in:
		
							parent
							
								
									e2daf05368
								
							
						
					
					
						commit
						b7a92b5525
					
				
					 1 changed files with 9 additions and 2 deletions
				
			
		|  | @ -4906,8 +4906,15 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt) | |||
|     { | ||||
| #if defined(__WXMSW__) || defined(__linux__) | ||||
|         // On Windows and Linux needs focus in order to catch key events
 | ||||
|         if (m_canvas != nullptr) | ||||
|             m_canvas->SetFocus(); | ||||
|         if (m_canvas != nullptr) { | ||||
|             // Only set focus, if the top level window of this canvas is active.
 | ||||
| 			auto p = dynamic_cast<wxWindow*>(evt.GetEventObject()); | ||||
|             while (p->GetParent()) | ||||
|                 p = p->GetParent(); | ||||
|             auto *top_level_wnd = dynamic_cast<wxTopLevelWindow*>(p); | ||||
|             if (top_level_wnd && top_level_wnd->IsActive()) | ||||
|                 m_canvas->SetFocus(); | ||||
|         } | ||||
| 
 | ||||
|         m_mouse.set_start_position_2D_as_invalid(); | ||||
| #endif | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 bubnikv
						bubnikv