mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 06:20:06 +00:00 
			
		
		
		
	Support events over multiple ImGui contexts
This commit is contained in:
		
							parent
							
								
									f27e2534a7
								
							
						
					
					
						commit
						fcb89926ca
					
				
					 2 changed files with 16 additions and 1 deletions
				
			
		
							
								
								
									
										2
									
								
								external/imgui-backend-qt
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								external/imgui-backend-qt
									
										
									
									
										vendored
									
									
								
							|  | @ -1 +1 @@ | ||||||
| Subproject commit 0ebc0fe7fa88aa3d1eb58b2f040f11ba45227829 | Subproject commit a914f1811185f5959d50f2a199420dee4d15ae74 | ||||||
|  | @ -75,7 +75,22 @@ std::string ImGuiDebugWidget::context_name() const | ||||||
| 
 | 
 | ||||||
| void ImGuiDebugWidget::set_current_context(ImGuiContext* context) | void ImGuiDebugWidget::set_current_context(ImGuiContext* context) | ||||||
| { | { | ||||||
|  |    if (context == p->currentContext_) | ||||||
|  |    { | ||||||
|  |       return; | ||||||
|  |    } | ||||||
|  | 
 | ||||||
|  |    // Unregister widget with current context
 | ||||||
|  |    ImGui::SetCurrentContext(p->currentContext_); | ||||||
|  |    ImGui_ImplQt_UnregisterWidget(this); | ||||||
|  | 
 | ||||||
|    p->currentContext_ = context; |    p->currentContext_ = context; | ||||||
|  | 
 | ||||||
|  |    // Register widget with new context
 | ||||||
|  |    ImGui::SetCurrentContext(context); | ||||||
|  |    ImGui_ImplQt_RegisterWidget(this); | ||||||
|  | 
 | ||||||
|  |    // Queue an update
 | ||||||
|    update(); |    update(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat