summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2014-02-05 09:38:22 +0000
committerPierre Ossman <ossman@cendio.se>2014-02-05 09:38:22 +0000
commit74aeae38cb3a4695542ec39f2432841a2567a007 (patch)
treeee990d546105a02e35b1194e613307f6e85edeb7
parentc954d5212f795f1b3122c1efd03f2880062488fe (diff)
Revert the revert in r10060, reinstating commit r10030.
The reason the code was problematic was because of r4589, where a call to PostQuitMessage() snuck in. As we could not find a valid reason for that PostQuitMessage(), it has been removed and FLTK is now again properly responsive to WM_QUIT messages. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10094 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--src/Fl_win32.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx
index ce480b5d7..092f194a0 100644
--- a/src/Fl_win32.cxx
+++ b/src/Fl_win32.cxx
@@ -36,6 +36,7 @@
#include <stdlib.h>
#include <sys/types.h>
#include <time.h>
+#include <signal.h>
#ifdef __CYGWIN__
# include <sys/time.h>
# include <unistd.h>
@@ -403,6 +404,9 @@ int fl_wait(double time_to_wait) {
have_message = PeekMessageW(&fl_msg, NULL, 0, 0, PM_REMOVE);
if (have_message > 0) {
while (have_message != 0 && have_message != -1) {
+ // Let applications treat WM_QUIT identical to SIGTERM on *nix
+ if (fl_msg.message == WM_QUIT)
+ raise(SIGTERM);
if (fl_msg.message == fl_wake_msg) {
// Used for awaking wait() from another thread
thread_message_ = (void*)fl_msg.wParam;
@@ -903,7 +907,6 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar
case WM_CLOSE: // user clicked close box
Fl::handle(FL_CLOSE, window);
- PostQuitMessage(0);
return 0;
case WM_SYNCPAINT :