diff options
| author | Charles.Forsyth <devnull@localhost> | 2008-04-15 15:17:35 +0000 |
|---|---|---|
| committer | Charles.Forsyth <devnull@localhost> | 2008-04-15 15:17:35 +0000 |
| commit | 8ed08d8c468c352d02e6b5a6fe48fdfe4a565848 (patch) | |
| tree | 1f9e8510501bee763637e2e87eca3dd6a7fe6bcf | |
| parent | e8b3830bf1091c3930cc7f624b0e6cef5e588b67 (diff) | |
20080415-1617
| -rw-r--r-- | CHANGES | 1 | ||||
| -rw-r--r-- | emu/port/win-x11a.c | 17 |
2 files changed, 17 insertions, 1 deletions
@@ -1,6 +1,7 @@ 20080415 googlecode update with correct dis files for acme tidier code for hoststderr + emu/port/win-x11a.c changes that attempt to satisfy libxcb's locking requirements 20080322 enable hoststderr, following acme-sac 20080319 diff --git a/emu/port/win-x11a.c b/emu/port/win-x11a.c index 2f73d943..b9a3b545 100644 --- a/emu/port/win-x11a.c +++ b/emu/port/win-x11a.c @@ -10,6 +10,7 @@ */ #define _GNU_SOURCE 1 +#define XTHREADS #include "dat.h" #include "fns.h" #undef log2 @@ -463,6 +464,7 @@ xkbdproc(void *arg) /* BEWARE: the value of up is not defined for this proc on some systems */ + XLockDisplay(xd); /* should be ours alone */ XSelectInput(xd, xdrawable, KeyPressMask); for(;;){ XNextEvent(xd, &event); @@ -495,6 +497,7 @@ xproc(void *arg) ExposureMask| StructureNotifyMask; + XLockDisplay(xd); /* should be ours alone */ XSelectInput(xd, xdrawable, mask); for(;;){ XNextEvent(xd, &event); @@ -676,6 +679,7 @@ xinitscreen(int xsize, int ysize, ulong c, ulong *chan, int *d) dispname = getenv("DISPLAY"); if(dispname == nil) dispname = "not set"; + XInitThreads(); xdisplay = XOpenDisplay(NULL); if(xdisplay == 0){ fprint(2, "emu: win-x11 open %r, DISPLAY is %s\n", dispname); @@ -1414,12 +1418,23 @@ if(0) iprint("xselect target=%d requestor=%d property=%d selection=%d\n", char* clipread(void) { - return _xgetsnarf(xsnarfcon); + char *p; + + if(xsnarfcon == nil) + return nil; + XLockDisplay(xsnarfcon); + p = _xgetsnarf(xsnarfcon); + XUnlockDisplay(xsnarfcon); + return p; } int clipwrite(char *buf) { + if(xsnarfcon == nil) + return 0; + XLockDisplay(xsnarfcon); _xputsnarf(xsnarfcon, buf); + XUnlockDisplay(xsnarfcon); return 0; } |
