diff options
| author | Po Lu | 2025-02-17 10:56:37 +0800 |
|---|---|---|
| committer | Po Lu | 2025-02-17 10:56:45 +0800 |
| commit | e34ea5db5f1c09582e3779828ba248eec5769eb2 (patch) | |
| tree | 3fdf8e875f1f115e8642599f34d089d732cf4078 /src | |
| parent | 48f9d6aafea0a9790d1f78d4a4037cbcff4f799a (diff) | |
| download | emacs-e34ea5db5f1c09582e3779828ba248eec5769eb2.tar.gz emacs-e34ea5db5f1c09582e3779828ba248eec5769eb2.zip | |
* src/pgtkterm.c (pgtk_enumerate_devices): Circumvent bug#76239.
Diffstat (limited to 'src')
| -rw-r--r-- | src/pgtkterm.c | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/src/pgtkterm.c b/src/pgtkterm.c index 321514fbf79..617ed3c5135 100644 --- a/src/pgtkterm.c +++ b/src/pgtkterm.c | |||
| @@ -181,13 +181,27 @@ pgtk_enumerate_devices (struct pgtk_display_info *dpyinfo, | |||
| 181 | { | 181 | { |
| 182 | rec = xmalloc (sizeof *rec); | 182 | rec = xmalloc (sizeof *rec); |
| 183 | rec->seat = g_object_ref (seat); | 183 | rec->seat = g_object_ref (seat); |
| 184 | rec->device = GDK_DEVICE (t1->data); | ||
| 185 | 184 | ||
| 186 | snprintf (printbuf, 1026, "%u:%s", | 185 | if (t1->data) |
| 187 | gdk_device_get_source (rec->device), | 186 | { |
| 188 | gdk_device_get_name (rec->device)); | 187 | rec->device = GDK_DEVICE (t1->data); |
| 188 | snprintf (printbuf, 1026, "%u:%s", | ||
| 189 | gdk_device_get_source (rec->device), | ||
| 190 | gdk_device_get_name (rec->device)); | ||
| 191 | |||
| 192 | rec->name = build_string (printbuf); | ||
| 193 | } | ||
| 194 | else | ||
| 195 | { | ||
| 196 | /* GTK bug 7737 results in GDK seats being initialized | ||
| 197 | with NULL devices in some cirumstances. As events will | ||
| 198 | presumably also be delivered with their device fields | ||
| 199 | set to NULL, insert a ersatz device record associated | ||
| 200 | with NULL. (bug#76239) */ | ||
| 201 | rec->device = NULL; | ||
| 202 | rec->name = build_string ("0:unknown device"); | ||
| 203 | } | ||
| 189 | 204 | ||
| 190 | rec->name = build_string (printbuf); | ||
| 191 | rec->next = dpyinfo->devices; | 205 | rec->next = dpyinfo->devices; |
| 192 | dpyinfo->devices = rec; | 206 | dpyinfo->devices = rec; |
| 193 | } | 207 | } |