--- gnome-control-center-3.24.2.orig/panels/common/gsd-device-manager-udev.c
+++ gnome-control-center-3.24.2/panels/common/gsd-device-manager-udev.c
@@ -24,7 +24,10 @@
 #include <string.h>
 #include <gudev/gudev.h>
 
+#ifdef GDK_WINDOWING_WAYLAND
 #include <gdk/gdkwayland.h>
+#endif
+
 #include "gsd-device-manager-udev.h"
 
 struct _GsdUdevDeviceManager
@@ -227,6 +230,7 @@
 gsd_udev_device_manager_lookup_device (GsdDeviceManager *manager,
 				       GdkDevice	*gdk_device)
 {
+#ifdef GDK_WINDOWING_WAYLAND
 	const gchar *node_path;
 	GHashTableIter iter;
 	GsdDevice *device;
@@ -243,6 +247,7 @@
 			return device;
 		}
 	}
+#endif
 
 	return NULL;
 }
