Exemplo n.º 1
0
        void SetTemporaryWindowGeometry(Wnck.Window window, Gdk.Rectangle area)
        {
            Gdk.Rectangle oldGeo = window.EasyGeometry ();

            oldGeo.X += parent.ViewportX;
            oldGeo.Y += parent.ViewportY;

            if (!window_states.ContainsKey (window))
                window_states [window] = new WindowState (oldGeo, window.State);

            if (window.IsMaximized)
                window.Unmaximize ();

            window.SetWorkaroundGeometry (WindowGravity.Current, MoveResizeMask, area.X, area.Y, area.Width, area.Height);
        }
Exemplo n.º 2
0
        bool WindowCenterInViewport(Wnck.Window window)
        {
            if (!window.IsOnWorkspace (parent))
                return false;

            Rectangle geo = window.EasyGeometry ();
            geo.X += parent.ViewportX;
            geo.Y += parent.ViewportY;

            Point center = new Point (geo.X + geo.Width / 2, geo.Y + geo.Height / 2);
            return Contains (center);
        }
Exemplo n.º 3
0
        public void MoveWindowInto(Wnck.Window window)
        {
            if (parent.IsVirtual) {
                Rectangle geo = window.EasyGeometry ();

                geo.X += window.Workspace.ViewportX;
                geo.Y += window.Workspace.ViewportY;

                int x = area.X + (geo.X % area.Width);
                int y = area.Y + (geo.Y % area.Height);

                x -= window.Workspace.ViewportX;
                y -= window.Workspace.ViewportY;

                window.SetWorkaroundGeometry (WindowGravity.Current, MoveMask, x, y, 0, 0);
            } else {
                window.MoveToWorkspace (parent);
            }
        }