Setup the quit handler for when the user attempts to close the window. This restores the previous functionality of asking the user if they want to quit.

master
Geenz 2013-02-26 16:18:42 -05:00
parent 9a85a9d6bf
commit 21aa4b9c24
3 changed files with 14 additions and 2 deletions

View File

@ -466,16 +466,19 @@
- (BOOL) becomeFirstResponder
{
NSLog(@"Window gained focus!");
callFocus();
return true;
}
- (BOOL) resignFirstResponder
{
NSLog(@"Window lost focus!");
callFocus();
return true;
}
- (void) close
{
callQuitHandler();
}
@end

View File

@ -96,6 +96,7 @@ void callMiddleMouseUp(float *pos, unsigned int mask);
void callFocus();
void callFocusLost();
void callModifier(unsigned int mask);
void callQuitHandler();
#include <string>
void callHandleDragEntered(std::string url);

View File

@ -362,6 +362,14 @@ void callHandleDragDropped(std::string url)
gWindowImplementation->handleDragNDrop(url, LLWindowCallbacks::DNDA_DROPPED);
}
void callQuitHandler()
{
if(gWindowImplementation->getCallbacks()->handleCloseRequest(gWindowImplementation))
{
gWindowImplementation->getCallbacks()->handleQuit(gWindowImplementation);
}
}
void LLWindowMacOSX::updateMouseDeltas(float* deltas)
{
if (mCursorDecoupled)