summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2004-08-07 01:43:35 +0000
committerKeith Packard <keithp@keithp.com>2004-08-07 01:43:35 +0000
commit7c3bd23a9276882ed2ef83a293ac1796a6a374fe (patch)
tree087083fd3cce7a97b23c5243790109cedcba12f9
parent5520bc18f910664c421a1991191fb1c3290491a0 (diff)
Don't insist on Composite support; things will kinda work without it, and
the 'root' option works perfectly.
-rw-r--r--ChangeLog9
-rw-r--r--lightpipe.c5
-rw-r--r--lpdisplay.c11
-rw-r--r--lpinit.c4
-rw-r--r--lpint.h1
5 files changed, 26 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 9a36afa..a16925a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2004-08-06 Keith Packard <keithp@keithp.com>
+
+ * lightpipe.c: (main):
+ * lpdisplay.c: (init_display), (_xlightpipe_find_display):
+ * lpinit.c: (_xlightpipe_init_window):
+ * lpint.h:
+ Don't insist on Composite support; things will kinda work without it,
+ and the 'root' option works perfectly.
+
2004-06-01 Keith Packard <keithp@keithp.com>
reviewed by: <delete if not using a buddy>
diff --git a/lightpipe.c b/lightpipe.c
index 8ddb04b..d7ad270 100644
--- a/lightpipe.c
+++ b/lightpipe.c
@@ -54,6 +54,11 @@ main (int argc, char **argv)
}
display = XOpenDisplay (argv[1]);
+ if (!display)
+ {
+ fprintf (stderr, "can't open display %s\n", argv[1]);
+ exit (1);
+ }
if (!strcmp (argv[2], "root"))
window = RootWindow (display, 0);
else
diff --git a/lpdisplay.c b/lpdisplay.c
index 31b6ae1..a5f66e2 100644
--- a/lpdisplay.c
+++ b/lpdisplay.c
@@ -35,10 +35,12 @@ init_display (light_pipe_display *lpd)
&lpd->damage.event_base,
&lpd->damage.error_base))
return False;
- if (!XCompositeQueryExtension (lpd->display,
- &lpd->composite.event_base,
- &lpd->composite.error_base))
- return False;
+ if (XCompositeQueryExtension (lpd->display,
+ &lpd->composite.event_base,
+ &lpd->composite.error_base))
+ {
+ lpd->has_composite = 1;
+ }
return True;
}
@@ -54,6 +56,7 @@ _xlightpipe_find_display (Display *display)
return 0;
lpd->display = display;
lpd->damaged = 0;
+ lpd->has_composite = 0;
if (!init_display (lpd))
{
free (lpd);
diff --git a/lpinit.c b/lpinit.c
index 32c788b..5c55b88 100644
--- a/lpinit.c
+++ b/lpinit.c
@@ -39,6 +39,10 @@ Bool
_xlightpipe_init_window (Display *display, Window window, light_pipe_window *lpw)
{
XWindowAttributes attr;
+ light_pipe_display *lpd = _xlightpipe_find_display (display);
+
+ if (!lpd)
+ return False;
lpw->display = display;
lpw->window = window;
diff --git a/lpint.h b/lpint.h
index db85c62..e08f273 100644
--- a/lpint.h
+++ b/lpint.h
@@ -59,6 +59,7 @@ typedef struct _light_pipe_display {
light_pipe_window *damaged;
light_pipe_extension xfixes;
light_pipe_extension damage;
+ int has_composite;
light_pipe_extension composite;
} light_pipe_display;