summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSøren Sandmann Pedersen <ssp@l3000.localdomain>2011-12-08 03:09:35 -0500
committerSøren Sandmann Pedersen <ssp@l3000.localdomain>2011-12-08 03:09:35 -0500
commite692e88e33a61645ce073e19fabecd5981eec434 (patch)
treed44b30bacff74badec6ed90bcc61a1a8e18ae070
parent388ca819efa64a12e28250b6fca3b83d2b30c9fa (diff)
gradient and gravity
-rw-r--r--main.c10
-rw-r--r--window.c5
2 files changed, 13 insertions, 2 deletions
diff --git a/main.c b/main.c
index 43bfb89..c76ebd2 100644
--- a/main.c
+++ b/main.c
@@ -31,6 +31,14 @@ main ()
while (1)
{
pixman_color_t color = { 0xffff, 0xabcd, 0x7777, 0xaaaa };
+ pixman_point_fixed_t p1 = { 0, 0 };
+ pixman_point_fixed_t p2 = { ws_window_get_width (window) << 16,
+ ws_window_get_height (window) << 16 };
+ pixman_gradient_stop_t stops[2] =
+ {
+ { pixman_int_to_fixed (0), { 0x2222, 0xeeee, 0xeeee, 0xeeee } },
+ { pixman_int_to_fixed (1), { 0xffff, 0x1111, 0x1111, 0x1111 } }
+ };
int fd = ws_get_fd (ws);
FD_ZERO (&set);
@@ -42,7 +50,7 @@ main ()
color.red = rand();
color.blue = rand();
- image = pixman_image_create_solid_fill (&color);
+ image = pixman_image_create_linear_gradient (&p1, &p2, stops, 2);
ws_window_copy_from_image (window, image, 0, 0, 0, 0,
ws_window_get_width (window),
ws_window_get_height (window));
diff --git a/window.c b/window.c
index 8717cbe..a595f11 100644
--- a/window.c
+++ b/window.c
@@ -290,6 +290,7 @@ update_local_geometry (window_t *window, int x, int y, int width, int height)
if (width != old_width || height != old_height)
{
+ printf ("resizing\n");
pixman_image_t *new_backing =
pixman_image_create_bits (
window->ws->format, width, height, NULL, -1);
@@ -368,6 +369,7 @@ process_expose (ws_t *ws, const XEvent *event)
{
window_t *window;
+ printf ("expose\n");
if (!(window = find_window (ws, event->xexpose.window)))
return;
@@ -416,6 +418,7 @@ ws_create_window (ws_t *ws,
attr.colormap = ws->colormap;
attr.background_pixel = 0;
attr.border_pixel = 0;
+ attr.bit_gravity = NorthWestGravity;
#if 0
printf ("%d %x %x %x %x %x\n", ws->depth, ws->visual->red_mask, ws->visual->green_mask, ws->visual->blue_mask, ws->visual->visualid, ws->colormap);
@@ -423,7 +426,7 @@ ws_create_window (ws_t *ws,
window->xid = XCreateWindow (
ws->display, root, x, y, width, height, 0,
ws->depth, InputOutput, ws->visual,
- CWBackPixel | CWBorderPixel | CWBackPixmap | CWColormap, &attr);
+ CWBitGravity | CWBackPixel | CWBorderPixel | CWBackPixmap | CWColormap, &attr);
window->ref_count = 1;
window->backing_store =