modules/graphics/src/main/native-glass/gtk/glass_screen.cpp

Print this page

        

@@ -23,17 +23,23 @@
  * questions.
  */
 
 #include <stdlib.h>
 
+// The includes below will end up including gio.h without an extern "C",
+// so we include gio.h here early on to make sure that the names are mangled
+// using the C conventions rather than the C++ conventions.
+extern "C" {
+#include <gio/gio.h>
+}
+
 #include "glass_screen.h"
 #include "glass_general.h"
 
 #include <X11/Xatom.h>
 #include <gdk/gdk.h>
 #include <gdk/gdkx.h>
-#include <gio/gio.h>
 
 jfloat OverrideUIScale = -1.0f;
 
 static guint get_current_desktop(GdkScreen *screen) {
     Display* display = gdk_x11_display_get_xdisplay(gdk_display_get_default());