GNOME Bugzilla – Bug 488269
properties dialog creates empty undo actions when no properties are changed
Last modified: 2019-03-20 11:35:44 UTC
Please describe the problem: The properties dialog has three buttons: Close, Apply and OK. Their behaviour can cause empty Change objects in the Undo stack, when no properties are changed between subsequent button-presses. This is because the function that handles the response to this dialog does not check whether any properties have actually been changed. 1) If you don't change any property and press "Apply" or "OK", the dialog still creates an empty action on the undo stack. 2) If you change some properties and press "Apply" followed by "OK", the undo stack is updated twice, where the effect of the "OK" button-press is empty. 3) If you press "Apply" multiple times, it updates the undo stack every time, although only the first attempt is the only one that could have caused any change in properties. Steps to reproduce: Actual results: Expected results: Does this happen every time? Other information:
Created attachment 123155 [details] [review] introduced a boolean that remembers when changes have been applied
patch does not apply cleanly (it predates the flerenaming to app/properties-dialog.c and even the multiple selected objects handling). Also I don't like to mess with propinternals.h here. Finally I'm assuming it crashes when given e.g. the UML Dialog, or wouldn't that happen?
I've experimented a bit with this (and even fixed a related bug). See: http://git.gnome.org/browse/dia/commit/?id=081fa89e1aa7080ffbe11ba000a83bdf1a6aa452 But came to the conclusion that optimizing away the change is not the right thing. IMO a better way to reflect "no change" would be to disable Apply/Ok for the case of no effective change. That would need some restructuring with the signal handling of properties and probably an own implementation of the peroperty dialog. At least I could not find a way to get on the buttons of a GtkDialog. Anyway the current behaviour looks conssitent: the user does something and that has an effect. Enahncement as outlined above accepted.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/dia/issues/220.