[evolution/gnome-3-22] Bug 775656 - Delete key mapping stops working ][
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution/gnome-3-22] Bug 775656 - Delete key mapping stops working ][
- Date: Wed, 18 Jan 2017 15:03:14 +0000 (UTC)
commit f44e1f8933fa5527375cab8db375892ae091dbdf
Author: Milan Crha <mcrha redhat com>
Date: Wed Jan 18 16:01:33 2017 +0100
Bug 775656 - Delete key mapping stops working ][
e-util/e-preview-pane.c | 26 ++++++++++++++++++++++++++
1 files changed, 26 insertions(+), 0 deletions(-)
---
diff --git a/e-util/e-preview-pane.c b/e-util/e-preview-pane.c
index eeb84bf..d0d9245 100644
--- a/e-util/e-preview-pane.c
+++ b/e-util/e-preview-pane.c
@@ -22,6 +22,7 @@
#include "e-alert-bar.h"
#include "e-alert-dialog.h"
#include "e-alert-sink.h"
+#include "e-misc-utils.h"
#define E_PREVIEW_PANE_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE \
@@ -69,6 +70,28 @@ preview_pane_web_view_new_activity_cb (EWebView *web_view,
}
static void
+preview_pane_alert_bar_visible_notify_cb (GtkWidget *alert_bar,
+ GParamSpec *param,
+ EPreviewPane *preview_pane)
+{
+ GtkWidget *toplevel, *focused;
+
+ g_return_if_fail (E_IS_ALERT_BAR (alert_bar));
+ g_return_if_fail (E_IS_PREVIEW_PANE (preview_pane));
+
+ if (gtk_widget_get_visible (alert_bar))
+ return;
+
+ toplevel = gtk_widget_get_toplevel (GTK_WIDGET (preview_pane));
+ focused = GTK_IS_WINDOW (toplevel) ? gtk_window_get_focus (GTK_WINDOW (toplevel)) : NULL;
+
+ if (!focused && preview_pane->priv->web_view &&
+ gtk_widget_get_visible (preview_pane->priv->web_view)) {
+ gtk_widget_grab_focus (preview_pane->priv->web_view);
+ }
+}
+
+static void
preview_pane_set_web_view (EPreviewPane *preview_pane,
EWebView *web_view)
{
@@ -175,6 +198,9 @@ preview_pane_constructed (GObject *object)
priv->search_bar = g_object_ref (widget);
gtk_widget_hide (widget);
+ e_signal_connect_notify (priv->alert_bar, "notify::visible",
+ G_CALLBACK (preview_pane_alert_bar_visible_notify_cb), object);
+
/* Chain up to parent's constructed() method. */
G_OBJECT_CLASS (e_preview_pane_parent_class)->constructed (object);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]