17 {
18 XInitThreads();
19 Display* display = XOpenDisplay(nullptr);
20
22
23
24 const int x11_fd = ConnectionNumber(display);
25
28 if (0 == XPending(display)) {
29
30
31
32 fd_set in_fds;
33 FD_ZERO(&in_fds);
34 FD_SET(x11_fd, &in_fds);
35
36
37 struct timeval tv;
38 tv.tv_usec = 10;
39 tv.tv_sec = 0;
40
41
42 (void)
select(1, &in_fds,
nullptr,
nullptr, &tv);
43 }
44
45
46
47 if (
int count = XPending(display)) {
48
52 XNextEvent(display, &
event);
53
55 if (!win) {
56 continue;
57 }
58
59
61 case Expose:
63 pendingWindows.
add(win);
64 break;
65 case ConfigureNotify:
67 event.xconfigurerequest.height);
68 pendingWindows.
add(win);
69 break;
70 default:
73 }
74 break;
75 }
76 }
80 });
81 } else {
82
84 }
85
86 XFlush(display);
87 }
88
90
91 XCloseDisplay(display);
92
93 return 0;
94}
static void done(const char *config, const char *src, const char *srcOptions, const char *name)
static Application * Create(int argc, char **argv, void *platformData)
bool handleEvent(const XEvent &event)
static SkTDynamicHash< Window_unix, XWindow > gWindowMap
void markPendingResize(int width, int height)
void foreach(Fn &&fn) const