summaryrefslogtreecommitdiff
path: root/fluid
diff options
context:
space:
mode:
authorMatthias Melcher <github@matthiasm.com>2023-08-29 22:50:07 +0200
committerMatthias Melcher <github@matthiasm.com>2023-08-29 22:50:12 +0200
commitb5a1da961200e870a28f09b2fba4197e73c9935d (patch)
treec18917f0dea7f8203d020d60a2ff1d6c2cd12ff6 /fluid
parentbe657471e761462d91c62e8cd00519e5dbda82a0 (diff)
FLUID: minor fixes
Diffstat (limited to 'fluid')
-rw-r--r--fluid/Fl_Widget_Type.cxx5
-rw-r--r--fluid/undo.cxx5
2 files changed, 6 insertions, 4 deletions
diff --git a/fluid/Fl_Widget_Type.cxx b/fluid/Fl_Widget_Type.cxx
index 28c24939d..7418e65e1 100644
--- a/fluid/Fl_Widget_Type.cxx
+++ b/fluid/Fl_Widget_Type.cxx
@@ -405,7 +405,8 @@ void label_cb(Fl_Input* i, void *v) {
undo_resume();
if (mod) set_modflag(1);
}
- if ( (Fl::event() == FL_HIDE) || (Fl::event() == FL_UNFOCUS) )
+ int r = (int)Fl::callback_reason();
+ if ( (r == FL_REASON_LOST_FOCUS) || (r == FL_REASON_ENTER_KEY) )
first_change = 1;
}
}
@@ -2502,7 +2503,7 @@ void propagate_load(Fl_Group* g, void* v) {
Fl_Widget*const* a = g->array();
for (int i=g->children(); i--;) {
Fl_Widget* o = *a++;
- o->do_callback(o,LOAD);
+ o->do_callback(o, LOAD, FL_REASON_USER);
}
}
}
diff --git a/fluid/undo.cxx b/fluid/undo.cxx
index 21503b122..92f84a666 100644
--- a/fluid/undo.cxx
+++ b/fluid/undo.cxx
@@ -160,14 +160,15 @@ void undo_cb(Fl_Widget *, void *) {
// Save current file to undo buffer
void undo_checkpoint() {
- int undo_item = main_menubar->find_index(undo_cb);
- int redo_item = main_menubar->find_index(redo_cb);
// printf("undo_checkpoint(): undo_current=%d, undo_paused=%d, modflag=%d\n",
// undo_current, undo_paused, modflag);
// Don't checkpoint if undo_suspend() has been called...
if (undo_paused) return;
+ int undo_item = main_menubar->find_index(undo_cb);
+ int redo_item = main_menubar->find_index(redo_cb);
+
// Save the current UI to a checkpoint file...
const char *filename = undo_filename(undo_current);
if (!write_file(filename)) {