mirror of
https://github.com/gryf/wmaker.git
synced 2026-02-02 22:25:48 +01:00
Bug fixes for 0.20.3 pre-release 2
This commit is contained in:
@@ -35,21 +35,23 @@ libwraster_a_SOURCES = \
|
||||
|
||||
INCLUDES = @DFLAGS@ @XCFLAGS@ @GFXFLAGS@ @XSHM@
|
||||
|
||||
LIBLIST = -L. -lwraster @GFXLFLAGS@ @XLFLAGS@ @GFXLIBS@ @XLIBS@ -lm
|
||||
|
||||
view_SOURCES= view.c
|
||||
|
||||
view_LDADD = -L. -lwraster @XLFLAGS@ @GFXLIBS@ @XLIBS@ -lm
|
||||
view_LDADD = $(LIBLIST)
|
||||
|
||||
test_SOURCES = test.c
|
||||
|
||||
test_LDADD = -L. -lwraster @XLFLAGS@ @GFXLIBS@ @XLIBS@ -lm
|
||||
test_LDADD = $(LIBLIST)
|
||||
|
||||
testgrad_SOURCES = testgrad.c
|
||||
|
||||
testgrad_LDADD = -L. -lwraster @XLFLAGS@ @GFXLIBS@ @XLIBS@ -lm
|
||||
testgrad_LDADD = $(LIBLIST)
|
||||
|
||||
testdraw_SOURCES = testdraw.c
|
||||
|
||||
testdraw_LDADD = -L. -lwraster @XLFLAGS@ @GFXLIBS@ @XLIBS@ -lm
|
||||
testdraw_LDADD = $(LIBLIST)
|
||||
|
||||
|
||||
libwraster_a_LIBADD = @ALLOCA@
|
||||
|
||||
@@ -63,6 +63,7 @@ CC = @CC@
|
||||
CPP_PATH = @CPP_PATH@
|
||||
DFLAGS = @DFLAGS@
|
||||
GFXFLAGS = @GFXFLAGS@
|
||||
GFXLFLAGS = @GFXLFLAGS@
|
||||
GFXLIBS = @GFXLIBS@
|
||||
I18N = @I18N@
|
||||
I18N_MB = @I18N_MB@
|
||||
@@ -123,21 +124,23 @@ libwraster_a_SOURCES = \
|
||||
|
||||
INCLUDES = @DFLAGS@ @XCFLAGS@ @GFXFLAGS@ @XSHM@
|
||||
|
||||
LIBLIST = -L. -lwraster @GFXLFLAGS@ @XLFLAGS@ @GFXLIBS@ @XLIBS@ -lm
|
||||
|
||||
view_SOURCES= view.c
|
||||
|
||||
view_LDADD = -L. -lwraster @XLFLAGS@ @GFXLIBS@ @XLIBS@ -lm
|
||||
view_LDADD = $(LIBLIST)
|
||||
|
||||
test_SOURCES = test.c
|
||||
|
||||
test_LDADD = -L. -lwraster @XLFLAGS@ @GFXLIBS@ @XLIBS@ -lm
|
||||
test_LDADD = $(LIBLIST)
|
||||
|
||||
testgrad_SOURCES = testgrad.c
|
||||
|
||||
testgrad_LDADD = -L. -lwraster @XLFLAGS@ @GFXLIBS@ @XLIBS@ -lm
|
||||
testgrad_LDADD = $(LIBLIST)
|
||||
|
||||
testdraw_SOURCES = testdraw.c
|
||||
|
||||
testdraw_LDADD = -L. -lwraster @XLFLAGS@ @GFXLIBS@ @XLIBS@ -lm
|
||||
testdraw_LDADD = $(LIBLIST)
|
||||
|
||||
libwraster_a_LIBADD = @ALLOCA@
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
|
||||
@@ -494,8 +494,16 @@ RCreateContext(Display *dpy, int screen_number, RContextAttributes *attribs)
|
||||
}
|
||||
|
||||
if (context->attribs->use_shared_memory) {
|
||||
if (!XShmQueryExtension(context->dpy)) {
|
||||
int major, minor;
|
||||
Bool sharedPixmaps;
|
||||
|
||||
context->flags.use_shared_pixmap = 0;
|
||||
|
||||
if (!XShmQueryVersion(context->dpy, &major, &minor, &sharedPixmaps)) {
|
||||
context->attribs->use_shared_memory = False;
|
||||
} else {
|
||||
if (XShmPixmapFormat(context->dpy)==ZPixmap)
|
||||
context->flags.use_shared_pixmap = sharedPixmaps;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -613,7 +613,10 @@ RConvertImage(RContext *context, RImage *image, Pixmap *pixmap)
|
||||
image->height, context->depth);
|
||||
|
||||
#ifdef XSHM
|
||||
tmp = R_CreateXImageMappedPixmap(context, ximg);
|
||||
if (context->flags.use_shared_pixmap)
|
||||
tmp = R_CreateXImageMappedPixmap(context, ximg);
|
||||
else
|
||||
tmp = None;
|
||||
if (tmp) {
|
||||
/*
|
||||
* We have to copy the shm Pixmap into a normal Pixmap because
|
||||
|
||||
@@ -203,6 +203,5 @@ void main(int argc, char **argv)
|
||||
|
||||
XFlush(dpy);
|
||||
#endif
|
||||
|
||||
getchar();
|
||||
}
|
||||
|
||||
@@ -114,6 +114,10 @@ typedef struct RContext {
|
||||
/* only used for pseudocolor and grayscale */
|
||||
int ncolors; /* total number of colors we can use */
|
||||
XColor *colors; /* internal colormap */
|
||||
|
||||
struct {
|
||||
unsigned int use_shared_pixmap:1;
|
||||
} flags;
|
||||
} RContext;
|
||||
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@ RCreateXImage(RContext *context, int depth, unsigned width, unsigned height)
|
||||
}
|
||||
|
||||
rximg->info.shmaddr = shmat(rximg->info.shmid, 0, 0);
|
||||
if ((int)rximg->info.shmaddr < 0) {
|
||||
if (rximg->info.shmaddr == (void*)-1) {
|
||||
context->attribs->use_shared_memory = 0;
|
||||
if (shmctl(rximg->info.shmid, IPC_RMID, 0) < 0)
|
||||
perror("wrlib:shmctl");
|
||||
@@ -217,3 +217,4 @@ R_CreateXImageMappedPixmap(RContext *context, RXImage *rximage)
|
||||
}
|
||||
|
||||
#endif /* XSHM */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user