[Xcb] newbie help

Michael Grunditz michael.grunditz at gmail.com
Sat Oct 25 01:21:38 PDT 2008


2008/10/25 Michael Grunditz <michael.grunditz at gmail.com>:
> Hi
>
> I am evaluating xcb , and have some probably stupid questions:
>
> 1) I have tried to use xcb_image_create_from_bitmap_data in my test
> programs , but it won't compile I get undefined reference. I have the
> relevant includes.

Update , I didn't see that it was "ld" that complains. I link with
-lxcb-image , is there somthing else I need ?

>
> 2) I have extended the example wm in util. I have added window
> dragging and a simple close gadget.
> The problem with dragging is that the mouse pointer moves to the
> window xy position after the button is released.
> The close button works , but only if I move the window after I pressed it .
> some source:
>
> ---moving--
> static int handleMotionNotifyEvent(void *data, xcb_connection_t *c,
> xcb_motion_notify_event_t *e)
> {
>  uint32_t values[2];
>      values[0] = e->root_x;
>      values[1] = e->root_y;
>      xcb_configure_window(c, e->event, XCB_CONFIG_WINDOW_X |
> XCB_CONFIG_WINDOW_Y, values);
>
>
>      xcb_flush(c);
>  return 1;
> }
>
> ----closing---
>
> static int handleButtonPressEvent(void *data, xcb_connection_t *c,
> xcb_button_press_event_t *e)
> {
> if (e->event_x>2 && e->event_x < 12 && e->event_y>2 && e->event_y<12)
>            {
>
>              xcb_unmap_window(c,e->event);
>            }
>
>        return 1;
> }
> -----------------------------------------------------------------------
>
> Btw is there a simple way to kill the unmanaged child when unmaping the window ?
>
> Best regards
>
> Michael Grunditz
>


More information about the Xcb mailing list