[gnome-builder] grid: focus neighboring stack before removing.
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] grid: focus neighboring stack before removing.
- Date: Tue, 13 Jan 2015 02:21:07 +0000 (UTC)
commit 8ba9a0195010c35cb19026524499d8e9d6f5ba87
Author: Christian Hergert <christian hergert me>
Date: Mon Jan 12 18:13:43 2015 -0800
grid: focus neighboring stack before removing.
This helps prevent an infinite loop in Gtk.
src/documents/gb-document-grid.c | 45 +++++++++++++++++++------------------
1 files changed, 23 insertions(+), 22 deletions(-)
---
diff --git a/src/documents/gb-document-grid.c b/src/documents/gb-document-grid.c
index 8211a7a..feb93f2 100644
--- a/src/documents/gb-document-grid.c
+++ b/src/documents/gb-document-grid.c
@@ -178,28 +178,6 @@ gb_document_grid_remove_stack (GbDocumentGrid *grid,
}
static void
-gb_document_grid_stack_empty (GbDocumentGrid *grid,
- GbDocumentStack *stack)
-{
- GList *stacks;
-
- g_return_if_fail (GB_IS_DOCUMENT_GRID (grid));
- g_return_if_fail (GB_IS_DOCUMENT_STACK (stack));
-
- stacks = gb_document_grid_get_stacks (grid);
-
- g_assert (stacks != NULL);
-
- if (g_list_length (stacks) == 1)
- goto cleanup;
-
- gb_document_grid_remove_stack (grid, stack);
-
-cleanup:
- g_list_free (stacks);
-}
-
-static void
gb_document_grid_focus_neighbor (GbDocumentGrid *grid,
GtkDirectionType dir,
GbDocumentStack *stack)
@@ -228,6 +206,29 @@ gb_document_grid_focus_neighbor (GbDocumentGrid *grid,
gtk_widget_grab_focus (neighbor);
}
+static void
+gb_document_grid_stack_empty (GbDocumentGrid *grid,
+ GbDocumentStack *stack)
+{
+ GList *stacks;
+
+ g_return_if_fail (GB_IS_DOCUMENT_GRID (grid));
+ g_return_if_fail (GB_IS_DOCUMENT_STACK (stack));
+
+ stacks = gb_document_grid_get_stacks (grid);
+
+ g_assert (stacks != NULL);
+
+ if (g_list_length (stacks) == 1)
+ goto cleanup;
+
+ gb_document_grid_focus_neighbor (grid, GTK_DIR_LEFT, stack);
+ gb_document_grid_remove_stack (grid, stack);
+
+cleanup:
+ g_list_free (stacks);
+}
+
static gboolean
gb_document_grid_request_close (GbDocumentGrid *grid,
GbDocumentView *view)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]