mirror of
				https://github.com/Ryujinx/Opentk.git
				synced 2025-11-04 12:04:57 +00:00 
			
		
		
		
	Fixed shutdown sequence in Windows, so that GameWindow.Exit() and pressing the 'close' button behave the same.
This commit is contained in:
		
							parent
							
								
									6c43d97cf4
								
							
						
					
					
						commit
						a1fb128a70
					
				| 
						 | 
				
			
			@ -550,12 +550,10 @@ namespace OpenTK
 | 
			
		|||
                    if (Exists)
 | 
			
		||||
                        glWindow.DestroyWindow();
 | 
			
		||||
                    while (this.Exists)
 | 
			
		||||
                    {
 | 
			
		||||
                        this.ProcessEvents();
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        #endregion
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -1327,6 +1325,13 @@ namespace OpenTK
 | 
			
		|||
 | 
			
		||||
    class GameWindowExitException : ApplicationException
 | 
			
		||||
    {
 | 
			
		||||
        public override string Message
 | 
			
		||||
        {
 | 
			
		||||
            get
 | 
			
		||||
            {
 | 
			
		||||
                return "GameWindow exit event. If this is caught in Visual Studio, don't worry - this is perfectly normal.";
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    #endregion
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -110,11 +110,14 @@ namespace OpenTK.Platform.Windows
 | 
			
		|||
                    return;
 | 
			
		||||
 | 
			
		||||
                case WindowMessage.CLOSE:
 | 
			
		||||
                    this.DestroyWindow();
 | 
			
		||||
                    //this.DestroyWindow();
 | 
			
		||||
                    this.OnDestroy(EventArgs.Empty);
 | 
			
		||||
                    return;
 | 
			
		||||
 | 
			
		||||
                case WindowMessage.DESTROY:
 | 
			
		||||
                    this.OnDestroy(EventArgs.Empty);
 | 
			
		||||
                    //this.OnDestroy(EventArgs.Empty);
 | 
			
		||||
                    exists = false;
 | 
			
		||||
                    isExiting = true;
 | 
			
		||||
                    break;
 | 
			
		||||
 | 
			
		||||
                case WindowMessage.QUIT:
 | 
			
		||||
| 
						 | 
				
			
			@ -368,10 +371,8 @@ namespace OpenTK.Platform.Windows
 | 
			
		|||
            }
 | 
			
		||||
 | 
			
		||||
            if (this.Create != null)
 | 
			
		||||
            {
 | 
			
		||||
                this.Create(this, e);
 | 
			
		||||
        }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        #endregion
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -392,11 +393,10 @@ namespace OpenTK.Platform.Windows
 | 
			
		|||
 | 
			
		||||
        public void OnDestroy(EventArgs e)
 | 
			
		||||
        {
 | 
			
		||||
            Debug.Print("Destroy event fired from window: {0}", window.ToString());
 | 
			
		||||
            if (this.Destroy != null)
 | 
			
		||||
            {
 | 
			
		||||
                this.Destroy(this, e);
 | 
			
		||||
            }
 | 
			
		||||
            
 | 
			
		||||
            /*
 | 
			
		||||
            if (this.Handle != IntPtr.Zero)
 | 
			
		||||
            {
 | 
			
		||||
                Debug.Print("Window handle {0} destroyed.", this.Handle);
 | 
			
		||||
| 
						 | 
				
			
			@ -404,6 +404,7 @@ namespace OpenTK.Platform.Windows
 | 
			
		|||
                //this.Dispose();
 | 
			
		||||
                exists = false;
 | 
			
		||||
            }
 | 
			
		||||
            */
 | 
			
		||||
            //API.PostQuitMessage(0);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue