From 4bb717bab29fef83081189be9dc6edbacd0f612c Mon Sep 17 00:00:00 2001 From: arcum42 Date: Sat, 9 Apr 2011 08:17:34 +0000 Subject: [PATCH] PADNull: Fix a bug that caused it to crash if a GS plugin using GSOpen2 was chosen under Linux. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4559 96395faa-99c1-11dd-bbfe-3dabce05a288 --- plugins/PadNull/Linux/PadLinux.cpp | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/plugins/PadNull/Linux/PadLinux.cpp b/plugins/PadNull/Linux/PadLinux.cpp index a5c1371fd8..c36f49ee48 100644 --- a/plugins/PadNull/Linux/PadLinux.cpp +++ b/plugins/PadNull/Linux/PadLinux.cpp @@ -15,7 +15,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ - +#include #include "PadLinux.h" Display *GSdsp; @@ -63,7 +63,24 @@ void _PadUpdate(int pad) s32 _PADOpen(void *pDsp) { - GSdsp = *(Display**)pDsp; + + GtkScrolledWindow *win; + + win = *(GtkScrolledWindow**) pDsp; + + if (GTK_IS_WIDGET(win)) + { + // Since we have a GtkScrolledWindow, for now we'll grab whatever display + // comes along instead. Later, we can fiddle with this, but I'm not sure the + // best way to get a Display* out of a GtkScrolledWindow. A GtkWindow I might + // be able to manage... --arcum42 + GSdsp = GDK_DISPLAY_XDISPLAY(gdk_display_get_default()); + } + else + { + GSdsp = *(Display**)pDsp; + } + XAutoRepeatOff(GSdsp); return 0;