summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Plattner <aplattner@nvidia.com>2011-08-01 11:36:56 -0700
committerAaron Plattner <aplattner@nvidia.com>2011-08-01 14:34:18 -0700
commit0ab156f5b9d812ad9e94354e4e04490ed119eb1f (patch)
treea4b3eb0d708ae0495e8b7f937a910124020f4d37
parenta30927f9b4279e2404f4deea2e3966364d5f0fd0 (diff)
Use the right screen from $DISPLAY
RootWindow(dpy, 0) always uses screen 0, even if a different screen is specified in the $DISPLAY environment variable. Use DefaultRootWindow(dpy) instead to use the right one. Signed-off-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
-rw-r--r--main.c4
-rw-r--r--t_bug7366.c2
-rw-r--r--t_repeat.c2
-rw-r--r--t_srccoords.c2
-rw-r--r--t_tsrccoords.c2
-rw-r--r--t_tsrccoords2.c2
-rw-r--r--tests.c12
7 files changed, 13 insertions, 13 deletions
diff --git a/main.c b/main.c
index e261c78..5190c49 100644
--- a/main.c
+++ b/main.c
@@ -289,8 +289,8 @@ int main(int argc, char **argv)
num_ops = PictOpSaturate;
}
- window.d = XCreateSimpleWindow(dpy, RootWindow(dpy, 0), 0, 0, win_width,
- win_height, 0, 0, WhitePixel(dpy, 0));
+ window.d = XCreateSimpleWindow(dpy, DefaultRootWindow(dpy), 0, 0,
+ win_width, win_height, 0, 0, WhitePixel(dpy, 0));
as.override_redirect = True;
XChangeWindowAttributes(dpy, window.d, CWOverrideRedirect, &as);
diff --git a/t_bug7366.c b/t_bug7366.c
index 1277580..34ac004 100644
--- a/t_bug7366.c
+++ b/t_bug7366.c
@@ -69,7 +69,7 @@ bug7366_test_set_alpha_map(Display *dpy)
memset(&color, 0, sizeof(color));
source_pict = XRenderCreateSolidFill(dpy, &color);
- pixmap = XCreatePixmap(dpy, RootWindow(dpy, 0), 1, 1, 32);
+ pixmap = XCreatePixmap(dpy, DefaultRootWindow(dpy), 1, 1, 32);
pict = XRenderCreatePicture(dpy, pixmap,
XRenderFindStandardFormat(dpy, PictStandardARGB32), 0, NULL);
diff --git a/t_repeat.c b/t_repeat.c
index 4e26136..679bca1 100644
--- a/t_repeat.c
+++ b/t_repeat.c
@@ -69,7 +69,7 @@ repeat_test(Display *dpy, picture_info *win, picture_info *dst, int op,
pa.component_alpha = test_mask;
pa.repeat = TRUE;
- src.d = XCreatePixmap(dpy, RootWindow(dpy, 0), w, h, 32);
+ src.d = XCreatePixmap(dpy, DefaultRootWindow(dpy), w, h, 32);
src.format = XRenderFindStandardFormat(dpy, PictStandardARGB32);
src.pict = XRenderCreatePicture(dpy, src.d, src.format,
CPComponentAlpha | CPRepeat, &pa);
diff --git a/t_srccoords.c b/t_srccoords.c
index 6aff6d5..6e29e8a 100644
--- a/t_srccoords.c
+++ b/t_srccoords.c
@@ -43,7 +43,7 @@ static picture_info *create_target_picture(Display *dpy)
p = malloc(sizeof(picture_info));
- p->d = XCreatePixmap(dpy, RootWindow(dpy, 0), 5, 5, 32);
+ p->d = XCreatePixmap(dpy, DefaultRootWindow(dpy), 5, 5, 32);
p->format = XRenderFindStandardFormat(dpy, PictStandardARGB32);
p->pict = XRenderCreatePicture(dpy, p->d, p->format, 0, NULL);
p->name = "target picture";
diff --git a/t_tsrccoords.c b/t_tsrccoords.c
index 124fdc9..279591d 100644
--- a/t_tsrccoords.c
+++ b/t_tsrccoords.c
@@ -43,7 +43,7 @@ static picture_info *create_dot_picture(Display *dpy)
p = malloc(sizeof(picture_info));
- p->d = XCreatePixmap(dpy, RootWindow(dpy, 0), 5, 5, 32);
+ p->d = XCreatePixmap(dpy, DefaultRootWindow(dpy), 5, 5, 32);
p->format = XRenderFindStandardFormat(dpy, PictStandardARGB32);
p->pict = XRenderCreatePicture(dpy, p->d, p->format, 0, NULL);
p->name = "dot picture";
diff --git a/t_tsrccoords2.c b/t_tsrccoords2.c
index 4449dca..0d83fd5 100644
--- a/t_tsrccoords2.c
+++ b/t_tsrccoords2.c
@@ -43,7 +43,7 @@ static picture_info *create_target_picture(Display *dpy)
p = malloc(sizeof(picture_info));
- p->d = XCreatePixmap(dpy, RootWindow(dpy, 0), 5, 5, 32);
+ p->d = XCreatePixmap(dpy, DefaultRootWindow(dpy), 5, 5, 32);
p->format = XRenderFindStandardFormat(dpy, PictStandardARGB32);
p->pict = XRenderCreatePicture(dpy, p->d, p->format, 0, NULL);
p->name = "target picture";
diff --git a/tests.c b/tests.c
index def1bf5..aacd14d 100644
--- a/tests.c
+++ b/tests.c
@@ -337,7 +337,7 @@ do_tests(Display *dpy, picture_info *win)
for (i = 0; i < num_dests; i++) {
dests[i].format = format_list[i];
- dests[i].d = XCreatePixmap(dpy, RootWindow(dpy, 0),
+ dests[i].d = XCreatePixmap(dpy, DefaultRootWindow(dpy),
win_width, win_height, dests[i].format->depth);
dests[i].pict = XRenderCreatePicture(dpy, dests[i].d,
dests[i].format, 0, NULL);
@@ -359,8 +359,8 @@ do_tests(Display *dpy, picture_info *win)
/* The standard PictFormat numbers go from 0 to 4 */
pictures_1x1[i].format = format_list[i % nformats];
- pictures_1x1[i].d = XCreatePixmap(dpy, RootWindow(dpy, 0), 1,
- 1, pictures_1x1[i].format->depth);
+ pictures_1x1[i].d = XCreatePixmap(dpy, DefaultRootWindow(dpy),
+ 1, 1, pictures_1x1[i].format->depth);
pa.repeat = TRUE;
pictures_1x1[i].pict = XRenderCreatePicture(dpy,
pictures_1x1[i].d, pictures_1x1[i].format, CPRepeat, &pa);
@@ -395,8 +395,8 @@ do_tests(Display *dpy, picture_info *win)
/* The standard PictFormat numbers go from 0 to 4 */
pictures_10x10[i].format = format_list[i % nformats];
- pictures_10x10[i].d = XCreatePixmap(dpy, RootWindow(dpy, 0), 10,
- 10, pictures_10x10[i].format->depth);
+ pictures_10x10[i].d = XCreatePixmap(dpy, DefaultRootWindow(dpy),
+ 10, 10, pictures_10x10[i].format->depth);
pa.repeat = TRUE;
pictures_10x10[i].pict = XRenderCreatePicture(dpy,
pictures_10x10[i].d, pictures_10x10[i].format, 0, NULL);
@@ -416,7 +416,7 @@ do_tests(Display *dpy, picture_info *win)
color_correct(&pictures_10x10[i], &pictures_10x10[i].color);
}
- picture_3x3.d = XCreatePixmap(dpy, RootWindow(dpy, 0), 3, 3, 32);
+ picture_3x3.d = XCreatePixmap(dpy, DefaultRootWindow(dpy), 3, 3, 32);
picture_3x3.format = XRenderFindStandardFormat(dpy, PictStandardARGB32);
picture_3x3.pict = XRenderCreatePicture(dpy, picture_3x3.d,
picture_3x3.format, 0, NULL);