Skip to content

Commit

Permalink
added readme and safeguard in desktop_del
Browse files Browse the repository at this point in the history
  • Loading branch information
henkman committed Oct 4, 2013
1 parent fff1582 commit c034afd
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
virgo
=====

Virtual Desktop for Windows
Virtual Desktop Manager for Windows

Hotkeys:

ALT + 1..4 -> changes to desktop 1..4
CTRL + 1..4 -> moves active window to desktop 1..4
ALT + CTRL + SHIFT + Q -> exits the program

build with

$ make
5 changes: 4 additions & 1 deletion virgo.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,16 @@ static void desktop_add(desktop_t *desk, HWND hwnd)

static void desktop_del(desktop_t *desk, HWND hwnd)
{
int i, o = 0;
int i, o = -1;
for(i = 0; i < desk->wincount; i++) {
if(desk->windows[i] == hwnd) {
o = i;
break;
}
}
if(o == -1) {
return;
}
for(i = o; i < (desk->wincount - 1); i++) {
desk->windows[i] = desk->windows[i + 1];
}
Expand Down

0 comments on commit c034afd

Please sign in to comment.