Ejemplo n.º 1
0
void shutdown_init() {

	xcb_void_cookie_t void_cookie;

	shutdown_win.surface=NULL;
	
	shutdown_win.window = xcb_generate_id(conn);
	uint32_t values[1] = {XCB_EVENT_MASK_EXPOSURE|XCB_EVENT_MASK_BUTTON_RELEASE};

	void_cookie=xcb_create_window_checked (conn,XCB_COPY_FROM_PARENT,shutdown_win.window,scr->root,0,height-1,width,1,0,XCB_WINDOW_CLASS_INPUT_OUTPUT,scr->root_visual,XCB_CW_EVENT_MASK,values);

	xcb_flush(conn);

	if (xcb_request_check(conn,void_cookie)) {
		printf("Can't create the shutdown window\n");
		shutdown_win.window = 0;
	} else {
		uint32_t v[4];
		uint32_t value_mask;

		value_mask=XCB_CONFIG_WINDOW_X|XCB_CONFIG_WINDOW_Y|XCB_CONFIG_WINDOW_WIDTH|XCB_CONFIG_WINDOW_HEIGHT;
		v[0]=width/4;;
		v[1]=height/4;
		v[2]=width/2;
		v[3]=height/2;
		shutdown_win.width=v[2];
		shutdown_win.height=v[3];
		xcb_configure_window(conn,shutdown_win.window,value_mask,v);
		xcb_change_property(conn,XCB_PROP_MODE_REPLACE,shutdown_win.window,atoms[TWM_ATOM__NET_WM_NAME],XCB_ATOM_STRING,8,strlen(TWM_NAME),TWM_NAME);
		xcb_change_property(conn,XCB_PROP_MODE_REPLACE,shutdown_win.window,atoms[TWM_ATOM__NET_WM_WINDOW_TYPE],XCB_ATOM_ATOM,32,1,&atoms[TWM_ATOM__NET_WM_WINDOW_TYPE_DOCK]);
		shutdown_win.cache=wincache_fill_element(shutdown_win.window);
		shutdown_win.cache->mapped=0;
		xcb_flush(conn);
		shutdown_win.surface=cairo_xcb_surface_create(conn,shutdown_win.window,visual_type,width/2,height/2);
		cairo_xcb_surface_set_size(shutdown_win.surface,v[2],v[3]);
		xcb_flush(conn);
	}
}
Ejemplo n.º 2
-1
void menuwin_init() {

	key_win.surface=cairo_xcb_surface_create(conn,key_win.window,visual_type,width,1);

	// Set the _NET_SUPPORTING_WM_CHECK property pointing to the window ID in both the root and fake windows
	// Also set the WM_NAME property in both windows to TWM_NAME
	xcb_change_property(conn,XCB_PROP_MODE_REPLACE,scr->root,atoms[TWM_ATOM__NET_SUPPORTING_WM_CHECK],XCB_ATOM_WINDOW,32,1,&key_win.window);
	xcb_change_property(conn,XCB_PROP_MODE_REPLACE,scr->root,atoms[TWM_ATOM__NET_WM_NAME],XCB_ATOM_STRING,8,strlen(TWM_NAME),TWM_NAME);
	xcb_change_property(conn,XCB_PROP_MODE_REPLACE,key_win.window,atoms[TWM_ATOM__NET_SUPPORTING_WM_CHECK],XCB_ATOM_WINDOW,32,1,&key_win.window);
	xcb_change_property(conn,XCB_PROP_MODE_REPLACE,key_win.window,atoms[TWM_ATOM__NET_WM_NAME],XCB_ATOM_STRING,8,strlen(TWM_NAME),TWM_NAME);
	xcb_change_property(conn,XCB_PROP_MODE_REPLACE,key_win.window,atoms[TWM_ATOM__NET_WM_WINDOW_TYPE],XCB_ATOM_ATOM,32,1,&atoms[TWM_ATOM__NET_WM_WINDOW_TYPE_DOCK]);
	xcb_map_window(conn,key_win.window);
	xcb_flush(conn);

	key_win.cache=wincache_fill_element(key_win.window);
	key_win.cache->mapped=1;
	key_win.possition=0;
	key_win.has_keyboard=0;
	key_win.width=width;
	key_win.height=1;
	key_win.enabled_by_mouse=0;
	key_win.wait_for=0;

	fill_keycodes();
}