зеркало из https://github.com/mozilla/gecko-dev.git
removing timer, it's now in toolkit
This commit is contained in:
Родитель
1d522d115b
Коммит
92741ef574
|
@ -60,7 +60,6 @@ class nsCocoaWindow;
|
|||
}
|
||||
- (id)initWithGeckoWindow:(nsCocoaWindow*)geckoWind;
|
||||
- (void)windowDidResize:(NSNotification *)aNotification;
|
||||
- (void)eventTimer:(NSTimer *)theTimer;
|
||||
@end
|
||||
|
||||
|
||||
|
@ -200,7 +199,6 @@ protected:
|
|||
PRBool mIsResizing; // we originated the resize, prevent infinite recursion
|
||||
PRBool mWindowMadeHere; // true if we created the window, false for embedding
|
||||
NSWindow* mWindow; // our cocoa window [STRONG]
|
||||
NSTimer* mEventTimer; // event timer [STRONG]
|
||||
WindowDelegate* mDelegate; // our delegate for processing window msgs [STRONG]
|
||||
|
||||
};
|
||||
|
|
|
@ -301,7 +301,6 @@ nsCocoaWindow::nsCocoaWindow()
|
|||
: mIsResizing(PR_FALSE)
|
||||
, mWindowMadeHere(PR_FALSE)
|
||||
, mWindow(nil)
|
||||
, mEventTimer(nil)
|
||||
{
|
||||
#if 0
|
||||
mMacEventHandler.reset(new nsMacEventHandler(this));
|
||||
|
@ -323,8 +322,6 @@ nsCocoaWindow::~nsCocoaWindow()
|
|||
{
|
||||
if ( mWindow && mWindowMadeHere ) {
|
||||
[mWindow release];
|
||||
[mEventTimer invalidate];
|
||||
[mEventTimer release];
|
||||
[mDelegate release];
|
||||
}
|
||||
|
||||
|
@ -392,21 +389,9 @@ nsresult nsCocoaWindow::StandardCreate(nsIWidget *aParent,
|
|||
mDelegate = [[WindowDelegate alloc] initWithGeckoWindow:this];
|
||||
[mWindow setDelegate:mDelegate];
|
||||
|
||||
//FIXME setup a timer to process PLEvents. This isn't where this should live, but
|
||||
// it's a good temporary place. There should only be one, and for embedding
|
||||
// purposes, it should live within the toolkit probably.
|
||||
mEventTimer = [NSTimer scheduledTimerWithTimeInterval:0.1 target:mDelegate selector:@selector(eventTimer:) userInfo:nil
|
||||
repeats:YES];
|
||||
|
||||
mWindowMadeHere = PR_TRUE;
|
||||
}
|
||||
|
||||
//FIXME setup a timer to process PLEvents. This isn't where this should live, but
|
||||
// it's a good temporary place. There should only be one, and for embedding
|
||||
// purposes, it should live within the toolkit probably.
|
||||
mEventTimer = [NSTimer scheduledTimerWithTimeInterval:0.1 target:mDelegate selector:@selector(eventTimer:) userInfo:nil
|
||||
repeats:YES];
|
||||
|
||||
#if 0
|
||||
short bottomPinDelta = 0; // # of pixels to subtract to pin window bottom
|
||||
nsCOMPtr<nsIToolkit> theToolkit = aToolkit;
|
||||
|
@ -1665,24 +1650,6 @@ void StopResizing ( )
|
|||
}
|
||||
|
||||
|
||||
- (void)eventTimer:(NSTimer *)theTimer
|
||||
{
|
||||
//FIXME not the most efficient way to do this, but it gets us to process PLEvents on
|
||||
// a regular basis. Each window shouldn't need one of these. Perhaps I'll add it on
|
||||
// the toolkit.
|
||||
nsCOMPtr<nsIEventQueueService> service = do_GetService(NS_EVENTQUEUESERVICE_CONTRACTID);
|
||||
if ( service ) {
|
||||
nsCOMPtr<nsIEventQueue> queue;
|
||||
service->GetThreadEventQueue(NS_CURRENT_THREAD, getter_AddRefs(queue));
|
||||
if (queue)
|
||||
{
|
||||
nsresult rv = queue->ProcessPendingEvents();
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv), "Error processing PLEvents");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
- (void)windowDidResize:(NSNotification *)aNotification
|
||||
{
|
||||
if ( !mGeckoWindow->IsResizing() ) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче