Skip to content

Commit

Permalink
refactoring.
Browse files Browse the repository at this point in the history
  • Loading branch information
Grabacr07 committed Sep 20, 2015
1 parent 8e95c53 commit 6c88760
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 22 deletions.
27 changes: 6 additions & 21 deletions source/SylphyHorn/Models/HookService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,8 @@ private VirtualDesktop MoveToLeft()
}
if (left != null)
{
if (InteropHelper.IsCurrentProcess(hWnd))
{
VirtualDesktopHelper.MoveToDesktop(hWnd, left);
return left;
}

if (this.helper.MoveWindowToDesktop(hWnd, left.Id))
if (VirtualDesktopHelper.MoveToDesktop(hWnd, left)
|| this.helper.MoveWindowToDesktop(hWnd, left.Id))
{
return left;
}
Expand Down Expand Up @@ -178,13 +173,8 @@ private VirtualDesktop MoveToRight()
}
if (right != null)
{
if (InteropHelper.IsCurrentProcess(hWnd))
{
VirtualDesktopHelper.MoveToDesktop(hWnd, right);
return right;
}

if (this.helper.MoveWindowToDesktop(hWnd, right.Id))
if (VirtualDesktopHelper.MoveToDesktop(hWnd, right)
|| this.helper.MoveWindowToDesktop(hWnd, right.Id))
{
return right;
}
Expand All @@ -201,13 +191,8 @@ private VirtualDesktop MoveToNew()
var newone = VirtualDesktop.Create();
if (newone != null)
{
if (InteropHelper.IsCurrentProcess(hWnd))
{
VirtualDesktopHelper.MoveToDesktop(hWnd, newone);
return newone;
}

if (this.helper.MoveWindowToDesktop(hWnd, newone.Id))
if (VirtualDesktopHelper.MoveToDesktop(hWnd, newone)
|| this.helper.MoveWindowToDesktop(hWnd, newone.Id))
{
return newone;
}
Expand Down

0 comments on commit 6c88760

Please sign in to comment.