summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2004-04-30 19:55:10 +0000
committerKeith Packard <keithp@keithp.com>2004-04-30 19:55:10 +0000
commitdb0e7e6ce278640503ac6443ee161f561748ed64 (patch)
treeac8e4a20a3240835c1bfce8f0be246fbd40fc5f9
parent489c9e9bc5a70fc2f1d594ef805c2ec4a1447227 (diff)
oops. Make the shm segment writable
-rw-r--r--ChangeLog5
-rw-r--r--lightpipe.c8
-rw-r--r--lpimage.c3
3 files changed, 11 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index e69de29..5ad5ec8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -0,0 +1,5 @@
+2004-04-30 Keith Packard <keithp@keithp.com>
+
+ * lightpipe.c: (main):
+ * lpimage.c: (create_window_image):
+ oops. Make the shm segment writable
diff --git a/lightpipe.c b/lightpipe.c
index 1c6deae..38b8190 100644
--- a/lightpipe.c
+++ b/lightpipe.c
@@ -38,7 +38,7 @@ main (int argc, char **argv)
Window new = 0;
int new_width, new_height;
XLightPipeWindow *lpw;
- GC gc;
+ GC new_gc;
if (argc != 4)
{
@@ -49,10 +49,8 @@ main (int argc, char **argv)
display = XOpenDisplay (argv[1]);
window = strtol (argv[2], 0, 0);
- new_display = XOpenDisplay (argv[3]);
XLightPipeInit ();
XLightPipeAttendWindow (display, window);
- gc = XCreateGC (new_display, RootWindow (new_display, DefaultScreen (new_display)), 0, 0);
for (;;)
{
lpw = XLightPipeCheckWindow (display, window, True);
@@ -62,11 +60,13 @@ main (int argc, char **argv)
XSizeHints *normalhints;
XClassHint *classhint;
char *name = "lightpipe";
+ new_display = XOpenDisplay (argv[3]);
new = XCreateSimpleWindow (new_display, RootWindow (new_display,
DefaultScreen (new_display)),
0, 0, lpw->geometry.width,
lpw->geometry.height,
0, 0, 0);
+ new_gc = XCreateGC (new_display, new, 0, 0);
normalhints = XAllocSizeHints ();
normalhints->flags = 0;
normalhints->x = 0;
@@ -101,7 +101,7 @@ main (int argc, char **argv)
}
printf ("%dx%d+%d+%d\n",
lpw->damage.width, lpw->damage.height, lpw->damage.x, lpw->damage.y);
- XPutImage (new_display, new, gc, lpw->image,
+ XPutImage (new_display, new, new_gc, lpw->image,
lpw->damage.x, lpw->damage.y,
lpw->damage.x, lpw->damage.y,
lpw->damage.width,
diff --git a/lpimage.c b/lpimage.c
index f797b6c..b4936e0 100644
--- a/lpimage.c
+++ b/lpimage.c
@@ -42,7 +42,7 @@ create_window_image (light_pipe_window *lpw)
0);
if (!lpw->public.image)
return False;
- image_size = (lpw->public.image->bytes_per_line *
+ image_size = (lpw->public.image->bytes_per_line *
lpw->public.geometry.height);
if (!image_size)
{
@@ -64,6 +64,7 @@ create_window_image (light_pipe_window *lpw)
shmctl (lpw->shm_info.shmid, IPC_RMID, 0);
return False;
}
+ lpw->shm_info.readOnly = False;
XShmAttach (lpw->display, &lpw->shm_info);
lpw->public.image->data = lpw->shm_info.shmaddr;
lpw->public.image->obdata = (char *) &lpw->shm_info;