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:
parent
f9703cdc04
commit
80d77b4ee8
|
@ -2253,14 +2253,14 @@ int main(int argc, char **argv) {
|
||||||
|
|
||||||
// Main loop
|
// Main loop
|
||||||
bool quit = false;
|
bool quit = false;
|
||||||
Display *dpy = XOpenDisplay(NULL);
|
|
||||||
if (!dpy) {
|
|
||||||
fprintf(stderr, "Can't open display.");
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
XSetEventQueueOwner(dpy, XCBOwnsEventQueue);
|
|
||||||
|
|
||||||
do {
|
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);
|
ps_g = session_init(argc, argv, dpy, config_file, all_xerrors, need_fork);
|
||||||
if (!ps_g) {
|
if (!ps_g) {
|
||||||
log_fatal("Failed to create new compton session.");
|
log_fatal("Failed to create new compton session.");
|
||||||
|
@ -2289,11 +2289,11 @@ int main(int argc, char **argv) {
|
||||||
session_destroy(ps_g);
|
session_destroy(ps_g);
|
||||||
free(ps_g);
|
free(ps_g);
|
||||||
ps_g = NULL;
|
ps_g = NULL;
|
||||||
|
if (dpy) {
|
||||||
|
XCloseDisplay(dpy);
|
||||||
|
}
|
||||||
} while (!quit);
|
} while (!quit);
|
||||||
|
|
||||||
if (dpy) {
|
|
||||||
XCloseDisplay(dpy);
|
|
||||||
}
|
|
||||||
free(config_file);
|
free(config_file);
|
||||||
|
|
||||||
log_deinit_tls();
|
log_deinit_tls();
|
||||||
|
|
Loading…
Reference in New Issue