Subject:
Re: nano-X needs window manager to run on X11 ?
From:
Tomasz Motylewski ####@####.####
Date:
13 Mar 2001 13:24:08 -0000
Message-Id: <Pine.LNX.3.96.1010313142215.24720B-100000@linserv.intern.bfad.de>
OK, it stops on XMaskEvent(x11_dpy, x11_event_mask, &ev) in X11_open
I have added BARE_X11 configuration option and it works. See the following
patch. It will need of course to be cleaned - lots of debugging added.
Best regards,
--
Tomasz Motylewski
http://www.bfad.de/
diff -urN microwindows-0.89pre7-libc5-latin1/src/Makefile.rules microwindows-0.89pre7-libc5-latin1-nowm/src/Makefile.rules
--- microwindows-0.89pre7-libc5-latin1/src/Makefile.rules Sat Dec 9 02:04:59 2000
+++ microwindows-0.89pre7-libc5-latin1-nowm/src/Makefile.rules Tue Mar 13 11:42:03 2001
@@ -38,6 +38,10 @@
LDFLAGS += -L/usr/X11R6/lib -lX11
endif
+ifeq ($(BARE_X11), Y)
+CFLAGS += -DBARE_X11
+endif
+
ifeq ($(VGALIB), Y)
LDFLAGS += -lvga
endif
diff -urN microwindows-0.89pre7-libc5-latin1/src/config microwindows-0.89pre7-libc5-latin1-nowm/src/config
--- microwindows-0.89pre7-libc5-latin1/src/config Mon Jan 22 05:11:07 2001
+++ microwindows-0.89pre7-libc5-latin1-nowm/src/config Tue Mar 13 11:42:48 2001
@@ -210,14 +210,15 @@
ifneq ($(ARCH), ELKS)
# X Window screen, mouse and kbd drivers
-X11 = N
+X11 = Y
ifeq ($(X11), Y)
# predefined model or select screen width, height, depth(palette mode only)
SCREEN_E15 = N
SCREEN_WIDTH = 640
SCREEN_HEIGHT = 480
-SCREEN_DEPTH = 4
+SCREEN_DEPTH = 8
+BARE_X11 = Y
# You may want to turn this on for XFree86 4.x or if your backing store
# isn't functioning properly
diff -urN microwindows-0.89pre7-libc5-latin1/src/drivers/scr_x11.c microwindows-0.89pre7-libc5-latin1-nowm/src/drivers/scr_x11.c
--- microwindows-0.89pre7-libc5-latin1/src/drivers/scr_x11.c Mon Jan 15 06:27:27 2001
+++ microwindows-0.89pre7-libc5-latin1-nowm/src/drivers/scr_x11.c Tue Mar 13 11:40:40 2001
@@ -354,6 +354,7 @@
void x11_handle_event(XEvent* ev)
{
static int inited = 0;
+ DPRINTF("x11_handle_event: %d\n",ev->type);
if (ev->type == ColormapNotify) {
if (ev->xcolormap.window == x11_win) {
@@ -368,6 +369,7 @@
}
}
else if (ev->type == FocusIn) {
+ DPRINTF("FocusIn\n");
if (!x11_colormap_installed) {
DPRINTF("setting colormap\n");
XInstallColormap(x11_dpy, x11_colormap);
@@ -468,12 +470,23 @@
set_mode(gr_mode);
+ DPRINTF("setup done\n");
setup_needed = 0;
return 0;
}
return 0;
}
+#ifdef BARE_X11
+#define X_CREATE_OFFSET 0
+#define Y_CREATE_OFFSET 0
+#define BORDER_X_WIN 0
+#else
+#define X_CREATE_OFFSET 100
+#define Y_CREATE_OFFSET 100
+#define BORDER_X_WIN 2
+#endif
+
/* Note: only single screen */
static PSD
X11_open(PSD psd)
@@ -488,8 +501,10 @@
PSUBDRIVER subdriver;
int size, linelen;
+ DPRINTF("X11_open 0\n");
if (x11_setup_display() < 0)
return NULL;
+ DPRINTF("X11_open setup OK\n");
x11_event_mask = ColormapChangeMask | FocusChangeMask;
/*x11_event_mask |= EnterWindowMask | LeaveWindowMask;*/
@@ -518,11 +533,11 @@
x11_win = XCreateWindow(x11_dpy,
XDefaultRootWindow(x11_dpy),
- 100, /* x */
- 100, /* y */
+ X_CREATE_OFFSET, /* x */
+ Y_CREATE_OFFSET, /* y */
SCREEN_WIDTH, /* width */
SCREEN_HEIGHT, /* height */
- 2, /* border */
+ BORDER_X_WIN, /* border */
CopyFromParent, /* depth */
CopyFromParent, /* depth */
x11_vis, /* Visual */
@@ -559,14 +574,21 @@
XMapWindow(x11_dpy, x11_win);
XFlush(x11_dpy);
+ DPRINTF("X11_open after XFlush1\n");
+
/*
* The following code insures that the colormap
* is installed before display
*/
+#ifndef BARE_X11
XMaskEvent(x11_dpy, x11_event_mask, &ev);
+ DPRINTF("X11_open after XMaskEvent\n");
XPutBackEvent(x11_dpy, &ev);
+ DPRINTF("X11_open after XPutBackEvent\n");
+#endif
XInstallColormap(x11_dpy, x11_colormap);
+ DPRINTF("X11_open after XInstallColormap\n");
psd->xres = psd->xvirtres = SCREEN_WIDTH;
psd->yres = psd->yvirtres = SCREEN_HEIGHT;
@@ -619,6 +641,7 @@
/* set X11 psd to savebits memaddr for screen->offscreen blits...*/
psd->addr = savebits.addr;
+ DPRINTF("returning %d from X11_open\n");
return psd;
}