summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElliot Lee <sopwith@src.gnome.org>2000-08-09 17:24:47 +0000
committerElliot Lee <sopwith@src.gnome.org>2000-08-09 17:24:47 +0000
commitd72659968c50d72019bbebda724a3acaf0bc09b8 (patch)
treed925055990a7fe58deda2d84a0edff8278883741
parent06fd9e335d114bc58ce28d63025c8961ed98a905 (diff)
downloadgtk+-d72659968c50d72019bbebda724a3acaf0bc09b8.tar.gz
Some hacks to stop screen blanking.
Some hacks to stop screen blanking.
-rw-r--r--gdk/linux-fb/gdkinput-ps2.c41
-rw-r--r--gdk/linux-fb/gdkmain-fb.c1
2 files changed, 42 insertions, 0 deletions
diff --git a/gdk/linux-fb/gdkinput-ps2.c b/gdk/linux-fb/gdkinput-ps2.c
index 1e96eabdef..38f6872bab 100644
--- a/gdk/linux-fb/gdkinput-ps2.c
+++ b/gdk/linux-fb/gdkinput-ps2.c
@@ -35,6 +35,10 @@
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#include <linux/fb.h>
+
+/* Two minutes */
+#define BLANKING_TIMEOUT 120*1000
/*
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
@@ -64,6 +68,8 @@ typedef struct {
gboolean caps_lock : 1;
} Keyboard;
+static guint blanking_timer = 0;
+
static Keyboard * tty_keyboard_open(void);
static guint keyboard_get_state(Keyboard *k);
@@ -73,6 +79,37 @@ static Keyboard *keyboard = NULL;
static guint multiclick_tag;
static GdkEvent *multiclick_event = NULL;
+#ifndef VESA_NO_BLANKING
+#define VESA_NO_BLANKING 0
+#define VESA_VSYNC_SUSPEND 1
+#define VESA_HSYNC_SUSPEND 2
+#define VESA_POWERDOWN 3
+#endif
+
+#if 0
+static gboolean
+input_activity_timeout(gpointer p)
+{
+ blanking_timer = 0;
+ ioctl(gdk_display->fd, FBIOBLANK, VESA_POWERDOWN);
+ return FALSE;
+}
+#endif
+
+/* This is all very broken :( */
+static void
+input_activity(void)
+{
+#if 0
+ if(blanking_timer)
+ g_source_remove(blanking_timer);
+ else
+ gdk_fb_redraw_all();
+
+ blanking_timer = g_timeout_add(BLANKING_TIMEOUT, input_activity_timeout, NULL);
+#endif
+}
+
static gboolean
click_event_timeout(gpointer x)
{
@@ -569,6 +606,8 @@ handle_mouse_input(MouseDevice *mouse, gboolean got_motion)
gdk_window_unref(mouse->prev_window);
mouse->prev_window = gdk_window_ref(win);
}
+
+ input_activity();
}
static gboolean
@@ -1381,6 +1420,8 @@ handle_keyboard_input(GIOChannel *gioc, GIOCondition cond, gpointer data)
}
}
+ input_activity();
+
return TRUE;
}
diff --git a/gdk/linux-fb/gdkmain-fb.c b/gdk/linux-fb/gdkmain-fb.c
index c81088fd71..ea1db80b57 100644
--- a/gdk/linux-fb/gdkmain-fb.c
+++ b/gdk/linux-fb/gdkmain-fb.c
@@ -72,6 +72,7 @@ gdk_fb_display_new(const char *filename)
retval = g_new0(GdkFBDisplay, 1);
retval->fd = fd;
+ ioctl(retval->fd, FBIOBLANK, 0);
n = ioctl(fd, FBIOGET_FSCREENINFO, &retval->sinfo);
n |= ioctl(fd, FBIOGET_VSCREENINFO, &retval->modeinfo);
g_assert(!n);