Lines 652-660
static HWND clipboard_wnd = 0;
Link Here
|
652 |
static HWND next_clipboard_wnd = 0; |
652 |
static HWND next_clipboard_wnd = 0; |
653 |
|
653 |
|
654 |
static bool initial_clipboard = true; |
654 |
static bool initial_clipboard = true; |
|
|
655 |
void fl_clipboard_notify_target(HWND wnd); |
655 |
|
656 |
|
656 |
void fl_clipboard_notify_change() { |
657 |
void fl_clipboard_notify_change() { |
657 |
// No need to do anything here... |
658 |
// untarget clipboard monitor if no handlers are registered |
|
|
659 |
if (clipboard_wnd != NULL && fl_clipboard_notify_empty()) |
660 |
{ |
661 |
fl_clipboard_notify_untarget(clipboard_wnd); |
662 |
return; |
663 |
} |
664 |
|
665 |
// if there are clipboard notify handlers but no window targeted |
666 |
// target first window if available |
667 |
if (clipboard_wnd == NULL && Fl::first_window()) |
668 |
fl_clipboard_notify_target(fl_xid(Fl::first_window())); |
658 |
} |
669 |
} |
659 |
|
670 |
|
660 |
void fl_clipboard_notify_target(HWND wnd) { |
671 |
void fl_clipboard_notify_target(HWND wnd) { |
Lines 983-990
static LRESULT CALLBACK WndProc(HWND hWn
Link Here
|
983 |
|
994 |
|
984 |
case WM_CLOSE: // user clicked close box |
995 |
case WM_CLOSE: // user clicked close box |
985 |
Fl::handle(FL_CLOSE, window); |
996 |
Fl::handle(FL_CLOSE, window); |
986 |
PostQuitMessage(0); |
997 |
break; |
987 |
return 0; |
|
|
988 |
|
998 |
|
989 |
case WM_SYNCPAINT : |
999 |
case WM_SYNCPAINT : |
990 |
case WM_NCPAINT : |
1000 |
case WM_NCPAINT : |
Lines 1367-1378
static LRESULT CALLBACK WndProc(HWND hWn
Link Here
|
1367 |
return 0; |
1377 |
return 0; |
1368 |
|
1378 |
|
1369 |
case WM_CHANGECBCHAIN: |
1379 |
case WM_CHANGECBCHAIN: |
1370 |
if ((hWnd == clipboard_wnd) && |
1380 |
if ((hWnd == clipboard_wnd) && (next_clipboard_wnd == (HWND)wParam)) |
1371 |
(next_clipboard_wnd == (HWND)wParam)) { |
|
|
1372 |
next_clipboard_wnd = (HWND)lParam; |
1381 |
next_clipboard_wnd = (HWND)lParam; |
1373 |
return 0; |
1382 |
else |
1374 |
} |
1383 |
SendMessage(next_clipboard_wnd, WM_CHANGECBCHAIN, wParam, lParam); |
1375 |
break; |
1384 |
return 0; |
1376 |
|
1385 |
|
1377 |
case WM_DRAWCLIPBOARD: |
1386 |
case WM_DRAWCLIPBOARD: |
1378 |
// When the clipboard moves between two FLTK windows, |
1387 |
// When the clipboard moves between two FLTK windows, |
Lines 1847-1853
Fl_X* Fl_X::make(Fl_Window* w) {
Link Here
|
1847 |
x->next = Fl_X::first; |
1856 |
x->next = Fl_X::first; |
1848 |
Fl_X::first = x; |
1857 |
Fl_X::first = x; |
1849 |
|
1858 |
|
1850 |
fl_clipboard_notify_target(x->xid); |
1859 |
// Setup clipboard monitor target if there are registered handlers and |
|
|
1860 |
// no window is targeted. |
1861 |
if (!fl_clipboard_notify_empty() && clipboard_wnd == NULL) |
1862 |
fl_clipboard_notify_target(x->xid); |
1851 |
|
1863 |
|
1852 |
x->wait_for_expose = 1; |
1864 |
x->wait_for_expose = 1; |
1853 |
if (fl_show_iconic) {showit = 0; fl_show_iconic = 0;} |
1865 |
if (fl_show_iconic) {showit = 0; fl_show_iconic = 0;} |