mirror of
				https://github.com/owntone/owntone-server.git
				synced 2025-10-30 00:05:05 -04:00 
			
		
		
		
	Fix the logoff/shutdown bug.
This commit is contained in:
		
							parent
							
								
									63b021a47e
								
							
						
					
					
						commit
						4f01d784dc
					
				| @ -59,13 +59,14 @@ namespace FireflyConfig | |||||||
| 		 | 		 | ||||||
| 		private System.ServiceProcess.ServiceController scFirefly; | 		private System.ServiceProcess.ServiceController scFirefly; | ||||||
| 		private ServiceStatus iState = ServiceStatus.Unintialized; | 		private ServiceStatus iState = ServiceStatus.Unintialized; | ||||||
| 		private bool closeFromMenu = false; |  | ||||||
| 
 | 
 | ||||||
| 		private string strPort; | 		private string strPort; | ||||||
| 		private string strServerName; | 		private string strServerName; | ||||||
| 		private string strMusicDir; | 		private string strMusicDir; | ||||||
| 		private string strPassword; | 		private string strPassword; | ||||||
| 
 | 
 | ||||||
|  | 		private bool ForceExit = false; | ||||||
|  | 
 | ||||||
| 		private System.IntPtr PipeHandle; | 		private System.IntPtr PipeHandle; | ||||||
| 		private System.IO.FileStream mPipeStream; | 		private System.IO.FileStream mPipeStream; | ||||||
| 		private byte[] PipeBuffer; | 		private byte[] PipeBuffer; | ||||||
| @ -93,6 +94,15 @@ namespace FireflyConfig | |||||||
| 		private System.Windows.Forms.CheckBox checkBoxPassword; | 		private System.Windows.Forms.CheckBox checkBoxPassword; | ||||||
| 		private System.ComponentModel.IContainer components; | 		private System.ComponentModel.IContainer components; | ||||||
| 
 | 
 | ||||||
|  | 		protected override void WndProc(ref Message msg)  | ||||||
|  | 		{ | ||||||
|  | 			if(msg.Msg == 0x11) // WM_QUERYENDSESSION | ||||||
|  | 			{ | ||||||
|  | 				ForceExit = true; | ||||||
|  | 			} | ||||||
|  | 			base.WndProc(ref msg); | ||||||
|  | 		} | ||||||
|  | 
 | ||||||
| 		public void ServiceStatusUpdate()  | 		public void ServiceStatusUpdate()  | ||||||
| 		{ | 		{ | ||||||
| 			scFirefly.Refresh(); | 			scFirefly.Refresh(); | ||||||
| @ -468,6 +478,7 @@ namespace FireflyConfig | |||||||
| 			this.Text = "Configuration"; | 			this.Text = "Configuration"; | ||||||
| 			this.WindowState = System.Windows.Forms.FormWindowState.Minimized; | 			this.WindowState = System.Windows.Forms.FormWindowState.Minimized; | ||||||
| 			this.Resize += new System.EventHandler(this.FireflyConfig_Resize); | 			this.Resize += new System.EventHandler(this.FireflyConfig_Resize); | ||||||
|  | 			this.Closing += new System.ComponentModel.CancelEventHandler(this.FireflyConfig_Closing); | ||||||
| 			this.Load += new System.EventHandler(this.FireflyConfig_Load); | 			this.Load += new System.EventHandler(this.FireflyConfig_Load); | ||||||
| 			this.groupBox1.ResumeLayout(false); | 			this.groupBox1.ResumeLayout(false); | ||||||
| 			this.ResumeLayout(false); | 			this.ResumeLayout(false); | ||||||
| @ -502,7 +513,7 @@ namespace FireflyConfig | |||||||
| 
 | 
 | ||||||
| 		private void menuItemExit_Click(object sender, System.EventArgs e) | 		private void menuItemExit_Click(object sender, System.EventArgs e) | ||||||
| 		{ | 		{ | ||||||
| 			closeFromMenu = true; | 			ForceExit = true; | ||||||
| 			Close(); | 			Close(); | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| @ -612,6 +623,12 @@ namespace FireflyConfig | |||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
|  | 		private void FireflyConfig_Closing(object sender, System.ComponentModel.CancelEventArgs e) | ||||||
|  | 		{ | ||||||
|  | 			if(!ForceExit) | ||||||
|  | 				e.Cancel = true; | ||||||
|  | 		} | ||||||
|  | 
 | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	[StructLayout(LayoutKind.Sequential)] | 	[StructLayout(LayoutKind.Sequential)] | ||||||
|  | |||||||
| @ -307,12 +307,12 @@ | |||||||
|   <data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> |   <data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | ||||||
|     <value>False</value> |     <value>False</value> | ||||||
|   </data> |   </data> | ||||||
|   <data name="$this.Localizable" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> |  | ||||||
|     <value>False</value> |  | ||||||
|   </data> |  | ||||||
|   <data name="$this.Name"> |   <data name="$this.Name"> | ||||||
|     <value>FireflyConfig</value> |     <value>FireflyConfig</value> | ||||||
|   </data> |   </data> | ||||||
|  |   <data name="$this.Localizable" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | ||||||
|  |     <value>False</value> | ||||||
|  |   </data> | ||||||
|   <data name="$this.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> |   <data name="$this.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> | ||||||
|     <value>8, 8</value> |     <value>8, 8</value> | ||||||
|   </data> |   </data> | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user