Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

don’t release Large Type windows on close #2521

Merged
merged 2 commits into from
Jun 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 0 additions & 22 deletions Quicksilver/Code-QuickStepInterface/QSLargeTypeDisplay.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@

#define EDGEINSET 16

static NSMutableArray *_largeTypeWindows;

#pragma mark QSLargeTypeDisplay

void QSShowLargeType(NSString *aString) {
Expand Down Expand Up @@ -85,20 +83,13 @@ void QSShowLargeType(NSString *aString) {
windowRect = NSInsetRect(windowRect, -EDGEINSET, -EDGEINSET);
windowRect = NSIntegralRect(windowRect);

if (!_largeTypeWindows) {
_largeTypeWindows = [[NSMutableArray alloc] init];
}

QSVanishingWindow *largeTypeWindow = [[QSVanishingWindow alloc] initWithContentRect:windowRect styleMask:NSBorderlessWindowMask | NSNonactivatingPanelMask backing:NSBackingStoreBuffered defer:NO];
[_largeTypeWindows addObject:largeTypeWindow];
[largeTypeWindow setIgnoresMouseEvents:NO];
[largeTypeWindow setFrame:centerRectInRect(windowRect, screenRect) display:YES];
[largeTypeWindow setBackgroundColor: [NSColor clearColor]];
[largeTypeWindow setOpaque:NO];
[largeTypeWindow setLevel:NSFloatingWindowLevel];
[largeTypeWindow setHidesOnDeactivate:NO];
[largeTypeWindow setReleasedWhenClosed:YES];
// [largeTypeWindow setNextResponder:self];

QSBezelBackgroundView *content = [[NSClassFromString(@"QSBezelBackgroundView") alloc] initWithFrame:NSZeroRect];
[content setRadius:32];
Expand All @@ -121,12 +112,6 @@ void QSShowLargeType(NSString *aString) {
#pragma mark QSVainishingWindow

@implementation QSVanishingWindow
- (id)initWithContentRect:(NSRect)contentRect styleMask:(NSWindowStyleMask)aStyle backing:(NSBackingStoreType)bufferingType defer:(BOOL)flag {
if (self = [super initWithContentRect:contentRect styleMask:aStyle backing:bufferingType defer:flag]) {
[self setReleasedWhenClosed:YES];
}
return self;
}

- (IBAction)copy:(id)sender {
NSPasteboard *pb = [NSPasteboard generalPasteboard];
Expand All @@ -141,13 +126,6 @@ - (void)keyDown:(NSEvent *)theEvent {
[self close];
}

- (void)dealloc {
[_largeTypeWindows removeObject:self];
if ([_largeTypeWindows count] == 0) {
_largeTypeWindows = nil;
}
}

- (void)resignKeyWindow {
[super resignKeyWindow];
if ([self isVisible]) {
Expand Down
2 changes: 1 addition & 1 deletion Quicksilver/Code-QuickStepInterface/QSTextViewer.m
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ - (id)initWithWindow:(id)window {
[window setContentView:textview];
[textview release];*/
[window setReleasedWhenClosed:YES];
[window center];
[(QSWindow *)window center];

NSScrollView *scrollview = [[NSScrollView alloc] initWithFrame:[[window contentView] frame]];
[scrollview setBorderType:NSNoBorder];
Expand Down