Subject: Re: bug#76239: crash with "gdk_device_get_name: assertion, 'GDK_IS_DEVICE (device)' failed" error on kde 6.3, fedora 41

From: Pip Cet <[email-masked]>
Date: Sat, 15 Feb 2025 13:00:24 +0000

"Tim Cross" <[email-masked]> writes:

> Just confirming I'm also seeing this same error since the update to
> Plasma 63 on Fedora 41. However, this issue seems specific to Plasma 6.3
> and may not be an emacs issue. The emacs pgtk build still seems to work
> fine under other wayland compositors such as Sway and Hyprland. Would
> indicate this is either specific to Plasma 6.3 or to Fedora's packaging
> of Plasma 6.3.
>
> Emacs was working fune prior to the update to Plasma 6.3 with pgtk build
> under wayland.

Can you try this patch?

>From 053c40aa589b410d6e6b3534314338966704d9a7 Mon Sep 17 00:00:00 2001
From: Pip Cet <[email-masked]>
Subject: [PATCH] Ignore NULL devices returned by gdk_seat_get_devices
 (bug#76239)

* src/pgtkterm.c (pgtk_enumerate_devices): Ignore NULL list entries.
---
 src/pgtkterm.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/pgtkterm.c b/src/pgtkterm.c
index dd85d622a62..a41cd115052 100644
--- a/src/pgtkterm.c
+++ b/src/pgtkterm.c
@@ -182,6 +182,9 @@ pgtk_enumerate_devices (struct pgtk_display_info *dpyinfo,
 
       for (t1 = devices_on_seat; t1; t1 = t1->next)
 	{
+	  /* Bug#76239, GTK bug TBD */
+	  if (t1->data == NULL)
+	    continue;
 	  rec = xmalloc (sizeof *rec);
 	  rec->seat = g_object_ref (seat);
 	  rec->device = GDK_DEVICE (t1->data);
-- 
2.48.1