[gnome-builder] Fix for bug 758756.
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] Fix for bug 758756.
- Date: Thu, 3 Mar 2016 22:17:42 +0000 (UTC)
commit 1cf3e39a206ff520ff5fc23831382c75325ad249
Author: Debarshi <debarshi dutta research iiit ac in>
Date: Wed Mar 2 09:51:30 2016 +0530
Fix for bug 758756.
libide/ide-layout-pane.c | 26 ++++++++++++++++++++++++++
plugins/terminal/gb-terminal-view.c | 2 ++
2 files changed, 28 insertions(+), 0 deletions(-)
---
diff --git a/libide/ide-layout-pane.c b/libide/ide-layout-pane.c
index cd03b9d..bae2acc 100644
--- a/libide/ide-layout-pane.c
+++ b/libide/ide-layout-pane.c
@@ -23,6 +23,7 @@
#include "ide-layout-pane.h"
#include "ide-workbench.h"
#include "ide-workbench-private.h"
+#include "ide-macros.h"
struct _IdeLayoutPane
{
@@ -35,6 +36,8 @@ struct _IdeLayoutPane
EggSignalGroup *toplevel_signals;
+ gulong notify_stack_signal_handler;
+
GdkRectangle handle_pos;
GtkPositionType position;
@@ -159,6 +162,20 @@ ide_layout_pane_grab_focus (GtkWidget *widget)
}
static void
+on_stack_changed (GtkWidget *widget)
+{
+ GtkWidget *child;
+
+ g_assert (GTK_IS_WIDGET (widget));
+
+ child = gtk_stack_get_visible_child (GTK_STACK (widget));
+
+ if (child != NULL)
+ gtk_widget_grab_focus (child);
+}
+
+
+static void
workbench_focus_changed (GtkWidget *toplevel,
GtkWidget *focus,
IdeLayoutPane *self)
@@ -213,6 +230,9 @@ ide_layout_pane_dispose (GObject *object)
{
IdeLayoutPane *self = (IdeLayoutPane *)object;
+ if (self->notify_stack_signal_handler > 0 && GTK_IS_STACK (self->stack))
+ ide_clear_signal_handler (self->stack, &self->notify_stack_signal_handler);
+
g_clear_object (&self->toplevel_signals);
G_OBJECT_CLASS (ide_layout_pane_parent_class)->dispose (object);
@@ -333,6 +353,12 @@ ide_layout_pane_init (IdeLayoutPane *self)
G_CONNECT_AFTER);
gtk_widget_init_template (GTK_WIDGET (self));
+
+ self->notify_stack_signal_handler = 0;
+ self->notify_stack_signal_handler = g_signal_connect (self->stack,
+ "notify::visible-child",
+ G_CALLBACK (on_stack_changed),
+ NULL);
}
GtkWidget *
diff --git a/plugins/terminal/gb-terminal-view.c b/plugins/terminal/gb-terminal-view.c
index 103520f..7e54009 100644
--- a/plugins/terminal/gb-terminal-view.c
+++ b/plugins/terminal/gb-terminal-view.c
@@ -590,4 +590,6 @@ gb_terminal_view_init (GbTerminalView *self)
self,
0);
style_context_changed (style_context, self);
+
+ gtk_widget_set_can_focus (GTK_WIDGET (self->terminal_top), TRUE);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]