From ee492d9e2f406dd2dca4804d2f86fe218d4b05ef Mon Sep 17 00:00:00 2001 From: "SND\\ckain_cp" Date: Thu, 25 Jul 2013 13:06:43 +0000 Subject: GTK: added "hide mouse cursor" feature. Enable/disable via dfinput config dialog's option tab. git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@86239 e17a0e51-4ae3-4d35-97c3-1a29b211df97 --- plugins/dfinput/xkb.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'plugins/dfinput/xkb.c') diff --git a/plugins/dfinput/xkb.c b/plugins/dfinput/xkb.c index 616e722f..ed13c7c4 100755 --- a/plugins/dfinput/xkb.c +++ b/plugins/dfinput/xkb.c @@ -25,24 +25,26 @@ static int g_currentMouse_Y; static Window window; void InitKeyboard() { - wmprotocols = XInternAtom(g.Disp, "WM_PROTOCOLS", 0); - wmdelwindow = XInternAtom(g.Disp, "WM_DELETE_WINDOW", 0); + int revert_to; - XkbSetDetectableAutoRepeat(g.Disp, 1, NULL); + wmprotocols = XInternAtom(g.Disp, "WM_PROTOCOLS", 0); + wmdelwindow = XInternAtom(g.Disp, "WM_DELETE_WINDOW", 0); + XkbSetDetectableAutoRepeat(g.Disp, 1, NULL); + XGetInputFocus(g.Disp, &window, &revert_to); if (g.cfg.PadDef[0].Type == PSE_PAD_TYPE_MOUSE || g.cfg.PadDef[1].Type == PSE_PAD_TYPE_MOUSE) { - int revert_to; - XGetInputFocus(g.Disp, &window, &revert_to); grabCursor(g.Disp, window, 1); showCursor(g.Disp, window, 0); + } else if (g.cfg.HideCursor) { + showCursor(g.Disp, window, 0); } g_currentMouse_X = 0; g_currentMouse_Y = 0; - g.PadState[0].KeyStatus = 0xFFFF; - g.PadState[1].KeyStatus = 0xFFFF; + g.PadState[0].KeyStatus = 0xFFFF; + g.PadState[1].KeyStatus = 0xFFFF; } void DestroyKeyboard() { @@ -52,6 +54,8 @@ void DestroyKeyboard() { g.cfg.PadDef[1].Type == PSE_PAD_TYPE_MOUSE) { grabCursor(g.Disp, window, 0); showCursor(g.Disp, window, 1); + } else if (g.cfg.HideCursor) { + showCursor(g.Disp, window, 1); } } -- cgit v1.2.3