Beispiel #1
0
        private static void MouseButtonDown(MSLLHOOKSTRUCT m)
        {
            if (HotkeyState.HasFlag(TriggerHotkeys) || TriggerHotkeys == default(state))
            {
                candidateWindow = GetWindowDetailsFromPoint(m.pt);
                if (candidateWindow.IsPartOfWindowsUI)
                {
                    Console.WriteLine("Candidate Window is shell window -- NO!");
                    candidateWindow = null;
                    return;
                }
                if (DropZone.Settings.OnlyTriggerOnTitleBarClick && m.pt.y > candidateWindow.rect.Top + candidateWindow.TitleBarHeight)
                {
                    Console.WriteLine("Click detected, but not in title bar constraints");
                    candidateWindow = null;
                    return;
                }

                HotkeyState.Add(state.active);
                new System.Threading.Tasks.Task(() =>
                {
                    mhook.MouseMove += Mhook_MouseMove;
                    renderer.ActivateSector(LayoutCollection.ActiveLayout.GetActiveZoneFromPoint(m.pt.x, m.pt.y));

                    renderer.RenderZone(ScreenInfo.GetDisplays().MaxWidth, ScreenInfo.GetDisplays().MaxHeight);
                }).Start();
#if DEBUG
                printState(m);
#endif
            }
        }
        internal override WindowRef createRef(PackFile p, long o, ByteWindow v)
        {
            var @ref = new WindowRef(p, o, v, queue);

            _openBytes.addAndGet(@ref.Size);
            return(@ref);
        }
Beispiel #3
0
        internal override void clear(WindowRef @ref)
        {
            long c = _openBytes.get();

            _openBytes.compareAndSet(c, c - @ref.Size);
            Close(@ref.pack);
        }
Beispiel #4
0
        internal override WindowRef createRef(PackFile p, long o, ByteWindow v)
        {
            var  @ref = new WindowRef(p, o, v, queue);
            long c    = _openBytes.get();

            _openBytes.compareAndSet(c, c + @ref.Size);
            return(@ref);
        }
Beispiel #5
0
 private static void MouseButtonUp(MSLLHOOKSTRUCT m)
 {
     HotkeyState.Remove(state.active);
     new System.Threading.Tasks.Task(() =>
     {
         mhook.MouseMove -= Mhook_MouseMove;
         renderer.HideZone();
         var Zone = LayoutCollection.ActiveLayout.GetActiveZoneFromPoint(m.pt.x, m.pt.y);
         if (Zone != null && candidateWindow != null)
         {
             candidateWindow.MoveTo(Zone.Target.Left, Zone.Target.Top, Zone.Target.Right, Zone.Target.Bottom);
         }
         candidateWindow = null;
     }).Start();
 }
 internal override void clear(WindowRef @ref)
 {
     _openBytes.addAndGet([email protected]);
     Close(@ref.pack);
 }