private static void RestoreWindowState(Gtk.Window window)
        {
            var position      = Properties.Settings.Default.WindowPosition;
            var positionValid = false;

            foreach (var desktopWorkArea in Gdk.Global.DesktopWorkareas)
            {
                positionValid = desktopWorkArea.Contains(position);
                if (positionValid)
                {
                    break;
                }
            }
            if (!positionValid)
            {
                var desktop = Gdk.Global.CurrentDesktop;
                var currentDesktopWorkArea = Gdk.Global.DesktopWorkareas[desktop];
                position.X = currentDesktopWorkArea.Left + 40;
                position.Y = currentDesktopWorkArea.Top + 40;
            }
            var size  = Properties.Settings.Default.WindowSize;
            var state = Properties.Settings.Default.WindowState;

            window.Move(position.X, position.Y);
            window.Resize(size.Width, size.Height);
            if (state.HasFlag(Gdk.WindowState.Maximized))
            {
                window.Maximize();
            }
            if (state.HasFlag(Gdk.WindowState.Fullscreen))
            {
                window.Fullscreen();
            }
        }
Ejemplo n.º 2
0
 public virtual void SetIsFullscreen(Gtk.Window window, bool isFullscreen)
 {
     window.Data ["isFullScreen"] = isFullscreen;
     if (isFullscreen)
     {
         window.Fullscreen();
     }
     else
     {
         window.Unfullscreen();
         SetMainWindowDecorations(window);
     }
 }
Ejemplo n.º 3
0
 public virtual void SetIsFullscreen(Window window, bool isFullscreen)
 {
     Gtk.Window windowControl = window;
     windowControl.Data ["isFullScreen"] = isFullscreen;
     if (isFullscreen)
     {
         windowControl.Fullscreen();
     }
     else
     {
         windowControl.Unfullscreen();
         SetMainWindowDecorations(windowControl);
     }
 }