diff options
author | Apoorv Sachan <apoorv.99.sachan@gmail.com> | 2020-08-01 17:51:33 +0530 |
---|---|---|
committer | António Fernandes <antoniojpfernandes@gmail.com> | 2020-08-05 13:48:10 +0000 |
commit | 374bb9cd697bfd82162e9d5c7c8a5064d1a242ee (patch) | |
tree | 9fd21c725f75c7efb792c877a22486435a11f6a7 /src/nautilus-properties-window.c | |
parent | c4e9dcd466b0ae7abd3d2536dd5903881aea8c56 (diff) | |
download | nautilus-374bb9cd697bfd82162e9d5c7c8a5064d1a242ee.tar.gz |
properties-window: Restore close on press 'Esc' functionality
NautilusPropertiesWindow usec to be a GtkDialog subclass, inheriting
the "close" signal, which was leveraged to implement close on Esc.
However as GtkWindow doesn't feature a "close" signal natively, and
NautilusPropertiesWindow now subclasses GtkWindow, it needs to be
seperately defined and attached to a signal handler to restore the
functionality.
Diffstat (limited to 'src/nautilus-properties-window.c')
-rw-r--r-- | src/nautilus-properties-window.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/nautilus-properties-window.c b/src/nautilus-properties-window.c index 4a4b0f435..8e3b23d03 100644 --- a/src/nautilus-properties-window.c +++ b/src/nautilus-properties-window.c @@ -5786,6 +5786,12 @@ nautilus_properties_window_class_init (NautilusPropertiesWindowClass *class) GTK_WIDGET_CLASS (class)->destroy = real_destroy; binding_set = gtk_binding_set_by_class (class); + g_signal_new ("close", + G_OBJECT_CLASS_TYPE (class), + G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, + 0, NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); gtk_binding_entry_add_signal (binding_set, GDK_KEY_Escape, 0, "close", 0); } @@ -5793,4 +5799,5 @@ nautilus_properties_window_class_init (NautilusPropertiesWindowClass *class) static void nautilus_properties_window_init (NautilusPropertiesWindow *window) { + g_signal_connect (window, "close", G_CALLBACK (gtk_window_close), NULL); } |