From 3bb3429670f29bbf82424ce234d914201eee2d3f Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Fri, 17 Jul 2020 15:08:09 +0200 Subject: Restore use of virtual Fl_Window::resize() to be notified when window moves. A previous commit c66caf5dce9331fd3e011873711a768adb28cf9d "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. --- src/Fl_cocoa.mm | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src') diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index 039fd7224..efbccc820 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -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. -- cgit v1.2.3