-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathfltk.patch
63 lines (60 loc) · 2.33 KB
/
fltk.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx
index 6e9e8933f..9de5ca5bf 100644
--- a/src/Fl_win32.cxx
+++ b/src/Fl_win32.cxx
@@ -610,16 +610,16 @@ class Fl_Win32_At_Exit {
public:
Fl_Win32_At_Exit() {}
~Fl_Win32_At_Exit() {
- fl_free_fonts(); // do some Windows cleanup
- fl_cleanup_pens();
- OleUninitialize();
- if (fl_graphics_driver) fl_brush_action(1);
- fl_cleanup_dc_list();
- // This is actually too late in the cleanup process to remove the
- // clipboard notifications, but we have no earlier hook so we try
- // to work around it anyway.
- if (clipboard_wnd != NULL)
- fl_clipboard_notify_untarget(clipboard_wnd);
+// fl_free_fonts(); // do some Windows cleanup
+// fl_cleanup_pens();
+// OleUninitialize();
+// if (fl_graphics_driver) fl_brush_action(1);
+// fl_cleanup_dc_list();
+// // This is actually too late in the cleanup process to remove the
+// // clipboard notifications, but we have no earlier hook so we try
+// // to work around it anyway.
+// if (clipboard_wnd != NULL)
+// fl_clipboard_notify_untarget(clipboard_wnd);
#if USE_GDIPLUS
Fl_GDIplus_Graphics_Driver::shutdown();
#endif
@@ -1208,6 +1208,8 @@ static Fl_Window *resize_bug_fix;
extern void fl_save_pen(void);
extern void fl_restore_pen(void);
+static bool left_window = true;
+
static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
// Copy the message to fl_msg so add_handler code can see it.
@@ -1351,6 +1353,14 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar
return 0;
case WM_MOUSEMOVE:
+ if (left_window) {
+ Fl_Window *tw = window;
+ while (tw->parent()) // find top level window
+ tw = tw->window();
+ Fl::handle(FL_ENTER, tw);
+ left_window = false;
+ return 0;
+ }
#ifdef USE_TRACK_MOUSE
if (track_mouse_win != window) {
TRACKMOUSEEVENT tme;
@@ -1370,6 +1380,7 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar
while (tw->parent()) // find top level window
tw = tw->window();
Fl::belowmouse(0);
+ left_window = true;
Fl::handle(FL_LEAVE, tw);
}
track_mouse_win = 0; // force TrackMouseEvent() restart