spawn_window.c
static void printClientMessage(Display *disp, XClientMessageEvent *message)
{
	// Get atom type as string
	char *messageTypeStr = XGetAtomName(disp, message->message_type);
	printf("Message type: %s\n", messageTypeStr);
	XFree(messageTypeStr);

	// Handle format
	printf("Message word size: %d bits\n", message->format);
	printf("Message ");
	switch (message->format) {
	case 8:
		printf("bytes: ");
		for (int i = 0; i < 20; ++i)
			printf("%d ", message->data.b[i]);
		break;
	case 16:
		printf("16-bit shorts: ");
		for (int i = 0; i < 10; ++i)
			printf("%d ", message->data.s[i]);
		break;
	case 32:
		printf("32-bit longs: ");
		for (int i = 0; i < 5; ++i)
			printf("%d ", (int32_t)message->data.l[i]);
		break;
	}
	printf("\n");
}
// This function prints the contents of ClientMessage events
This function prints the contents of ClientMessage events
This function prints the contents of ClientMessage events
static void printClientMessage(Display *disp, XClientMessageEvent *message)
{
	char *messageTypeStr = XGetAtomName(disp, message->message_type);
	printf("Message type: %s\n", messageTypeStr);
	XFree(messageTypeStr);
	printf("Message word size: %d bits\n", message->format);
	printf("Message ");
	switch (message->format) {
	case 8:
		printf("bytes: ");
		for (int i = 0; i < 20; ++i)
			printf("%d ", message->data.b[i]);
		break;
	case 16:
		printf("16-bit shorts: ");
		for (int i = 0; i < 10; ++i)
			printf("%d ", message->data.s[i]);
		break;
	case 32:
		printf("32-bit longs: ");
		for (int i = 0; i < 5; ++i)
			printf("%d ", (int32_t)message->data.l[i]);
		break;
	}
	printf("\n");
}
static void printClientMessage ( Display * disp , XClientMessageEvent * message ) { char * messageTypeStr = XGetAtomName ( disp , message -> message_type ) ; printf ( " \n " , messageTypeStr ) ; XFree ( messageTypeStr ) ; printf ( " \n " , message -> format ) ; printf ( " " ) ; switch ( message -> format ) { case 8 : printf ( " " ) ; for ( int i = 0 ; i < 20 ; ++ i ) printf ( " " , message -> data . b [ i ] ) ; break ; case 16 : printf ( " " ) ; for ( int i = 0 ; i < 10 ; ++ i ) printf ( " " , message -> data . s [ i ] ) ; break ; case 32 : printf ( " " ) ; for ( int i = 0 ; i < 5 ; ++ i ) printf ( " " , ( int32_t ) message -> data . l [ i ] ) ; break ; } printf ( " \n " ) ; }
This function prints the contents of ClientMessage events
This function prints the contents of ClientMessage events
// Get atom type as string // Handle format