summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorGlenn Rice <glennricster@gmail.com>2010-02-15 01:09:34 +0000
committerGlenn Rice <glennricster@gmail.com>2010-02-15 01:09:34 +0000
commit666a33eeedcc3fbfa2ae035ea3afa48c84fe3274 (patch)
treec03887c7ce3b38a0e0ccbe17090f518515447481 /Source
parentb245c398a36c07575fcbce4f2cd87640aed8a0a9 (diff)
Fix mouse emulation in fullscreen mode in linux. The window doesn't have focus then.
Also minor tweak to mouse hiding. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5063 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source')
-rw-r--r--Source/Plugins/Plugin_GCPad/Src/GCPad.cpp4
-rw-r--r--Source/Plugins/Plugin_VideoOGL/Src/GLUtil.cpp15
-rw-r--r--Source/Plugins/Plugin_VideoOGL/Src/GLUtil.h1
-rw-r--r--Source/Plugins/Plugin_Wiimote/Src/EmuMain.cpp1
-rw-r--r--Source/Plugins/Plugin_Wiimote/Src/main.cpp4
5 files changed, 20 insertions, 5 deletions
diff --git a/Source/Plugins/Plugin_GCPad/Src/GCPad.cpp b/Source/Plugins/Plugin_GCPad/Src/GCPad.cpp
index 4f4282a363..53c95084e6 100644
--- a/Source/Plugins/Plugin_GCPad/Src/GCPad.cpp
+++ b/Source/Plugins/Plugin_GCPad/Src/GCPad.cpp
@@ -660,7 +660,9 @@ bool IsFocus()
Window FocusWin;
int Revert;
XGetInputFocus(GCdisplay, &FocusWin, &Revert);
- return (GLWin != 0 && GLWin == FocusWin);
+ XWindowAttributes WinAttribs;
+ XGetWindowAttributes (GCdisplay, GLWin, &WinAttribs);
+ return (GLWin != 0 && (GLWin == FocusWin || WinAttribs.override_redirect));
#else
return true;
#endif
diff --git a/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.cpp b/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.cpp
index 92e6727234..3aad496f28 100644
--- a/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.cpp
+++ b/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.cpp
@@ -411,9 +411,8 @@ bool OpenGL_Create(SVideoInitialize &_VideoInitialize, int _iwidth, int _iheight
char ZeroData[1] = {0};
Cursor MouseCursor;
Blank = XCreateBitmapFromData (GLWin.dpy, GLWin.win, ZeroData, 1, 1);
- MouseCursor = XCreatePixmapCursor(GLWin.dpy, Blank, Blank, &DummyColor, &DummyColor, 0, 0);
+ GLWin.blankCursor = XCreatePixmapCursor(GLWin.dpy, Blank, Blank, &DummyColor, &DummyColor, 0, 0);
XFreePixmap (GLWin.dpy, Blank);
- XDefineCursor (GLWin.dpy, GLWin.win, MouseCursor);
}
#endif
return true;
@@ -474,6 +473,10 @@ bool OpenGL_MakeCurrent()
} else {
ERROR_LOG(VIDEO, "no Direct Rendering possible!");
}
+
+ // Hide the cursor now
+ if (g_Config.bHideCursor)
+ XDefineCursor (GLWin.dpy, GLWin.win, GLWin.blankCursor);
// better for pad plugin key input (thc)
XSelectInput(GLWin.dpy, GLWin.win, ExposureMask | KeyPressMask | KeyReleaseMask |
@@ -579,6 +582,14 @@ void OpenGL_Update()
case ButtonPress:
case ButtonRelease:
break;
+ case FocusIn:
+ if (g_Config.bHideCursor)
+ XDefineCursor(GLWin.dpy, GLWin.win, GLWin.blankCursor);
+ break;
+ case FocusOut:
+ if (g_Config.bHideCursor)
+ XUndefineCursor(GLWin.dpy, GLWin.win);
+ break;
case ConfigureNotify:
Window winDummy;
unsigned int borderDummy;
diff --git a/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.h b/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.h
index 0b14e16b39..679cd441c4 100644
--- a/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.h
+++ b/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.h
@@ -93,6 +93,7 @@ typedef struct {
Window win;
Display *dpy;
GLXContext ctx;
+ Cursor blankCursor;
XSetWindowAttributes attr;
Bool fs;
Bool doubleBuffered;
diff --git a/Source/Plugins/Plugin_Wiimote/Src/EmuMain.cpp b/Source/Plugins/Plugin_Wiimote/Src/EmuMain.cpp
index 24e1f25dfd..224269713d 100644
--- a/Source/Plugins/Plugin_Wiimote/Src/EmuMain.cpp
+++ b/Source/Plugins/Plugin_Wiimote/Src/EmuMain.cpp
@@ -216,7 +216,6 @@ void GetMousePos(float& x, float& y)
float PictureWidth = WinWidth, PictureHeight = WinHeight;
#else
#if defined(HAVE_X11) && HAVE_X11
- Window GLWin = *(Window *)g_WiimoteInitialize.pXWindow;
float WinWidth = 0, WinHeight = 0;
float XOffset = 0, YOffset = 0;
int root_x, root_y, win_x, win_y;
diff --git a/Source/Plugins/Plugin_Wiimote/Src/main.cpp b/Source/Plugins/Plugin_Wiimote/Src/main.cpp
index 6656d35ec9..3bcb2cf177 100644
--- a/Source/Plugins/Plugin_Wiimote/Src/main.cpp
+++ b/Source/Plugins/Plugin_Wiimote/Src/main.cpp
@@ -419,7 +419,9 @@ bool IsFocus()
Window FocusWin;
int Revert;
XGetInputFocus(WMdisplay, &FocusWin, &Revert);
- return (GLWin != 0 && GLWin == FocusWin);
+ XWindowAttributes WinAttribs;
+ XGetWindowAttributes (WMdisplay, GLWin, &WinAttribs);
+ return (GLWin != 0 && (GLWin == FocusWin || WinAttribs.override_redirect));
#else
return true;
#endif