Xnest: replace XCreateBitmapFromData() by xcb_put_image()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
parent
c79c0dca06
commit
83c65b3ed8
|
@ -180,7 +180,7 @@ xnestOpenDisplay(int argc, char *argv[])
|
||||||
xnestBorderWidth = 1;
|
xnestBorderWidth = 1;
|
||||||
|
|
||||||
xnestIconBitmap =
|
xnestIconBitmap =
|
||||||
XCreateBitmapFromData(xnestDisplay,
|
xnest_create_bitmap_from_data(xnestUpstreamInfo.conn,
|
||||||
xnestUpstreamInfo.screenInfo->root,
|
xnestUpstreamInfo.screenInfo->root,
|
||||||
(char *) icon_bits, icon_width, icon_height);
|
(char *) icon_bits, icon_width, icon_height);
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
#include <X11/Xproto.h>
|
#include <X11/Xproto.h>
|
||||||
|
|
||||||
#include "include/gc.h"
|
#include "include/gc.h"
|
||||||
|
#include "include/servermd.h"
|
||||||
|
|
||||||
#include "Xnest.h"
|
#include "Xnest.h"
|
||||||
#include "xnest-xcb.h"
|
#include "xnest-xcb.h"
|
||||||
|
@ -72,3 +73,35 @@ void xnest_wm_colormap_windows(
|
||||||
|
|
||||||
free(reply);
|
free(reply);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32_t xnest_create_bitmap_from_data(
|
||||||
|
xcb_connection_t *conn,
|
||||||
|
uint32_t drawable,
|
||||||
|
const char *data,
|
||||||
|
uint32_t width,
|
||||||
|
uint32_t height)
|
||||||
|
{
|
||||||
|
uint32_t pix = xcb_generate_id(xnestUpstreamInfo.conn);
|
||||||
|
xcb_create_pixmap(conn, 1, pix, drawable, width, height);
|
||||||
|
|
||||||
|
uint32_t gc = xcb_generate_id(xnestUpstreamInfo.conn);
|
||||||
|
xcb_create_gc(conn, gc, pix, 0, NULL);
|
||||||
|
|
||||||
|
const int leftPad = 0;
|
||||||
|
|
||||||
|
xcb_put_image(conn,
|
||||||
|
XYPixmap,
|
||||||
|
pix,
|
||||||
|
gc,
|
||||||
|
width,
|
||||||
|
height,
|
||||||
|
0 /* dst_x */,
|
||||||
|
0 /* dst_y */,
|
||||||
|
leftPad,
|
||||||
|
1 /* depth */,
|
||||||
|
BitmapBytePad(width + leftPad) * height,
|
||||||
|
(uint8_t*)data);
|
||||||
|
|
||||||
|
xcb_free_gc(conn, gc);
|
||||||
|
return pix;
|
||||||
|
}
|
||||||
|
|
|
@ -25,4 +25,7 @@ uint32_t xnest_upstream_gc(GCPtr pGC);
|
||||||
void xnest_wm_colormap_windows(xcb_connection_t *conn, xcb_window_t w,
|
void xnest_wm_colormap_windows(xcb_connection_t *conn, xcb_window_t w,
|
||||||
xcb_window_t *windows, int count);
|
xcb_window_t *windows, int count);
|
||||||
|
|
||||||
|
uint32_t xnest_create_bitmap_from_data(xcb_connection_t *conn, uint32_t drawable,
|
||||||
|
const char *data, uint32_t width, uint32_t height);
|
||||||
|
|
||||||
#endif /* __XNEST__XCB_H */
|
#endif /* __XNEST__XCB_H */
|
||||||
|
|
Loading…
Reference in New Issue