Restore use of virtual Fl_Window::resize() to be notified when window moves.

A previous commit c66caf5dce
"Simpler implementation of Fl_Cocoa_Window_Driver::resize()"
made that Fl_Window::resize() was no longer called by FLTK when a
window is moved. This prevented the undocumented practice of
re-implementing the virtual function Fl_Window::resize() and use it
as a way to get a notification that a window was moved.
This commit is contained in:
ManoloFLTK 2020-07-17 15:08:09 +02:00
parent a0638273c8
commit 3bb3429670

View File

@ -1216,9 +1216,7 @@ static FLWindowDelegate *flwindowdelegate_instance = nil;
main_screen_height = CGDisplayBounds(CGMainDisplayID()).size.height;
int X, Y;
CocoatoFLTK(window, X, Y);
Fl_Cocoa_Window_Driver *d = Fl_Cocoa_Window_Driver::driver(window);
d->x(X);
d->y(Y);
if (window->x() != X || window->y() != Y) window->position(X, Y);
update_e_xy_and_e_xy_root(nsw);
// at least since MacOS 10.9: OS moves subwindows contained in a moved window
// setSubwindowFrame is no longer necessary.