Skip to content

Commit fcc6d5f

Browse files
committed
Set fixed value to tooltip-delay
1 parent 97f6809 commit fcc6d5f

File tree

5 files changed

+8
-33
lines changed

5 files changed

+8
-33
lines changed

src/MacVim/MMBackend.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,6 @@
1313
#import "vim.h"
1414

1515

16-
#ifdef FEAT_BEVAL
17-
// Seconds to delay balloon evaluation after mouse event (subtracted from
18-
// p_bdlay).
19-
extern NSTimeInterval MMBalloonEvalInternalDelay;
20-
#endif
21-
22-
2316
@interface MMBackend : NSObject <MMBackendProtocol, MMVimServerProtocol,
2417
MMVimClientProtocol> {
2518
NSMutableArray *outputQueue;

src/MacVim/MMBackend.m

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,6 @@
4646

4747
static unsigned MMServerMax = 1000;
4848

49-
#ifdef FEAT_BEVAL
50-
// Seconds to delay balloon evaluation after mouse event (subtracted from
51-
// p_bdlay so that this effectively becomes the smallest possible delay).
52-
NSTimeInterval MMBalloonEvalInternalDelay = 0.1;
53-
#endif
54-
5549
// TODO: Move to separate file.
5650
static int eventModifierFlagsToVimModMask(int modifierFlags);
5751
static int eventModifierFlagsToVimMouseModMask(int modifierFlags);
@@ -1919,7 +1913,7 @@ - (void)handleInputEvent:(int)msgid data:(NSData *)data
19191913
object:nil];
19201914
[self performSelector:@selector(bevalCallback:)
19211915
withObject:nil
1922-
afterDelay:MMBalloonEvalInternalDelay];
1916+
afterDelay:p_bdlay/1000.0];
19231917
}
19241918
#endif
19251919
} else if (MouseDownMsgID == msgid) {
@@ -1978,7 +1972,7 @@ - (void)handleInputEvent:(int)msgid data:(NSData *)data
19781972
object:nil];
19791973
[self performSelector:@selector(bevalCallback:)
19801974
withObject:nil
1981-
afterDelay:MMBalloonEvalInternalDelay];
1975+
afterDelay:p_bdlay/1000.0];
19821976
}
19831977
#endif
19841978
} else if (AddInputMsgID == msgid) {

src/MacVim/MMVimController.m

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ - (void)scheduleClose;
162162
- (void)handleBrowseForFile:(NSDictionary *)attr;
163163
- (void)handleShowDialog:(NSDictionary *)attr;
164164
- (void)handleDeleteSign:(NSDictionary *)attr;
165-
- (void)setToolTipDelay:(NSTimeInterval)seconds;
165+
- (void)setToolTipDelay;
166166
@end
167167

168168

@@ -220,6 +220,8 @@ - (id)initWithBackend:(id)backend pid:(int)processIdentifier
220220

221221
[mainMenu addItem:appMenuItem];
222222

223+
[self setToolTipDelay];
224+
223225
isInitialized = YES;
224226

225227
// After MMVimController's initialization is completed,
@@ -1006,11 +1008,6 @@ - (void)handleMessage:(int)msgid data:(NSData *)data
10061008
[textView setToolTipAtMousePoint:toolTip];
10071009
else
10081010
[textView setToolTipAtMousePoint:nil];
1009-
} else if (SetTooltipDelayMsgID == msgid) {
1010-
NSDictionary *dict = [NSDictionary dictionaryWithData:data];
1011-
NSNumber *delay = dict ? [dict objectForKey:@"delay"] : nil;
1012-
if (delay)
1013-
[self setToolTipDelay:[delay floatValue]];
10141011
} else if (AddToMRUMsgID == msgid) {
10151012
NSDictionary *dict = [NSDictionary dictionaryWithData:data];
10161013
NSArray *filenames = dict ? [dict objectForKey:@"filenames"] : nil;
@@ -1893,18 +1890,15 @@ - (void)handleDeleteSign:(NSDictionary *)attr
18931890
[view deleteSign:[attr objectForKey:@"imgName"]];
18941891
}
18951892

1896-
- (void)setToolTipDelay:(NSTimeInterval)seconds
1893+
- (void)setToolTipDelay
18971894
{
18981895
// HACK! NSToolTipManager is an AppKit private class.
18991896
static Class TTM = nil;
19001897
if (!TTM)
19011898
TTM = NSClassFromString(@"NSToolTipManager");
19021899

1903-
if (seconds < 0)
1904-
seconds = 0;
1905-
19061900
if (TTM) {
1907-
[[TTM sharedToolTipManager] setInitialToolTipDelay:seconds];
1901+
[[TTM sharedToolTipManager] setInitialToolTipDelay:1e-6];
19081902
} else {
19091903
ASLogNotice(@"Failed to get NSToolTipManager");
19101904
}

src/MacVim/MacVim.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,6 @@ extern const char * const MMVimMsgIDStrings[];
260260
MSG(SetWindowPositionMsgID) \
261261
MSG(DeleteSignMsgID) \
262262
MSG(SetTooltipMsgID) \
263-
MSG(SetTooltipDelayMsgID) \
264263
MSG(GestureMsgID) \
265264
MSG(AddToMRUMsgID) \
266265
MSG(BackingPropertiesChangedMsgID) \

src/MacVim/gui_macvim.m

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2494,12 +2494,7 @@
24942494
void
24952495
gui_mch_enable_beval_area(BalloonEval *beval UNUSED)
24962496
{
2497-
// Set the balloon delay when enabling balloon eval.
2498-
float delay = p_bdlay/1000.0f - MMBalloonEvalInternalDelay;
2499-
if (delay < 0) delay = 0;
2500-
[[MMBackend sharedInstance] queueMessage:SetTooltipDelayMsgID properties:
2501-
[NSDictionary dictionaryWithObject:[NSNumber numberWithFloat:delay]
2502-
forKey:@"delay"]];
2497+
// NOP
25032498
}
25042499

25052500
void

0 commit comments

Comments
 (0)