summaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorSND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2009-11-27 12:02:09 +0000
committerSND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2009-11-27 12:02:09 +0000
commit555d07b089f1893a3ae9534dcad7397f1fd6eedf (patch)
treedbfa59af072cb607cf373d38c2b148507fdd074b /gui
parent9490d3a6dce545d19cadcebf3e33a55b8b27e13e (diff)
downloadpcsxr-555d07b089f1893a3ae9534dcad7397f1fd6eedf.tar.gz
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@38321 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'gui')
-rw-r--r--gui/LnxMain.c28
-rw-r--r--gui/Makefile.am3
-rw-r--r--gui/Makefile.in3
3 files changed, 31 insertions, 3 deletions
diff --git a/gui/LnxMain.c b/gui/LnxMain.c
index f1fe1846..53b2bf7f 100644
--- a/gui/LnxMain.c
+++ b/gui/LnxMain.c
@@ -31,7 +31,7 @@
#include <sys/stat.h>
#include "Linux.h"
-/* FIXME */
+
#include "../libpcsxcore/sio.h"
#include "config.h"
@@ -40,6 +40,8 @@
#include <locale.h>
#endif
+#include <X11/extensions/XTest.h>
+
enum {
DONT_USE_GUI = 0,
USE_GUI
@@ -528,9 +530,33 @@ void SysCloseLibrary(void *lib) {
dlclose(lib);
}
+static void SysDisableScreenSaver() {
+ static time_t fake_key_timer = 0;
+ static char first_time = 1, has_test_ext = 0;
+ Display *display;
+ extern unsigned long gpuDisp;
+
+ display = (Display *)gpuDisp;
+
+ if (first_time) {
+ // check if xtest is available
+ int a, b, c, d;
+ has_test_ext = XTestQueryExtension(display, &a, &b, &c, &d);
+
+ first_time = 0;
+ }
+
+ if (has_test_ext && fake_key_timer < time(NULL)) {
+ XTestFakeRelativeMotionEvent(display, 1, 0, 0);
+ fake_key_timer = time(NULL) + 55;
+ }
+}
+
void SysUpdate() {
PADhandleKey(PAD1_keypressed());
PADhandleKey(PAD2_keypressed());
+
+ SysDisableScreenSaver();
}
/* ADB TODO Replace RunGui() with StartGui ()*/
diff --git a/gui/Makefile.am b/gui/Makefile.am
index a89ed2e2..77c0c46b 100644
--- a/gui/Makefile.am
+++ b/gui/Makefile.am
@@ -16,4 +16,5 @@ pcsx_SOURCES = \
Cheat.c
pcsx_LDADD = \
- $(GTK2_LIBS) $(GLADE2_LIBS) -lpthread -lz -lm ../libpcsxcore/libpcsxcore.a
+ $(GTK2_LIBS) $(GLADE2_LIBS) -lpthread -lz -lm -lXext -lXtst \
+ ../libpcsxcore/libpcsxcore.a
diff --git a/gui/Makefile.in b/gui/Makefile.in
index 45bbe704..0c29fe75 100644
--- a/gui/Makefile.in
+++ b/gui/Makefile.in
@@ -234,7 +234,8 @@ pcsx_SOURCES = \
Cheat.c
pcsx_LDADD = \
- $(GTK2_LIBS) $(GLADE2_LIBS) -lpthread -lz -lm ../libpcsxcore/libpcsxcore.a
+ $(GTK2_LIBS) $(GLADE2_LIBS) -lpthread -lz -lm -lXext -lXtst \
+ ../libpcsxcore/libpcsxcore.a
all: all-am