From 7bf4ed5c388aff17ba4f7d49d8675d4cdc9ad846 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Berg?= Date: Sat, 24 Oct 2009 20:30:19 +0200 Subject: [PATCH] Bug fix: Change notification to avoid display freezes when the QuickLook panel hides during the repository window's auto refresh. --- GitX.xcodeproj/project.pbxproj | 2 +- PBGitWindowController.m | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/GitX.xcodeproj/project.pbxproj b/GitX.xcodeproj/project.pbxproj index 45591e4..2bee4af 100644 --- a/GitX.xcodeproj/project.pbxproj +++ b/GitX.xcodeproj/project.pbxproj @@ -261,7 +261,7 @@ F57CC38F0E05DDF2000472E2 /* PBEasyPipe.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBEasyPipe.h; sourceTree = ""; }; F57CC3900E05DDF2000472E2 /* PBEasyPipe.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBEasyPipe.m; sourceTree = ""; }; F57CC43F0E05E496000472E2 /* PBGitWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitWindowController.h; sourceTree = ""; }; - F57CC4400E05E496000472E2 /* PBGitWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitWindowController.m; sourceTree = ""; }; + F57CC4400E05E496000472E2 /* PBGitWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitWindowController.m; sourceTree = ""; wrapsLines = 1; }; F580E6AD0E733276009E2D3F /* Sparkle.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Sparkle.framework; sourceTree = ""; }; F5886A0A0ED5D27A0066E74C /* speedtest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = speedtest.m; sourceTree = ""; }; F5886A100ED5D33D0066E74C /* SpeedTest.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SpeedTest.app; sourceTree = BUILT_PRODUCTS_DIR; }; diff --git a/PBGitWindowController.m b/PBGitWindowController.m index ae2f361..1785424 100644 --- a/PBGitWindowController.m +++ b/PBGitWindowController.m @@ -138,9 +138,11 @@ [[NSAlert alertWithError:error] beginSheetModalForWindow: [self window] modalDelegate:self didEndSelector:nil contextInfo:nil]; } -- (void)windowDidBecomeKey:(NSNotification *)notification -{ - if (self.viewController && [PBGitDefaults refreshAutomatically]) { +- (void)windowDidBecomeMain:(NSNotification *)notification { + /* Using ...didBecomeMain is better than ...didBecomeKey here because the QuickLook panel will count as key state change + and the outline view window will trigger a refresh in the middle of the QuickLook panel's closing animation which + causes a half second freeze with left over artifacts. */ + if (self.viewController && [PBGitDefaults refreshAutomatically]) { [(PBViewController *)self.viewController refresh:nil]; } }