Esempio n. 1
0
        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++;
        }
Esempio n. 2
0
        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();
        }
Esempio n. 3
0
        public void ResetPosition(bool renderBackground = true)
        {
            setShellWindowSize();

            DesktopOverlayWindow?.ResetPosition();
            DesktopWindow?.ResetPosition();
            if (renderBackground && isShellWindow)
            {
                DesktopWindow?.ReloadBackground();
            }
        }
Esempio n. 4
0
        public void ResetPosition(bool displayChanged)
        {
            setShellWindowSize();

            DesktopOverlayWindow?.ResetPosition();

            if (displayChanged && DesktopWindow != null)
            {
                destroyDesktopWindow();
                createDesktopWindow();
            }
            else
            {
                DesktopWindow?.ResetPosition();
            }
        }
Esempio n. 5
0
        private void DestroyDesktopBrowser()
        {
            DesktopOverlayWindow?.Close();
            DesktopOverlayWindow = null;
            DestroyToolbar();
            NavigationManager = null;

            if (DesktopWindow != null)
            {
                // remove desktop icons control
                DesktopWindow.grid.Children.Clear();
            }

            DesktopIconsControl = null;

            UnregisterHotKey();
        }
Esempio n. 6
0
        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();
        }