private void CloseOverlay_CompositionTarget_Rendering(object sender, EventArgs e) { // runs once per frame during overlay close // it generally takes 2 frames to render the mask image int waitFrames = 2; if (renderOverlayFrames == waitFrames) { // close the overlay window DesktopOverlayWindow.Close(); // migrate the icons control to the desktop window DesktopOverlayWindow.grid.Children.Clear(); DesktopWindow.grid.Children.Add(DesktopIconsControl); // once the control has been migrated, remove the mask image DesktopWindow.grid.Children.RemoveAt(0); // remove reference to the overlay window to allow GC DesktopOverlayWindow = null; // we're done here, stop this callback from executing again CompositionTarget.Rendering -= CloseOverlay_CompositionTarget_Rendering; } renderOverlayFrames++; }
private void teardownDesktop(bool isShutdown) { // close windows DesktopOverlayWindow?.Close(); DesktopOverlayWindow = null; destroyToolbar(); destroyDesktopWindow(); // show the windows desktop Shell.ToggleDesktopIcons(true); // destroy the native shell window if (ShellWindow != null && isShutdown) { NativeMethods.DestroyWindow(ShellWindow.Handle); } // destroy the navigation manager NavigationManager = null; // destroy icons control DesktopIconsControl = null; // unregister desktop overlay hotkey unregisterHotKey(); }
public void ResetPosition(bool renderBackground = true) { setShellWindowSize(); DesktopOverlayWindow?.ResetPosition(); DesktopWindow?.ResetPosition(); if (renderBackground && isShellWindow) { DesktopWindow?.ReloadBackground(); } }
public void ResetPosition(bool displayChanged) { setShellWindowSize(); DesktopOverlayWindow?.ResetPosition(); if (displayChanged && DesktopWindow != null) { destroyDesktopWindow(); createDesktopWindow(); } else { DesktopWindow?.ResetPosition(); } }
private void DestroyDesktopBrowser() { DesktopOverlayWindow?.Close(); DesktopOverlayWindow = null; DestroyToolbar(); NavigationManager = null; if (DesktopWindow != null) { // remove desktop icons control DesktopWindow.grid.Children.Clear(); } DesktopIconsControl = null; UnregisterHotKey(); }
private void teardownDesktop() { // close windows DesktopOverlayWindow?.Close(); DesktopOverlayWindow = null; destroyToolbar(); destroyDesktopWindow(); // show the windows desktop Shell.ToggleDesktopIcons(true); // destroy the native shell window destroyShellWindow(); // destroy the navigation manager NavigationManager = null; // destroy icons control DesktopIconsControl = null; // unregister desktop overlay hotkey unregisterHotKey(); }