[Xfce4-commits] [panel-plugins/xfce4-whiskermenu-plugin] 01/01: Fix category button staying active when dragged. (bug #14419)

noreply at xfce.org noreply at xfce.org
Wed Jul 4 18:00:52 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 00d39d44fda2252250af774e11a68135425c9224
Author: Graeme Gott <graeme at gottcode.org>
Date:   Wed Jul 4 09:51:03 2018 -0400

    Fix category button staying active when dragged. (bug #14419)
---
 panel-plugin/window.cpp | 21 +++++++++++++++++++++
 panel-plugin/window.h   |  2 ++
 2 files changed, 23 insertions(+)

diff --git a/panel-plugin/window.cpp b/panel-plugin/window.cpp
index 53c1e18..f222672 100644
--- a/panel-plugin/window.cpp
+++ b/panel-plugin/window.cpp
@@ -89,6 +89,7 @@ WhiskerMenu::Window::Window(Plugin* plugin) :
 	g_signal_connect_slot(m_window, "enter-notify-event", &Window::on_enter_notify_event, this);
 	g_signal_connect_slot(m_window, "leave-notify-event", &Window::on_leave_notify_event, this);
 	g_signal_connect_slot(m_window, "button-press-event", &Window::on_button_press_event, this);
+	g_signal_connect_slot(m_window, "button-release-event", &Window::on_button_release_event, this);
 	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);
@@ -283,6 +284,9 @@ void WhiskerMenu::Window::hide()
 {
 	ungrab_pointer();
 
+	// Reset any pressed category buttons
+	unset_pressed_category();
+
 	// Hide command buttons to remove active border
 	for (int i = 0; i < 4; ++i)
 	{
@@ -747,6 +751,14 @@ gboolean WhiskerMenu::Window::on_button_press_event(GtkWidget*, GdkEvent* event)
 
 //-----------------------------------------------------------------------------
 
+gboolean WhiskerMenu::Window::on_button_release_event(GtkWidget*, GdkEvent*)
+{
+	unset_pressed_category();
+	return false;
+}
+
+//-----------------------------------------------------------------------------
+
 gboolean WhiskerMenu::Window::on_key_press_event(GtkWidget* widget, GdkEvent* event)
 {
 	GdkEventKey* key_event = reinterpret_cast<GdkEventKey*>(event);
@@ -1001,3 +1013,12 @@ void WhiskerMenu::Window::search()
 }
 
 //-----------------------------------------------------------------------------
+
+void WhiskerMenu::Window::unset_pressed_category()
+{
+	// Force a state change on sidebar buttons
+	gtk_widget_set_sensitive(GTK_WIDGET(m_sidebar_buttons), false);
+	gtk_widget_set_sensitive(GTK_WIDGET(m_sidebar_buttons), true);
+}
+
+//-----------------------------------------------------------------------------
diff --git a/panel-plugin/window.h b/panel-plugin/window.h
index 4855831..2177b39 100644
--- a/panel-plugin/window.h
+++ b/panel-plugin/window.h
@@ -86,6 +86,7 @@ private:
 	gboolean on_enter_notify_event(GtkWidget*, GdkEvent* event);
 	gboolean on_leave_notify_event(GtkWidget*, GdkEvent* event);
 	gboolean on_button_press_event(GtkWidget*, GdkEvent* event);
+	gboolean on_button_release_event(GtkWidget*, GdkEvent* event);
 	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*);
@@ -99,6 +100,7 @@ private:
 	void show_favorites();
 	void show_default_page();
 	void search();
+	void unset_pressed_category();
 
 private:
 	Plugin* m_plugin;

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list