mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 18:31:55 -04:00
close-request-event
This commit is contained in:
parent
d8330fc4f1
commit
de052535d4
@ -25,6 +25,7 @@
|
|||||||
#include "mouseButton.h"
|
#include "mouseButton.h"
|
||||||
#include "clockObject.h"
|
#include "clockObject.h"
|
||||||
#include "config_util.h"
|
#include "config_util.h"
|
||||||
|
#include "throw_event.h"
|
||||||
|
|
||||||
#include <tchar.h>
|
#include <tchar.h>
|
||||||
|
|
||||||
@ -998,13 +999,26 @@ window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
case WM_CLOSE:
|
case WM_CLOSE:
|
||||||
//GraphicsWindow::close_window(); //M.A. changed to the following line
|
// This is a message from the system indicating that the user
|
||||||
close_window();
|
// has requested to close the window (e.g. alt-f4).
|
||||||
properties.set_open(false);
|
{
|
||||||
system_changed_properties(properties);
|
string close_request_event = get_close_request_event();
|
||||||
|
if (!close_request_event.empty()) {
|
||||||
// TODO: make sure we release the GSG properly.
|
// In this case, the app has indicated a desire to intercept
|
||||||
windisplay_cat.debug() << "ta ta" << endl;
|
// the request and process it directly.
|
||||||
|
throw_event(close_request_event);
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
// In this case, the default case, the app does not intend
|
||||||
|
// to service the request, so we do by closing the window.
|
||||||
|
close_window();
|
||||||
|
properties.set_open(false);
|
||||||
|
system_changed_properties(properties);
|
||||||
|
|
||||||
|
// TODO: make sure we release the GSG properly.
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_ACTIVATE:
|
case WM_ACTIVATE:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user