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
This commit is contained in:
arcum42 2011-04-09 08:17:34 +00:00
parent 378a92b4c6
commit 4bb717bab2
1 changed files with 19 additions and 2 deletions

View File

@ -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 <gdk/gdkx.h>
#include "PadLinux.h"
Display *GSdsp;
@ -63,7 +63,24 @@ void _PadUpdate(int pad)
s32 _PADOpen(void *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;