07/07/26 14:06:12
>>245
ほら、LinuxでもMacでも(恐らく)最小のウインドウを表示するプログラムやるからどっか行け。
--
/// For compile: gcc -std=c99 this.c -lX11 -L/usr/X11R6/lib
#include <X11/Xlib.h>
int main()
{
static const int WinWidth = 100;
static const int WinHeight = 100;
static const int WinBorder = 2;
Display * dpy = XOpenDisplay(NULL);
Window win = XCreateSimpleWindow(dpy, DefaultRootWindow(dpy),
0, 0, WinWidth, WinHeight, WinBorder,
BlackPixel(dpy, DefaultScreen(dpy)), WhitePixel(dpy, DefaultScreen(dpy)));
XSelectInput(dpy, win, KeyPressMask);
XMapWindow(dpy, win);
XEvent event;
do {
XNextEvent(dpy, & event);
} while (event.type != KeyPress);
XDestroyWindow(dpy, win);
XCloseDisplay(dpy);
return 0;
}