Skip to content

Commit

Permalink
FLUID: avoid generating undo un spurious relayout events, fltk#1152
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthiasWM committed Dec 3, 2024
1 parent 167dba8 commit 8df4f8e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion fluid/Fl_Window_Type.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 8df4f8e

Please sign in to comment.