[Xfce4-commits] [panel-plugins/xfce4-whiskermenu-plugin] 342/473: Fix unable to click command buttons with focus follows mouse. Closes #70.
noreply at xfce.org
noreply at xfce.org
Mon Feb 16 23:58:32 CET 2015
This is an automated email from the git hooks/post-receive script.
gottcode pushed a commit to branch master
in repository panel-plugins/xfce4-whiskermenu-plugin.
commit bf8d5c3cb7299f69a1f2678d3f9be757111c600f
Author: Graeme Gott <graeme at gottcode.org>
Date: Wed Feb 26 11:17:56 2014 -0500
Fix unable to click command buttons with focus follows mouse. Closes #70.
---
panel-plugin/page.cpp | 4 +++-
panel-plugin/window.cpp | 28 +++++++++++++---------------
panel-plugin/window.h | 4 ++--
3 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/panel-plugin/page.cpp b/panel-plugin/page.cpp
index 1ead140..893ff68 100644
--- a/panel-plugin/page.cpp
+++ b/panel-plugin/page.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013 Graeme Gott <graeme at gottcode.org>
+ * Copyright (C) 2013, 2014 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
@@ -253,6 +253,8 @@ void Page::destroy_context_menu(GtkMenuShell* menu)
gtk_tree_view_set_hover_selection(GTK_TREE_VIEW(m_view->get_widget()), true);
gtk_widget_destroy(GTK_WIDGET(menu));
+
+ m_window->on_context_menu_destroyed();
}
//-----------------------------------------------------------------------------
diff --git a/panel-plugin/window.cpp b/panel-plugin/window.cpp
index 8c04ad7..662854a 100644
--- a/panel-plugin/window.cpp
+++ b/panel-plugin/window.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013 Graeme Gott <graeme at gottcode.org>
+ * Copyright (C) 2013, 2014 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
@@ -64,7 +64,6 @@ Window::Window() :
gtk_widget_add_events(GTK_WIDGET(m_window), GDK_BUTTON_PRESS_MASK | GDK_LEAVE_NOTIFY_MASK | GDK_STRUCTURE_MASK);
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, "focus-in-event", &Window::on_focus_in_event, this);
g_signal_connect_slot(m_window, "button-press-event", &Window::on_button_press_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);
@@ -566,6 +565,18 @@ void Window::save()
//-----------------------------------------------------------------------------
+void Window::on_context_menu_destroyed()
+{
+ gdk_pointer_grab(gtk_widget_get_window(GTK_WIDGET(m_window)), true,
+ GdkEventMask(
+ GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
+ GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK
+ ),
+ NULL, NULL, gtk_get_current_event_time());
+}
+
+//-----------------------------------------------------------------------------
+
void Window::set_categories(const std::vector<SectionButton*>& categories)
{
for (std::vector<SectionButton*>::const_iterator i = categories.begin(), end = categories.end(); i != end; ++i)
@@ -668,19 +679,6 @@ gboolean Window::on_leave_notify_event(GtkWidget*, GdkEvent* event)
//-----------------------------------------------------------------------------
-gboolean Window::on_focus_in_event(GtkWidget*, GdkEvent*)
-{
- gdk_pointer_grab(gtk_widget_get_window(GTK_WIDGET(m_window)), true,
- GdkEventMask(
- GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
- GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK
- ),
- NULL, NULL, gtk_get_current_event_time());
- return false;
-}
-
-//-----------------------------------------------------------------------------
-
gboolean Window::on_button_press_event(GtkWidget*, GdkEvent* event)
{
// Hide menu if user clicks outside
diff --git a/panel-plugin/window.h b/panel-plugin/window.h
index 1f4afc1..fc88056 100644
--- a/panel-plugin/window.h
+++ b/panel-plugin/window.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013 Graeme Gott <graeme at gottcode.org>
+ * Copyright (C) 2013, 2014 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
@@ -67,6 +67,7 @@ public:
void hide();
void show(GtkWidget* parent, bool horizontal);
void save();
+ void on_context_menu_destroyed();
void set_categories(const std::vector<SectionButton*>& categories);
void set_items();
void set_loaded();
@@ -75,7 +76,6 @@ public:
private:
gboolean on_enter_notify_event(GtkWidget*, GdkEvent* event);
gboolean on_leave_notify_event(GtkWidget*, GdkEvent* event);
- gboolean on_focus_in_event(GtkWidget*, GdkEvent*);
gboolean on_button_press_event(GtkWidget*, GdkEvent* event);
gboolean on_key_press_event(GtkWidget* widget, GdkEvent* event);
gboolean on_key_press_event_after(GtkWidget* widget, GdkEvent* event);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list