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

Unit 193 gitlab at salsa.debian.org
Thu Jul 30 05:16:32 BST 2020


Unit 193   pushed to branch upstream/latest at xfce / goodies / xfce4-whiskermenu-plugin


Commits:
0b39e895 by Unit 193 at 2020-07-30T00:06:47-04:00
New upstream version 2.4.6.
- - - - -


4 changed files:

- CMakeLists.txt
- NEWS
- panel-plugin/plugin.cpp
- panel-plugin/window.cpp


Changes:

=====================================
CMakeLists.txt
=====================================
@@ -5,7 +5,7 @@ project(whiskermenu)
 # version number
 set(whiskermenu_version_major "2")
 set(whiskermenu_version_minor "4")
-set(whiskermenu_version_micro "5")
+set(whiskermenu_version_micro "6")
 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,8 @@
+2.4.6
+=====
+- Fix crash during grab check. (Issue #19)
+- Fix background incorrect without compositing.
+
 2.4.5
 =====
 - Fix saving plugin title with overridden default text. (Bug #16822)


=====================================
panel-plugin/plugin.cpp
=====================================
@@ -47,32 +47,34 @@ static void plugin_free(XfcePanelPlugin*, gpointer user_data)
 
 // Wait for grab; allows modifier as shortcut
 // Adapted from http://git.xfce.org/xfce/xfce4-panel/tree/common/panel-utils.c#n122
-static bool can_grab(GtkWidget* widget)
+static bool can_grab()
 {
-	bool grab_succeed = false;
-
-	GdkWindow* window = gtk_widget_get_window(widget);
+	GdkWindow* window = gdk_screen_get_root_window(xfce_gdk_screen_get_active(nullptr));
 	GdkDisplay* display = gdk_window_get_display(window);
 	GdkSeat* seat = gdk_display_get_default_seat(display);
+	GdkDevice* keyboard = gdk_seat_get_keyboard(seat);
 
 	// Don't try to get the grab for longer then 1/4 second
 	for (int i = 0; i < 2500; ++i)
 	{
-		if (gdk_seat_grab(seat, window, GDK_SEAT_CAPABILITY_ALL, true, nullptr, nullptr, nullptr, nullptr) == GDK_GRAB_SUCCESS)
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+		const GdkGrabStatus grab_status = gdk_device_grab(keyboard,
+				window,
+				GDK_OWNERSHIP_NONE,
+				true,
+				GdkEventMask(GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK),
+				nullptr,
+				GDK_CURRENT_TIME);
+		if (grab_status == GDK_GRAB_SUCCESS)
 		{
-			gdk_seat_ungrab(seat);
-			grab_succeed = true;
-			break;
+			gdk_device_ungrab(keyboard, GDK_CURRENT_TIME);
+			return true;
 		}
+G_GNUC_END_IGNORE_DEPRECATIONS
 		g_usleep(100);
 	}
 
-	if (!grab_succeed)
-	{
-		g_printerr("xfce4-whiskermenu-plugin: Unable to get keyboard and mouse grab. Menu popup failed.\n");
-	}
-
-	return grab_succeed;
+	return false;
 }
 
 #if !LIBXFCE4PANEL_CHECK_VERSION(4,13,0)
@@ -363,7 +365,7 @@ void Plugin::mode_changed(XfcePanelPlugin*, XfcePanelPluginMode mode)
 
 gboolean Plugin::remote_event(XfcePanelPlugin*, gchar* name, GValue* value)
 {
-	if (strcmp(name, "popup") || !can_grab(m_button))
+	if (strcmp(name, "popup"))
 	{
 		return false;
 	}
@@ -372,6 +374,10 @@ gboolean Plugin::remote_event(XfcePanelPlugin*, gchar* name, GValue* value)
 	{
 		m_window->hide();
 	}
+	else if (!can_grab())
+	{
+		g_printerr("xfce4-whiskermenu-plugin: Unable to get keyboard. Menu popup failed.\n");
+	}
 	else if (value && G_VALUE_HOLDS_BOOLEAN(value) && g_value_get_boolean(value))
 	{
 		show_menu(true);


=====================================
panel-plugin/window.cpp
=====================================
@@ -831,7 +831,10 @@ gboolean WhiskerMenu::Window::on_draw_event(GtkWidget* widget, cairo_t* cr)
 	const double width = gtk_widget_get_allocated_width(widget);
 	const double height = gtk_widget_get_allocated_height(widget);
 
-	if (m_supports_alpha)
+	GdkScreen* screen = gtk_widget_get_screen(widget);
+	const bool enabled = gdk_screen_is_composited(screen);
+
+	if (enabled && m_supports_alpha)
 	{
 		cairo_surface_t* background = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, width, height);
 		cairo_t* cr_background = cairo_create(background);



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

-- 
View it on GitLab: https://salsa.debian.org/xfce-team/goodies/xfce4-whiskermenu-plugin/-/commit/0b39e89577fa47d4df54a11c9ab43e675d3410d2
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/20200730/b1076599/attachment-0001.html>


More information about the Pkg-xfce-commits mailing list