On Sat, Jun 18, 2005 at 01:42:51PM -0700, x nooby wrote:
>Hi David,
>
>> You can either set DefaultFontPath in your host.def
>> to change the compiled-in
>
>I got the Xvesa server working by specifying the
>correct font path inside the host.def.  The device is
>now able to initialize the VESA VGA screen, and
>display text and graphics properly.  Thanks for this
>help!
>
>The Xvesa server I built with the 4.5.0 sources seems
>to have one bug:  when I switch from X to the console
>using CTRL-ALT-F1, it hangs when I try to switch back
>to X using ALT-F5 (5 is the GUI session). 
>
>The screen displays the background window panes of the
>wxWidgets-based application, but it does not re-draw
>graphic images or text.  After it hangs, the video is
>locked up and the keyboad dies a few keystrokes later.
>
>I'm currently Googling for a solution, and trying some
>things.  For example, I just tried a completely stock
>host.def with no changes other than my fixed font path
>- but it still hung when I tried to come back from
>console mode.
>
>Any suggestions for making the Xvesa program survive
>going to console mode and back?

This can be fixed by setting the keyboard fd to non-blocking before
attempting to flush pending key strokes:


Index: linux/keyboard.c
===================================================================
RCS file: /home/x-cvs/xc/programs/Xserver/hw/tinyx/linux/keyboard.c,v
retrieving revision 1.1
diff -u -r1.1 keyboard.c
--- linux/keyboard.c    2 Jun 2004 22:43:01 -0000       1.1
+++ linux/keyboard.c    19 Jun 2005 00:38:16 -0000
@@ -77,6 +77,12 @@
 #include <termios.h>
 #include <sys/ioctl.h>
 
+#ifdef FNONBLOCK
+#define NOBLOCK FNONBLOCK
+#else
+#define NOBLOCK FNDELAY
+#endif
+
 extern int  LinuxConsoleFd;
 
 static const KeySym linux_to_x[256] = {
@@ -449,6 +455,7 @@
     struct termios nTty;
     unsigned char   buf[256];
     int                    n;
+    int                    flags;
 
     ioctl (fd, KDGKBMODE, &LinuxKbdTrans);
     tcgetattr (fd, &LinuxTermios);
@@ -467,6 +474,9 @@
     /*
      * Flush any pending keystrokes
      */
+    flags = fcntl (fd, F_GETFL);
+    flags |= NOBLOCK;
+    fcntl (fd, F_SETFL, flags);
     while ((n = read (fd, buf, sizeof (buf))) > 0)
        ;
     return fd;


David
-- 
David Dawes                                     X-Oz Technologies
www.XFree86.org/~dawes                          www.x-oz.com
_______________________________________________
XFree86 mailing list
[email protected]
http://XFree86.Org/mailman/listinfo/xfree86

Reply via email to