Menu

#2434 [PATCH] Assume Cancel when user presses X in GTK WindowMessageBox

Bug
closed-fixed
nobody
5
2024-04-23
2024-03-25
No

When the user attempts to close a file with unsaved changes, a save confirmation dialog appears. Pressing X results in the file being closed and unsaved changes are discarded. This happens because it acts as if the user pressed "No".

When a button is pressed in the dialog, first the destroy callback is fired followed by the clicked callback which sets messageBoxResult depending on the button pressed. However when X is pressed nothing else is called after destroy, leaving messageBoxResult to its default value. This can be fixed by defaulting it to MessageBoxChoice::cancel(1).

Because the enum is not accessible from outside, the callbacks and messageBoxResult were moved inside the SciTEGTK class.

With this patch, clicking X acts like pressing "Cancel".

1 Attachments

Discussion

  • Neil Hodgson

    Neil Hodgson - 2024-03-26
    • labels: scite --> scite, gtk
    • status: open --> open-accepted
     
  • Neil Hodgson

    Neil Hodgson - 2024-04-04
    • status: open-accepted --> open-fixed
     
  • Neil Hodgson

    Neil Hodgson - 2024-04-04

    Thanks, committed as [2f7752].

     

    Related

    Commit: [2f7752]

  • Neil Hodgson

    Neil Hodgson - 2024-04-23
    • status: open-fixed --> closed-fixed
     

Log in to post a comment.

MongoDB Logo MongoDB