Example #1
0
        bool SwitchDesk(Wnck.MotionDirection direction)
        {
            Desk activedesk = Desks.Find(desk => desk.IsActive);
            Desk nextdesk   = activedesk.GetNeighbor(direction);

            if (WrappedScrolling)
            {
                // Walk through the columns/rows and jump between [1,1] and [n,m]
                Desk tmp = activedesk.GetWrapNeighbor(direction);
                if (tmp != null && (nextdesk = tmp.GetNeighbor(Desk.AlternateMovingDirection(direction))) == null)
                {
                    if ((nextdesk = tmp.GetWrapNeighbor(Desk.AlternateMovingDirection(direction))) == null)
                    {
                        nextdesk = tmp;
                    }
                }
            }
            if (nextdesk != null)
            {
                nextdesk.Activate();
                return(true);
            }
            return(false);
        }
Example #2
0
        protected override MenuList OnGetMenuItems()
        {
            MenuList list = new MenuList();

            Desks.ForEach(d => {
                Desk desk = d;
                list[MenuListContainer.Actions].Add(new Docky.Menus.MenuItem(desk.Name, (desk.IsActive ? "desktop" : ""), (o, a) => desk.Activate()));
            });

            return(list);
        }