[Xfce4-commits] [panel-plugins/xfce4-whiskermenu-plugin] 03/03: Fix losing search focus. (bug #14209)
noreply at xfce.org
noreply at xfce.org
Sat Apr 7 11:36:36 CEST 2018
This is an automated email from the git hooks/post-receive script.
g o t t c o d e p u s h e d a c o m m i t t o b r a n c h m a s t e r
in repository panel-plugins/xfce4-whiskermenu-plugin.
commit 7f4470b3d01eeff7e1db26c33a1ae98798422c62
Author: Graeme Gott <graeme at gottcode.org>
Date: Mon Apr 2 16:50:29 2018 -0400
Fix losing search focus. (bug #14209)
---
panel-plugin/window.cpp | 14 ++++++++++++++
panel-plugin/window.h | 3 ++-
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/panel-plugin/window.cpp b/panel-plugin/window.cpp
index c62f4c3..2d6f39f 100644
--- a/panel-plugin/window.cpp
+++ b/panel-plugin/window.cpp
@@ -114,6 +114,7 @@ WhiskerMenu::Window::Window() :
g_signal_connect_slot(m_window, "key-press-event", &Window::on_key_press_event, this);
g_signal_connect_slot(m_window, "key-press-event", &Window::on_key_press_event_after, this, true);
g_signal_connect_slot(m_window, "map-event", &Window::on_map_event, this);
+ g_signal_connect_slot(m_window, "state-flags-changed", &Window::on_state_flags_changed_event, this);
g_signal_connect_slot(m_window, "configure-event", &Window::on_configure_event, this);
g_signal_connect(m_window, "delete_event", G_CALLBACK(gtk_widget_hide_on_delete), NULL);
@@ -835,6 +836,19 @@ gboolean WhiskerMenu::Window::on_map_event(GtkWidget*, GdkEvent*)
//-----------------------------------------------------------------------------
+gboolean WhiskerMenu::Window::on_state_flags_changed_event(GtkWidget* widget, GtkStateFlags)
+{
+ // Refocus and raise window if visible
+ if (gtk_widget_get_visible(widget))
+ {
+ gtk_window_present(m_window);
+ }
+
+ return false;
+}
+
+//-----------------------------------------------------------------------------
+
gboolean WhiskerMenu::Window::on_configure_event(GtkWidget*, GdkEvent* event)
{
GdkEventConfigure* configure_event = reinterpret_cast<GdkEventConfigure*>(event);
diff --git a/panel-plugin/window.h b/panel-plugin/window.h
index 4cccee9..68c72a9 100644
--- a/panel-plugin/window.h
+++ b/panel-plugin/window.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013, 2014, 2015, 2016 Graeme Gott <graeme at gottcode.org>
+ * Copyright (C) 2013, 2014, 2015, 2016, 2018 Graeme Gott <graeme at gottcode.org>
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -80,6 +80,7 @@ private:
gboolean on_key_press_event(GtkWidget* widget, GdkEvent* event);
gboolean on_key_press_event_after(GtkWidget* widget, GdkEvent* event);
gboolean on_map_event(GtkWidget*, GdkEvent*);
+ gboolean on_state_flags_changed_event(GtkWidget*widget, GtkStateFlags);
gboolean on_configure_event(GtkWidget*, GdkEvent* event);
void on_screen_changed_event(GtkWidget* widget, GdkScreen* old_screen);
gboolean on_draw_event(GtkWidget* widget, cairo_t* cr);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list