xcb:窗口/屏幕信息screen

版权声明:本文为博主原创文章,仅供学习参考,转载请注明出处,谢谢! https://blog.csdn.net/Rong_Toa/article/details/85724040
#include <xcb/xcb.h>
#include  <stdio.h>
int
main()
{
	xcb_connection_t * conn;
	xcb_screen_t *screen;
	int screen_nbr;
	xcb_screen_iterator_t iter;
	
	conn = xcb_connect(NULL, &screen_nbr);
	
	iter = xcb_setup_roots_iterator(xcb_get_setup(conn));

	for(; iter.rem; --screen_nbr, xcb_screen_next(&iter))
	{
		if (screen_nbr == 0)
		{
			screen = iter.data;
			break;
		}
	}
	printf("\nInformations of screen %ld:\n", screen->root);
	printf("width:%d\nheight:%d\n", screen->width_in_pixels, screen->height_in_pixels);
	printf("white pixel:%ld\nblack pixel:%ld\n", screen->white_pixel, screen->black_pixel);
	xcb_disconnect(conn);
	return 0;
}

猜你喜欢

转载自blog.csdn.net/Rong_Toa/article/details/85724040
今日推荐