[gnome-text-editor] window: fix ctrl+w after last page is closed
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-text-editor] window: fix ctrl+w after last page is closed
- Date: Wed, 6 Oct 2021 17:13:35 +0000 (UTC)
commit 7d4231d3c6018a74fb21d19d3208f3b1b064c2bf
Author: Christian Hergert <chergert redhat com>
Date: Wed Oct 6 10:12:39 2021 -0700
window: fix ctrl+w after last page is closed
Fixes #173
src/editor-window-actions.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/src/editor-window-actions.c b/src/editor-window-actions.c
index c38ad6c..adf33d1 100644
--- a/src/editor-window-actions.c
+++ b/src/editor-window-actions.c
@@ -56,15 +56,18 @@ editor_window_actions_close_page_cb (GtkWidget *widget,
g_assert (EDITOR_IS_WINDOW (self));
+ if (editor_window_get_visible_page (self) == NULL)
+ {
+ gtk_window_close (GTK_WINDOW (self));
+ return;
+ }
+
if ((page = editor_window_get_visible_page (self)) &&
_editor_window_request_close_page (self, page))
{
EditorSession *session = editor_application_get_session (EDITOR_APPLICATION_DEFAULT);
editor_session_remove_page (session, page);
-
- if (editor_window_get_visible_page (self) == NULL)
- gtk_window_close (GTK_WINDOW (self));
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]