[gnome-builder/global-search] workbench: track popover focus
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/global-search] workbench: track popover focus
- Date: Sat, 13 Dec 2014 22:59:29 +0000 (UTC)
commit 95c6166b06fa94f69ae6d71de08fddc40f7e5c38
Author: Christian Hergert <christian hergert me>
Date: Sat Dec 13 05:05:18 2014 -0800
workbench: track popover focus
src/resources/ui/gb-workbench.ui | 2 +-
src/search/gb-search-context.c | 2 --
src/workbench/gb-workbench.c | 24 ++++++++++++++++++++++++
3 files changed, 25 insertions(+), 3 deletions(-)
---
diff --git a/src/resources/ui/gb-workbench.ui b/src/resources/ui/gb-workbench.ui
index 343e3cc..1b6c021 100644
--- a/src/resources/ui/gb-workbench.ui
+++ b/src/resources/ui/gb-workbench.ui
@@ -249,7 +249,7 @@
</template>
<object class="GtkPopover" id="search_popover">
<property name="visible">True</property>
- <property name="modal">True</property>
+ <property name="modal">False</property>
<property name="relative-to">search_entry</property>
<child>
<object class="GbSearchDisplay" id="search_display">
diff --git a/src/search/gb-search-context.c b/src/search/gb-search-context.c
index ef6f704..ad3712f 100644
--- a/src/search/gb-search-context.c
+++ b/src/search/gb-search-context.c
@@ -308,8 +308,6 @@ static void
gb_search_context_init (GbSearchContext *self)
{
ENTRY;
-
self->priv = gb_search_context_get_instance_private (self);
-
EXIT;
}
diff --git a/src/workbench/gb-workbench.c b/src/workbench/gb-workbench.c
index 4d20e14..45b86ed 100644
--- a/src/workbench/gb-workbench.c
+++ b/src/workbench/gb-workbench.c
@@ -646,6 +646,27 @@ gb_workbench_popover_closed (GbWorkbench *workbench,
}
static void
+gb_workbench_set_focus (GtkWindow *window,
+ GtkWidget *widget)
+{
+ GbWorkbenchPrivate *priv = GB_WORKBENCH (window)->priv;
+
+ if (gtk_widget_get_visible (GTK_WIDGET (priv->search_popover)))
+ {
+ if (gtk_widget_is_ancestor (widget, GTK_WIDGET (priv->search_entry)) ||
+ gtk_widget_is_ancestor (widget, GTK_WIDGET (priv->search_popover)) ||
+ gtk_widget_is_ancestor (widget, GTK_WIDGET (priv->search_menu_button)))
+ {
+ }
+ else
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->search_menu_button),
+ FALSE);
+ }
+
+ GTK_WINDOW_CLASS (gb_workbench_parent_class)->set_focus (window, widget);
+}
+
+static void
gb_workbench_dispose (GObject *object)
{
GbWorkbenchPrivate *priv;
@@ -703,6 +724,7 @@ gb_workbench_class_init (GbWorkbenchClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+ GtkWindowClass *window_class = GTK_WINDOW_CLASS (klass);
object_class->constructed = gb_workbench_constructed;
object_class->dispose = gb_workbench_dispose;
@@ -712,6 +734,8 @@ gb_workbench_class_init (GbWorkbenchClass *klass)
widget_class->realize = gb_workbench_realize;
widget_class->delete_event = gb_workbench_delete_event;
+ window_class->set_focus = gb_workbench_set_focus;
+
klass->workspace_changed = gb_workbench_workspace_changed;
gParamSpecs [PROP_COMMAND_MANAGER] =
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]