From 8df4f8e398cffe69b2fa5fe2b608cfba72de9308 Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Tue, 3 Dec 2024 20:36:22 +0100 Subject: FLUID: avoid generating undo un spurious relayout events, #1152 --- fluid/Fl_Window_Type.cxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/fluid/Fl_Window_Type.cxx b/fluid/Fl_Window_Type.cxx index e539d671a..a911905b6 100644 --- a/fluid/Fl_Window_Type.cxx +++ b/fluid/Fl_Window_Type.cxx @@ -413,7 +413,13 @@ Fl_Window_Type Fl_Window_type; // Resize from window manager... void Overlay_Window::resize(int X,int Y,int W,int H) { - undo_checkpoint_once(kUndoWindowResize); + // Make sure we don't create undo checkpoints if the window does not actually change. + // Some WMs seem to send spurious resize events. + if (X!=x() || Y!=y() || W!=w() || H!=h()) { + // Set a checkpoint on the first resize event, ignore further resizes until + // a different type of checkpoint is triggered. + undo_checkpoint_once(kUndoWindowResize); + } Fl_Widget* t = resizable(); if (Fl_Type::allow_layout == 0) { -- cgit v1.2.3