summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2020-07-17 15:08:09 +0200
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2020-07-17 15:08:33 +0200
commit3bb3429670f29bbf82424ce234d914201eee2d3f (patch)
tree4ff9cc2117dc6fcc9ad0f7cb58d9f5115dc08fe5 /src
parenta0638273c8ce9cbdb8a85378ff7bf40fa2d1f8f3 (diff)
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.
Diffstat (limited to 'src')
-rw-r--r--src/Fl_cocoa.mm4
1 files changed, 1 insertions, 3 deletions
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.