[Pkg-xfce-commits] [Git][xfce-team/goodies/xfce4-whiskermenu-plugin][upstream/latest] New upstream version 2.6.2

Yves-Alexis Perez (@corsac) gitlab at salsa.debian.org
Sun Nov 14 10:45:31 GMT 2021



Yves-Alexis Perez pushed to branch upstream/latest at xfce / goodies / xfce4-whiskermenu-plugin


Commits:
a3f3b826 by Yves-Alexis Perez at 2021-11-14T11:27:22+01:00
New upstream version 2.6.2
- - - - -


10 changed files:

- CMakeLists.txt
- NEWS
- panel-plugin/command.cpp
- panel-plugin/element.cpp
- panel-plugin/launcher-tree-view.cpp
- panel-plugin/page.cpp
- panel-plugin/plugin.cpp
- panel-plugin/plugin.h
- panel-plugin/window.cpp
- panel-plugin/window.h


Changes:

=====================================
CMakeLists.txt
=====================================
@@ -5,7 +5,7 @@ project(whiskermenu)
 # version number
 set(whiskermenu_version_major "2")
 set(whiskermenu_version_minor "6")
-set(whiskermenu_version_micro "1")
+set(whiskermenu_version_micro "2")
 set(whiskermenu_version_tag "")
 set(whiskermenu_version "${whiskermenu_version_major}.${whiskermenu_version_minor}.${whiskermenu_version_micro}")
 if(${whiskermenu_version_tag} MATCHES "git")


=====================================
NEWS
=====================================
@@ -1,3 +1,9 @@
+2.6.2
+=====
+- Fix background shifting when showing menu. (Issue #41)
+- Fix menu not toggling after pressing escape. (Issue #65)
+- Properly prevent interactive search in treeview.
+
 2.6.1
 =====
 - Fix menu not toggling. (Issue #61)


=====================================
panel-plugin/command.cpp
=====================================
@@ -18,7 +18,6 @@
 #include "command.h"
 
 #include "image-menu-item.h"
-#include "plugin.h"
 #include "settings.h"
 #include "slot.h"
 
@@ -213,11 +212,7 @@ void Command::activate()
 	}
 
 	GError* error = nullptr;
-	if (g_spawn_command_line_async(m_command, &error))
-	{
-		Plugin::launcher_activated();
-	}
-	else
+	if (!g_spawn_command_line_async(m_command, &error))
 	{
 		xfce_dialog_show_error(nullptr, error, m_error_text, nullptr);
 		g_error_free(error);


=====================================
panel-plugin/element.cpp
=====================================
@@ -17,8 +17,6 @@
 
 #include "element.h"
 
-#include "plugin.h"
-
 #include <libxfce4ui/libxfce4ui.h>
 
 using namespace WhiskerMenu;
@@ -103,11 +101,7 @@ void Element::spawn(GdkScreen* screen, const gchar* command, const gchar* workin
 		g_strfreev(argv);
 	}
 
-	if (result)
-	{
-		Plugin::launcher_activated();
-	}
-	else
+	if (!result)
 	{
 		xfce_dialog_show_error(nullptr, error, _("Failed to execute command \"%s\"."), command);
 		g_error_free(error);


=====================================
panel-plugin/launcher-tree-view.cpp
=====================================
@@ -188,6 +188,7 @@ void LauncherTreeView::set_model(GtkTreeModel* model)
 {
 	m_model = model;
 	gtk_tree_view_set_model(m_view, model);
+	gtk_tree_view_set_search_column(m_view, -1);
 }
 
 //-----------------------------------------------------------------------------


=====================================
panel-plugin/page.cpp
=====================================
@@ -178,7 +178,6 @@ void Page::create_view()
 	{
 		m_view = new LauncherTreeView();
 		g_signal_connect(m_view->get_widget(), "row-activated", G_CALLBACK(&Page::row_activated_slot), this);
-		g_signal_connect_swapped(m_view->get_widget(), "start-interactive-search", G_CALLBACK(&gtk_widget_grab_focus), m_window->get_search_entry());
 	}
 	g_signal_connect_slot(m_view->get_widget(), "button-press-event", &Page::view_button_press_event, this);
 	g_signal_connect_slot(m_view->get_widget(), "button-release-event", &Page::view_button_release_event, this);


=====================================
panel-plugin/plugin.cpp
=====================================
@@ -32,8 +32,6 @@ extern "C"
 
 using namespace WhiskerMenu;
 
-bool Plugin::m_menu_shown = false;
-
 //-----------------------------------------------------------------------------
 
 extern "C" void whiskermenu_construct(XfcePanelPlugin* plugin)
@@ -94,7 +92,8 @@ Plugin::Plugin(XfcePanelPlugin* plugin) :
 	m_plugin(plugin),
 	m_window(nullptr),
 	m_opacity(100),
-	m_file_icon(false)
+	m_file_icon(false),
+	m_menu_shown(false)
 {
 	// Load settings
 	wm_settings = new Settings;
@@ -181,7 +180,6 @@ Plugin::Plugin(XfcePanelPlugin* plugin) :
 
 	// Create menu window
 	m_window = new Window(this);
-	g_signal_connect_slot<GtkWidget*>(m_window->get_widget(), "unmap", &Plugin::menu_hidden, this);
 }
 
 //-----------------------------------------------------------------------------
@@ -229,6 +227,18 @@ std::string Plugin::get_button_icon_name() const
 
 //-----------------------------------------------------------------------------
 
+void Plugin::menu_hidden(bool lost_focus)
+{
+	if (!lost_focus)
+	{
+		m_menu_shown = false;
+	}
+	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(m_button), false);
+	save();
+}
+
+//-----------------------------------------------------------------------------
+
 void Plugin::reload()
 {
 	m_window->hide();
@@ -318,7 +328,6 @@ void Plugin::button_toggled(GtkToggleButton* button)
 	{
 		if (gtk_widget_get_visible(m_window->get_widget()))
 		{
-			m_menu_shown = false;
 			m_window->hide();
 		}
 		xfce_panel_plugin_block_autohide(m_plugin, false);
@@ -332,14 +341,6 @@ void Plugin::button_toggled(GtkToggleButton* button)
 
 //-----------------------------------------------------------------------------
 
-void Plugin::menu_hidden()
-{
-	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(m_button), false);
-	save();
-}
-
-//-----------------------------------------------------------------------------
-
 void Plugin::configure()
 {
 	SettingsDialog* dialog = new SettingsDialog(this);
@@ -567,7 +568,6 @@ void Plugin::show_menu(bool at_cursor)
 		{
 			delete m_window;
 			m_window = new Window(this);
-			g_signal_connect_slot<GtkWidget*>(m_window->get_widget(), "unmap", &Plugin::menu_hidden, this);
 		}
 		m_opacity = wm_settings->menu_opacity;
 	}


=====================================
panel-plugin/plugin.h
=====================================
@@ -58,6 +58,7 @@ public:
 	static std::string get_button_title_default();
 	std::string get_button_icon_name() const;
 
+	void menu_hidden(bool lost_focus);
 	void reload();
 	void set_button_style(ButtonStyle style);
 	void set_button_title(const std::string& title);
@@ -65,14 +66,8 @@ public:
 	void set_configure_enabled(bool enabled);
 	void set_loaded(bool loaded);
 
-	static void launcher_activated()
-	{
-		m_menu_shown = false;
-	}
-
 private:
 	void button_toggled(GtkToggleButton* button);
-	void menu_hidden();
 	void configure();
 	void icon_changed(const gchar* icon);
 	void mode_changed(XfcePanelPlugin*, XfcePanelPluginMode mode);
@@ -94,8 +89,7 @@ private:
 
 	int m_opacity;
 	bool m_file_icon;
-
-	static bool m_menu_shown;
+	bool m_menu_shown;
 };
 
 }


=====================================
panel-plugin/window.cpp
=====================================
@@ -249,7 +249,7 @@ WhiskerMenu::Window::~Window()
 
 //-----------------------------------------------------------------------------
 
-void WhiskerMenu::Window::hide()
+void WhiskerMenu::Window::hide(bool lost_focus)
 {
 	// Scroll categories to top
 	GtkAdjustment* adjustment = gtk_scrolled_window_get_vadjustment(m_sidebar);
@@ -266,6 +266,9 @@ void WhiskerMenu::Window::hide()
 
 	// Switch back to default page
 	show_default_page();
+
+	// Inform plugin that window is hidden
+	m_plugin->menu_hidden(lost_focus);
 }
 
 //-----------------------------------------------------------------------------
@@ -395,11 +398,11 @@ void WhiskerMenu::Window::show(const Position position)
 	if (position != PositionVertical)
 	{
 		m_geometry.x = layout_left ? parent_x : (parent_x + parent_w - m_geometry.width);
-		m_geometry.y = layout_bottom ? (parent_y - m_geometry.height) : (parent_y + parent_h);
+		m_geometry.y = layout_bottom ? (parent_y - m_geometry.height - 1) : (parent_y + parent_h + 1);
 	}
 	else
 	{
-		m_geometry.x = layout_left ? (parent_x + parent_w) : (parent_x - m_geometry.width);
+		m_geometry.x = layout_left ? (parent_x + parent_w + 1) : (parent_x - m_geometry.width - 1);
 		m_geometry.y = layout_bottom ? (parent_y + parent_h - m_geometry.height) : parent_y;
 	}
 
@@ -571,7 +574,7 @@ gboolean WhiskerMenu::Window::on_focus_out_event(GtkWidget* widget, GdkEvent*)
 
 	if (!m_child_has_focus && gtk_widget_get_visible(widget))
 	{
-		hide();
+		hide(true);
 	}
 
 	return GDK_EVENT_PROPAGATE;
@@ -719,7 +722,7 @@ gboolean WhiskerMenu::Window::on_window_state_event(GtkWidget*, GdkEvent* event)
 	GdkEventWindowState* state_event = reinterpret_cast<GdkEventWindowState*>(event);
 	if (state_event->new_window_state == (GDK_WINDOW_STATE_WITHDRAWN | GDK_WINDOW_STATE_STICKY))
 	{
-		Plugin::launcher_activated();
+		m_plugin->menu_hidden(false);
 	}
 
 	return GDK_EVENT_PROPAGATE;


=====================================
panel-plugin/window.h
=====================================
@@ -78,7 +78,12 @@ public:
 		return m_recent;
 	}
 
-	void hide();
+	void hide()
+	{
+		hide(false);
+	}
+
+	void hide(bool lost_focus);
 	void show(const Position position);
 	void save();
 	void set_child_has_focus();



View it on GitLab: https://salsa.debian.org/xfce-team/goodies/xfce4-whiskermenu-plugin/-/commit/a3f3b826aa1c4ab298e81e57f0370a3bf713b78a

-- 
View it on GitLab: https://salsa.debian.org/xfce-team/goodies/xfce4-whiskermenu-plugin/-/commit/a3f3b826aa1c4ab298e81e57f0370a3bf713b78a
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-xfce-commits/attachments/20211114/29dc0ac4/attachment-0001.htm>


More information about the Pkg-xfce-commits mailing list