From d1144a598c0bcba30722aa57d07e9c323cfae4bb Mon Sep 17 00:00:00 2001 From: "smfr%smfr.org" Date: Mon, 30 Jan 2006 04:48:52 +0000 Subject: [PATCH] Fix bug 296228: focus apparently lost when hiding and then showing Camino. Cocoa on 10.4 seems to have a bug where mouse moves don't get reactivated when re-showing an application, so we do it manually when a browser window becomes the main window. git-svn-id: svn://10.0.0.236/trunk@188448 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/camino/src/browser/BrowserWindow.mm | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/mozilla/camino/src/browser/BrowserWindow.mm b/mozilla/camino/src/browser/BrowserWindow.mm index 7b8bc77a301..33927434e56 100644 --- a/mozilla/camino/src/browser/BrowserWindow.mm +++ b/mozilla/camino/src/browser/BrowserWindow.mm @@ -100,6 +100,21 @@ static const int kEscapeKeyCode = 53; mSuppressMakeKeyFront = inSuppress; } +- (void)becomeMainWindow +{ + [super becomeMainWindow]; + // There appears to be a bug on 10.4 where mouse moves don't get reactivated + // when showing the application after it has been hidden. Furthermore, + // we seem to have to do this after a delay (perhaps because we're not + // actually the main window yet). + [self performSelector:@selector(delayedTurnOnMouseMoves) withObject:nil afterDelay:0]; +} + +- (void)delayedTurnOnMouseMoves +{ + [self setAcceptsMouseMovedEvents:YES]; +} + // Pass command-return off to the controller so that locations/searches may be opened in a new tab. // Pass command-plus off to the controller to enlarge the text size. // Pass command-shift-r off to the controller for force-reload.