diff --git a/Makefile.common b/Makefile.common
index cb754c70a8..e22288d68a 100644
--- a/Makefile.common
+++ b/Makefile.common
@@ -703,6 +703,12 @@ ifeq ($(HAVE_XVIDEO), 1)
DEFINES += $(XVIDEO_CFLAGS)
endif
+ifeq ($(HAVE_XSHM), 1)
+ OBJ += gfx/drivers/xshm.o
+ LIBS += $(XSHM_LIBS)
+ DEFINES += $(XSHM_CFLAGS)
+endif
+
ifeq ($(HAVE_CG), 1)
DEFINES += -DHAVE_CG
OBJ += gfx/drivers_shader/shader_gl_cg.o
diff --git a/gfx/drivers/xshm.c b/gfx/drivers/xshm.c
new file mode 100644
index 0000000000..9ff612edfd
--- /dev/null
+++ b/gfx/drivers/xshm.c
@@ -0,0 +1,74 @@
+/* RetroArch - A frontend for libretro.
+ * Copyright (C) 2010-2014 - Hans-Kristian Arntzen
+ *
+ * RetroArch is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Found-
+ * ation, either version 3 of the License, or (at your option) any later version.
+ *
+ * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with RetroArch.
+ * If not, see .
+ */
+
+#include "../../driver.h"
+#include "../../general.h"
+#include
+#include
+#include
+#include
+#include "../video_viewport.h"
+#include "../video_monitor.h"
+#include "../font_renderer_driver.h"
+#include
+
+#include "../common/x11_common.h"
+
+#include
+/*#include */
+#include
+#include
+#include
+#include
+
+typedef struct xshm
+{
+ Display* display;
+ int screen;
+
+ Window parentwindow;
+ Window wndw;
+
+ unsigned int width;
+ unsigned int height;
+ unsigned int pitch;
+ videoformat bpp;
+
+ XShmSegmentInfo shmInfo;
+ XImage* image;
+ GC gc;
+} xshm_t;
+
+video_driver_t video_xshm = {
+ NULL,/*xshm_init,*/
+ NULL,/*xshm_frame,*/
+ NULL,/*xshm_set_nonblock_state,*/
+ NULL,/*xshm_alive,*/
+ NULL,/*xshm_focus,*/
+ NULL,/*xshm_suppress_screensaver,*/
+ NULL,/*xshm_has_windowed,*/
+ NULL,/*xshm_set_shader,*/
+ NULL,/*xshm_free,*/
+ "xshm",
+ NULL, /* set_viewport */
+ NULL,/*xshm_set_rotation,*/
+ NULL,/*xshm_viewport_info,*/
+ NULL,/*xshm_read_viewport,*/
+ NULL, /* read_frame_raw */
+#ifdef HAVE_OVERLAY
+ NULL, /* overlay_interface */
+#endif
+ NULL/*xshm_get_poke_interface*/
+};
diff --git a/gfx/video_driver.h b/gfx/video_driver.h
index e2843a22ee..fd9d6f0004 100644
--- a/gfx/video_driver.h
+++ b/gfx/video_driver.h
@@ -204,6 +204,7 @@ extern video_driver_t video_omap;
extern video_driver_t video_exynos;
extern video_driver_t video_dispmanx;
extern video_driver_t video_sunxi;
+extern video_driver_t video_xshm;
extern video_driver_t video_null;
enum rarch_display_type
diff --git a/qb/config.libs.sh b/qb/config.libs.sh
index 367d57dbdf..777fd57715 100644
--- a/qb/config.libs.sh
+++ b/qb/config.libs.sh
@@ -353,7 +353,7 @@ fi
check_pkgconf FREETYPE freetype2
check_pkgconf X11 x11
-[ "$HAVE_X11" = "no" ] && HAVE_XEXT=no && HAVE_XF86VM=no && HAVE_XINERAMA=no
+[ "$HAVE_X11" = "no" ] && HAVE_XEXT=no && HAVE_XF86VM=no && HAVE_XINERAMA=no && HAVE_XSHM=no
check_pkgconf WAYLAND wayland-egl
@@ -377,6 +377,9 @@ if [ "$HAVE_UDEV" != "no" ]; then
fi
fi
+#this one is broken (XShm.h requires some other X headers first), but xshm itself doesn't work either, so it's okay
+check_header XSHM X11/extensions/XShm.h
+
check_header PARPORT linux/parport.h
check_header PARPORT linux/ppdev.h