diff options
| author | Glenn Rice <glennricster@gmail.com> | 2010-02-17 23:15:58 +0000 |
|---|---|---|
| committer | Glenn Rice <glennricster@gmail.com> | 2010-02-17 23:15:58 +0000 |
| commit | 2c7b4848696944e8029d52c3b1435a3f3ba29a67 (patch) | |
| tree | 3ded86dbb03b5c361223b2c9c9a33e7278160491 /Source | |
| parent | 5e5e03daeb9afb8ad296860e262bc0018c2b6516 (diff) | |
Fix software plugin in linux. I broke it in revision 5048.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5077 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source')
| -rw-r--r-- | Source/PluginSpecs/pluginspecs_video.h | 1 | ||||
| -rw-r--r-- | Source/Plugins/Plugin_VideoSoftware/Src/GLUtil.cpp | 37 | ||||
| -rw-r--r-- | Source/Plugins/Plugin_VideoSoftware/Src/Renderer.cpp | 3 | ||||
| -rw-r--r-- | Source/Plugins/Plugin_VideoSoftware/Src/main.cpp | 1 |
4 files changed, 18 insertions, 24 deletions
diff --git a/Source/PluginSpecs/pluginspecs_video.h b/Source/PluginSpecs/pluginspecs_video.h index 4b7e282758..c11b8b4db7 100644 --- a/Source/PluginSpecs/pluginspecs_video.h +++ b/Source/PluginSpecs/pluginspecs_video.h @@ -5,6 +5,7 @@ #ifndef _VIDEO_H_INCLUDED__ #define _VIDEO_H_INCLUDED__ +#include "Common.h" #include "PluginSpecs.h" #include "ExportProlog.h" diff --git a/Source/Plugins/Plugin_VideoSoftware/Src/GLUtil.cpp b/Source/Plugins/Plugin_VideoSoftware/Src/GLUtil.cpp index 76b20f4c41..5523d2eba0 100644 --- a/Source/Plugins/Plugin_VideoSoftware/Src/GLUtil.cpp +++ b/Source/Plugins/Plugin_VideoSoftware/Src/GLUtil.cpp @@ -385,7 +385,7 @@ bool OpenGL_Create(SVideoInitialize &_VideoInitialize, int _twidth, int _theight /* create a fullscreen window */
GLWin.attr.override_redirect = True;
- GLWin.attr.event_mask = ExposureMask | KeyPressMask | ButtonPressMask | KeyReleaseMask | ButtonReleaseMask | StructureNotifyMask;
+ GLWin.attr.event_mask = ExposureMask | KeyPressMask | KeyReleaseMask | StructureNotifyMask;
GLWin.win = XCreateWindow(GLWin.dpy, RootWindow(GLWin.dpy, vi->screen),
0, 0, dpyWidth, dpyHeight, 0, vi->depth, InputOutput, vi->visual,
CWBorderPixel | CWColormap | CWEventMask | CWOverrideRedirect,
@@ -393,7 +393,7 @@ bool OpenGL_Create(SVideoInitialize &_VideoInitialize, int _twidth, int _theight XWarpPointer(GLWin.dpy, None, GLWin.win, 0, 0, 0, 0, 0, 0);
XMapRaised(GLWin.dpy, GLWin.win);
XGrabKeyboard(GLWin.dpy, GLWin.win, True, GrabModeAsync, GrabModeAsync, CurrentTime);
- XGrabPointer(GLWin.dpy, GLWin.win, True, ButtonPressMask,
+ XGrabPointer(GLWin.dpy, GLWin.win, True, NULL,
GrabModeAsync, GrabModeAsync, GLWin.win, None, CurrentTime);
}
else {
@@ -413,7 +413,7 @@ bool OpenGL_Create(SVideoInitialize &_VideoInitialize, int _twidth, int _theight //int Y = (rcdesktop.bottom-rcdesktop.top)/2 - (rc.bottom-rc.top)/2;
// create a window in window mode
- GLWin.attr.event_mask = ExposureMask | KeyPressMask | ButtonPressMask | KeyReleaseMask | ButtonReleaseMask |
+ GLWin.attr.event_mask = ExposureMask | KeyPressMask | KeyReleaseMask |
StructureNotifyMask | ResizeRedirectMask;
GLWin.win = XCreateWindow(GLWin.dpy, RootWindow(GLWin.dpy, vi->screen),
0, 0, _twidth, _theight, 0, vi->depth, InputOutput, vi->visual,
@@ -425,6 +425,7 @@ bool OpenGL_Create(SVideoInitialize &_VideoInitialize, int _twidth, int _theight "GPU", None, NULL, 0, NULL);
XMapRaised(GLWin.dpy, GLWin.win);
}
+ g_VideoInitialize.pXWindow = (Window *) &GLWin.win;
#endif
return true;
}
@@ -455,8 +456,8 @@ bool OpenGL_MakeCurrent() }
// better for pad plugin key input (thc)
- XSelectInput(GLWin.dpy, GLWin.win, ExposureMask | KeyPressMask | ButtonPressMask | KeyReleaseMask | ButtonReleaseMask | StructureNotifyMask | EnterWindowMask | LeaveWindowMask |
- FocusChangeMask );
+ XSelectInput(GLWin.dpy, GLWin.win, ExposureMask | KeyPressMask | KeyReleaseMask |
+ StructureNotifyMask | EnterWindowMask | LeaveWindowMask | FocusChangeMask );
#endif
return true;
}
@@ -507,7 +508,6 @@ void OpenGL_Update() // We just check all of our events here
XEvent event;
KeySym key;
- static RECT rcWindow;
static bool ShiftPressed = false;
static bool ControlPressed = false;
static int FKeyPressed = -1;
@@ -525,8 +525,6 @@ void OpenGL_Update() ShiftPressed = false;
else if(key == XK_Control_L || key == XK_Control_R)
ControlPressed = false;
- else
- XPutBackEvent(GLWin.dpy, &event);
}
break;
case KeyPress:
@@ -538,13 +536,10 @@ void OpenGL_Update() ShiftPressed = true;
else if(key == XK_Control_L || key == XK_Control_R)
ControlPressed = true;
- else
- XPutBackEvent(GLWin.dpy, &event);
}
break;
case ButtonPress:
case ButtonRelease:
- XPutBackEvent(GLWin.dpy, &event);
break;
case ConfigureNotify:
Window winDummy;
@@ -553,20 +548,13 @@ void OpenGL_Update() &GLWin.width, &GLWin.height, &borderDummy, &GLWin.depth);
s_backbuffer_width = GLWin.width;
s_backbuffer_height = GLWin.height;
- rcWindow.left = 0;
- rcWindow.top = 0;
- rcWindow.right = GLWin.width;
- rcWindow.bottom = GLWin.height;
break;
- case ClientMessage: //TODO: We aren't reading this correctly, It could be anything, highest chance is that it's a close event though
- Shutdown(); // Calling from here since returning false does nothing
+ case ClientMessage:
+ if ((ulong) event.xclient.data.l[0] == XInternAtom(GLWin.dpy, "WM_DELETE_WINDOW", False))
+ g_VideoInitialize.pKeyPress(0x1b, False, False);
return;
break;
default:
- //TODO: Should we put the event back if we don't handle it?
- // I think we handle all the needed ones, the rest shouldn't matter
- // But to be safe, let's but them back anyway
- //XPutBackEvent(GLWin.dpy, &event);
break;
}
}
@@ -614,11 +602,12 @@ void OpenGL_Shutdown() if ((GLWin.dpy != NULL) && GLWin.fs) {
XUngrabKeyboard (GLWin.dpy, CurrentTime);
XUngrabPointer (GLWin.dpy, CurrentTime);
- XRRSetScreenConfig(GLWin.dpy, GLWin.screenConfig, RootWindow(GLWin.dpy, GLWin.screen),
- GLWin.deskSize, GLWin.screenRotation, CurrentTime);
- XRRFreeScreenConfigInfo(GLWin.screenConfig);
+ XRRSetScreenConfig(GLWin.dpy, GLWin.screenConfig, RootWindow(GLWin.dpy, GLWin.screen),
+ GLWin.deskSize, GLWin.screenRotation, CurrentTime);
+ XRRFreeScreenConfigInfo(GLWin.screenConfig);
}
#endif
+ printf ("Unmapping window\n");
if (GLWin.ctx)
{
if (!glXMakeCurrent(GLWin.dpy, None, NULL))
diff --git a/Source/Plugins/Plugin_VideoSoftware/Src/Renderer.cpp b/Source/Plugins/Plugin_VideoSoftware/Src/Renderer.cpp index 14b909f4fb..69fc22ce7f 100644 --- a/Source/Plugins/Plugin_VideoSoftware/Src/Renderer.cpp +++ b/Source/Plugins/Plugin_VideoSoftware/Src/Renderer.cpp @@ -40,6 +40,9 @@ void Renderer::Init(SVideoInitialize *_pVideoInitialize) _pVideoInitialize->pPeekMessages = g_VideoInitialize.pPeekMessages;
_pVideoInitialize->pUpdateFPSDisplay = g_VideoInitialize.pUpdateFPSDisplay;
_pVideoInitialize->pWindowHandle = g_VideoInitialize.pWindowHandle;
+#if defined(HAVE_X11) && HAVE_X11
+ _pVideoInitialize->pXWindow = g_VideoInitialize.pXWindow;
+#endif
}
void Renderer::Shutdown()
diff --git a/Source/Plugins/Plugin_VideoSoftware/Src/main.cpp b/Source/Plugins/Plugin_VideoSoftware/Src/main.cpp index c832c6270b..6640f1faa5 100644 --- a/Source/Plugins/Plugin_VideoSoftware/Src/main.cpp +++ b/Source/Plugins/Plugin_VideoSoftware/Src/main.cpp @@ -98,6 +98,7 @@ void EmuStateChange(PLUGIN_EMUSTATE newState) void Shutdown(void)
{
+ OpenGL_Shutdown();
}
// This is called after Video_Initialize() from the Core
|
