diff --git a/App.xaml.cs b/App.xaml.cs index 13ca28e..7d75616 100644 --- a/App.xaml.cs +++ b/App.xaml.cs @@ -127,7 +127,7 @@ public static void Quit(bool savesetting) { win.CurrentSetting.Win_Pos = new Point(win.Left, win.Top); win.CurrentSetting.Win_Size = new Size(win.Width, win.Height); - win.CurrentSetting.DockedTo = (int)win.DockedTo; + win.CurrentSetting.DockedTo = (int)win.lastdockstatus; } } DesktopNote.Properties.Settings.Default.Save(); diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs index 5d87353..7677538 100644 --- a/MainWindow.xaml.cs +++ b/MainWindow.xaml.cs @@ -393,14 +393,7 @@ private void Win_Main_Loaded(object sender, RoutedEventArgs e) } //tray icon double click - App.TrayIcon.TrayMouseDoubleClick += (obj, args) => - { - foreach (var win in App.MainWindows) - { - win.Activate(); - win.UnDock(); - } - }; + App.TrayIcon.TrayMouseDoubleClick += TrayIcon_TrayMouseDoubleClick; } //check and merge previous settings @@ -418,7 +411,7 @@ private void Win_Main_Loaded(object sender, RoutedEventArgs e) Top = CurrentSetting.Win_Pos.Y; lastdockstatus = (DockStatus)CurrentSetting.DockedTo; - DockedTo = lastdockstatus; + //DockedTo = DockStatus.None; RTB_Main.FontFamily = new FontFamily(CurrentSetting.Font); RTB_Main.Foreground = new SolidColorBrush(CurrentSetting.FontColor); RTB_Main.Background = new SolidColorBrush(CurrentSetting.BackColor); @@ -498,7 +491,7 @@ private void Win_Main_Loaded(object sender, RoutedEventArgs e) RTB_Main.IsUndoEnabled = true; //without the above two lines, Load actions can be undone. - App.CurrScrnRect = new GetCurrentMonitor().GetInfo(this); + if (CurrentSetting.AutoDock) DockToSide(true); var task_save = new Thread(SaveNotes) { IsBackground = true }; task_save.Start(); @@ -507,7 +500,7 @@ private void Win_Main_Loaded(object sender, RoutedEventArgs e) source.AddHook(WndProc); } - + private IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled) { if (msg == SingleInstance.RegisteredWM) @@ -556,6 +549,15 @@ private void TM_NewNote_Click(object sender, RoutedEventArgs e) { Win_Format.NewNote(); } + + private void TrayIcon_TrayMouseDoubleClick(object sender, RoutedEventArgs e) + { + foreach (var win in App.MainWindows) + { + win.Activate(); + win.UnDock(); + } + } #endregion diff --git a/bin/Release/DesktopNote.exe b/bin/Release/DesktopNote.exe index e870b62..63c471f 100644 Binary files a/bin/Release/DesktopNote.exe and b/bin/Release/DesktopNote.exe differ