Skip to content

Commit f87b60b

Browse files
committed
Small tweaks - delay pasting to try and fix issues pasting in some apps like mail
1 parent e01b534 commit f87b60b

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

QSPasteboardController.m

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ - (id)init {
118118
pasteboardStoreArray = [[NSMutableArray alloc] init];
119119
[self clearStore];
120120
pasteboardCacheArray = [[NSMutableArray alloc] init];
121+
asPlainText = NO;
122+
supressCapture = NO;
121123

122124
// ***warning * if pasteboard is empty, put last copyied item onto it
123125

@@ -218,13 +220,13 @@ - (void)pasteItem:(id)sender {
218220
// ***warning * the clipboard should be restored
219221
}
220222

221-
222223
- (IBAction)qsPaste:(id)sender {
223224
QSObject *selectedObject = [self selectedObject];
224225
switch (mode) {
225226
case QSPasteboardHistoryMode:
226227
case QSPasteboardStoreMode:
227228
[self copyToClipboard:selectedObject];
229+
[[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.05]];
228230
QSForcePaste();
229231
break;
230232
case QSPasteboardQueueMode:
@@ -233,6 +235,7 @@ - (IBAction)qsPaste:(id)sender {
233235
id object = (sender ? [pasteboardCacheArray objectAtIndex:0] : selectedObject);
234236
supressCapture = YES;
235237
[self copyToClipboard:object];
238+
[[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.05]];
236239
QSForcePaste();
237240
if (sender) {
238241
[pasteboardCacheArray removeObjectAtIndex:0];
@@ -523,7 +526,7 @@ - (void)keyDown:(NSEvent *)theEvent {
523526
if ([keys containsObject:
524527
chars]) {
525528
// switch between human numbering and machine numbering (0/1 start) so -1 from the chars integer value
526-
[self pasteNumber:[chars integerValue] - 1 plainText:([theEvent modifierFlags] & NSAlternateKeyMask)];
529+
[self pasteNumber:[chars integerValue] - 1 plainText:([theEvent modifierFlags] & NSEventModifierFlagOption)];
527530
return;
528531
}
529532
else if ([chars characterAtIndex:0] == NSCarriageReturnCharacter || [chars characterAtIndex:0] == NSEnterCharacter) {

Resources/Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
<key>CFBundlePackageType</key>
1818
<string>BNDL</string>
1919
<key>CFBundleShortVersionString</key>
20-
<string>1.8.6</string>
20+
<string>1.8.7</string>
2121
<key>CFBundleVersion</key>
22-
<string>170</string>
22+
<string>171</string>
2323
<key>NSHumanReadableCopyright</key>
2424
<string>Copyright © 2022, QSApp</string>
2525
<key>NSPrincipalClass</key>

0 commit comments

Comments
 (0)