mirror of https://gitlab.com/nakst/essence
				
				
				
			gui: open instance references for menus
This commit is contained in:
		
							parent
							
								
									8f411e35b7
								
							
						
					
					
						commit
						77cf096b39
					
				| 
						 | 
					@ -916,8 +916,16 @@ EsWindow *EsWindowCreate(EsInstance *instance, EsWindowStyle style) {
 | 
				
			||||||
		return nullptr;
 | 
							return nullptr;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (instance) {
 | 
				
			||||||
		window->instance = instance;
 | 
							window->instance = instance;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if (style == ES_WINDOW_NORMAL) {
 | 
				
			||||||
 | 
								// A handle to the instance is already open.
 | 
				
			||||||
 | 
							} else {
 | 
				
			||||||
 | 
								EsInstanceOpenReference(instance);
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (style == ES_WINDOW_NORMAL) {
 | 
						if (style == ES_WINDOW_NORMAL) {
 | 
				
			||||||
		window->handle = ((APIInstance *) instance->_private)->mainWindowHandle;
 | 
							window->handle = ((APIInstance *) instance->_private)->mainWindowHandle;
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
| 
						 | 
					@ -7736,8 +7744,11 @@ void UIProcessWindowManagerMessage(EsWindow *window, EsMessage *message, Process
 | 
				
			||||||
	// Check if the window has been destroyed.
 | 
						// Check if the window has been destroyed.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (message->type == ES_MSG_WINDOW_DESTROYED) {
 | 
						if (message->type == ES_MSG_WINDOW_DESTROYED) {
 | 
				
			||||||
		if (window->instance && window->instance->window == window) {
 | 
							if (window->instance) {
 | 
				
			||||||
 | 
								if (window->instance->window == window) {
 | 
				
			||||||
				window->instance->window = nullptr;
 | 
									window->instance->window = nullptr;
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			EsInstanceCloseReference(window->instance);
 | 
								EsInstanceCloseReference(window->instance);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue