Fix: Window can be moved while menu is open (#1166)

This commit is contained in:
ManoloFLTK 2024-12-12 12:09:53 +01:00
parent 34b5fe9e92
commit 4571af24ab

View File

@ -1398,6 +1398,11 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar
break;
case WM_SETFOCUS:
if (Fl::grab() && (Fl::grab() != window) && Fl::grab()->menu_window()) {
// simulate click at remote location (see issue #1166)
mouse_event(Fl::grab(), 0, 1, MK_LBUTTON, MAKELPARAM(100000, 0));
return 0;
}
if ((Fl::modal_) && (Fl::modal_ != window)) {
SetFocus(fl_xid(Fl::modal_));
return 0;