Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

X11: Fix segfault on SIGINT #1606

Merged
merged 1 commit into from
Aug 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/display-x11.cc
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,10 @@ bool display_output_x11::initialize() {
return true;
}

bool display_output_x11::shutdown() { return false; }
bool display_output_x11::shutdown() {
deinit_x11();
return true;
}

bool display_output_x11::main_loop_wait(double t) {
/* wait for X event or timeout */
Expand Down
3 changes: 1 addition & 2 deletions src/x11.cc
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ static void update_workarea();
static Window find_desktop_window(Window *p_root, Window *p_desktop);
static Window find_subwindow(Window win, int w, int h);
static void init_x11();
static void deinit_x11();

/********************* <SETTINGS> ************************/
namespace priv {
Expand Down Expand Up @@ -275,7 +274,7 @@ static void init_x11() {
DBGP("leave init_x11()");
}

static void deinit_x11() {
void deinit_x11() {
if (display) {
DBGP("deinit_x11()");
XCloseDisplay(display);
Expand Down
1 change: 1 addition & 0 deletions src/x11.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ void set_transparent_background(Window win);
void get_x11_desktop_info(Display *current_display, Atom atom);
void set_struts(int);
void x11_init_window(lua::state &l, bool own);
void deinit_x11();

#ifdef BUILD_XDBE
void xdbe_swap_buffers(void);
Expand Down