core: don't reuse X connection across resets

In theory, it should be fine. But it causes mesa to stuck in
xcb_wait_for_special_event, indicating X connection setup issues.

Instead of investigating what went wrong in mesa, I choose to apply this
simple fix.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2019-07-25 21:15:47 +01:00
parent f9703cdc04
commit 80d77b4ee8
No known key found for this signature in database
GPG Key ID: 37C999F617EA1A47
1 changed files with 9 additions and 9 deletions

View File

@ -2253,14 +2253,14 @@ int main(int argc, char **argv) {
// Main loop
bool quit = false;
Display *dpy = XOpenDisplay(NULL);
if (!dpy) {
fprintf(stderr, "Can't open display.");
return 1;
}
XSetEventQueueOwner(dpy, XCBOwnsEventQueue);
do {
Display *dpy = XOpenDisplay(NULL);
if (!dpy) {
fprintf(stderr, "Can't open display.");
return 1;
}
XSetEventQueueOwner(dpy, XCBOwnsEventQueue);
ps_g = session_init(argc, argv, dpy, config_file, all_xerrors, need_fork);
if (!ps_g) {
log_fatal("Failed to create new compton session.");
@ -2289,11 +2289,11 @@ int main(int argc, char **argv) {
session_destroy(ps_g);
free(ps_g);
ps_g = NULL;
if (dpy) {
XCloseDisplay(dpy);
}
} while (!quit);
if (dpy) {
XCloseDisplay(dpy);
}
free(config_file);
log_deinit_tls();