Skip to content

Commit 79a49ff

Browse files
committed
-r handles negative coords correctly (fixes #119)
1 parent 4eb0a99 commit 79a49ff

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

cliclick.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,9 @@ int main (int argc, const char * argv[]) {
165165
}
166166

167167
if (restoreOption) {
168-
NSString *positionString = [NSString stringWithFormat:@"%d,%d", (int)initialMousePosition.x, (int)initialMousePosition.y];
168+
// Note: we have to prefix the coordinates with "=" to ensure they are not interpreted
169+
// as relative values, see https://github.com/BlueM/cliclick/issues/119
170+
NSString *positionString = [NSString stringWithFormat:@"=%d,=%d", (int)initialMousePosition.x, (int)initialMousePosition.y];
169171
id moveAction = [[MoveAction alloc] init];
170172
[moveAction performActionWithData:positionString
171173
withOptions:executionOptions];

cliclick_Prefix.pch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
#endif
99

1010
// Version or branch
11-
#define VERSION @"5.0"
11+
#define VERSION @"5.0.1"
1212

1313
// Date as m/d/Y
14-
#define RELEASEDATE @"2021-02-27"
14+
#define RELEASEDATE @"2021-08-07"
1515

1616
#define MODE_REGULAR 0
1717
#define MODE_VERBOSE 1

0 commit comments

Comments
 (0)