Skip to content

Commit d12bebf

Browse files
committed
Set fixed value to tooltip-delay
1 parent eddab83 commit d12bebf

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
@@ -163,7 +163,7 @@ - (void)scheduleClose;
163163
- (void)handleBrowseForFile:(NSDictionary *)attr;
164164
- (void)handleShowDialog:(NSDictionary *)attr;
165165
- (void)handleDeleteSign:(NSDictionary *)attr;
166-
- (void)setToolTipDelay:(NSTimeInterval)seconds;
166+
- (void)setToolTipDelay;
167167
@end
168168

169169

@@ -221,6 +221,8 @@ - (id)initWithBackend:(id)backend pid:(int)processIdentifier
221221

222222
[mainMenu addItem:appMenuItem];
223223

224+
[self setToolTipDelay];
225+
224226
isInitialized = YES;
225227

226228
// After MMVimController's initialization is completed,
@@ -1007,11 +1009,6 @@ - (void)handleMessage:(int)msgid data:(NSData *)data
10071009
[textView setToolTipAtMousePoint:toolTip];
10081010
else
10091011
[textView setToolTipAtMousePoint:nil];
1010-
} else if (SetTooltipDelayMsgID == msgid) {
1011-
NSDictionary *dict = [NSDictionary dictionaryWithData:data];
1012-
NSNumber *delay = dict ? [dict objectForKey:@"delay"] : nil;
1013-
if (delay)
1014-
[self setToolTipDelay:[delay floatValue]];
10151012
} else if (AddToMRUMsgID == msgid) {
10161013
NSDictionary *dict = [NSDictionary dictionaryWithData:data];
10171014
NSArray *filenames = dict ? [dict objectForKey:@"filenames"] : nil;
@@ -1907,18 +1904,15 @@ - (void)handleDeleteSign:(NSDictionary *)attr
19071904
[view deleteSign:[attr objectForKey:@"imgName"]];
19081905
}
19091906

1910-
- (void)setToolTipDelay:(NSTimeInterval)seconds
1907+
- (void)setToolTipDelay
19111908
{
19121909
// HACK! NSToolTipManager is an AppKit private class.
19131910
static Class TTM = nil;
19141911
if (!TTM)
19151912
TTM = NSClassFromString(@"NSToolTipManager");
19161913

1917-
if (seconds < 0)
1918-
seconds = 0;
1919-
19201914
if (TTM) {
1921-
[[TTM sharedToolTipManager] setInitialToolTipDelay:seconds];
1915+
[[TTM sharedToolTipManager] setInitialToolTipDelay:1e-6];
19221916
} else {
19231917
ASLogNotice(@"Failed to get NSToolTipManager");
19241918
}

src/MacVim/MacVim.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,6 @@ extern const char * const MMVimMsgIDStrings[];
261261
MSG(SetWindowPositionMsgID) \
262262
MSG(DeleteSignMsgID) \
263263
MSG(SetTooltipMsgID) \
264-
MSG(SetTooltipDelayMsgID) \
265264
MSG(GestureMsgID) \
266265
MSG(AddToMRUMsgID) \
267266
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)