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

Lock X updates for all systems and lock around X cleanup at exit #391

Merged
merged 2 commits into from
Aug 26, 2021
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
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ OPTION(MAIKO_DISPLAY_X11 "Use X11 for display." ON)
IF(MAIKO_DISPLAY_X11)
FIND_PACKAGE(X11 REQUIRED)
SET(MAIKO_DISPLAY_X11_DEFINITIONS
"-DXWINDOW"
"-DXWINDOW -DLOCK_X_UPDATES"
)
SET(MAIKO_DISPLAY_X11_LIBRARIES X11::X11)
SET(MAIKO_DISPLAY_X11_SRCS
Expand Down
2 changes: 1 addition & 1 deletion bin/makefile-cygwin.x86_64-x
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ XFILES = $(OBJECTDIR)xmkicon.o \
$(OBJECTDIR)xwinman.o


XFLAGS = -DXWINDOW
XFLAGS = -DXWINDOW -DLOCK_X_UPDATES

# OPTFLAGS is normally -O2.
OPTFLAGS = -O2 -g3
Expand Down
2 changes: 1 addition & 1 deletion bin/makefile-darwin.386-x
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ XFILES = $(OBJECTDIR)xmkicon.o \
$(OBJECTDIR)xwinman.o


XFLAGS = -I/opt/X11/include -DXWINDOW
XFLAGS = -I/opt/X11/include -DXWINDOW -DLOCK_X_UPDATES

# OPTFLAGS is normally -O2.
OPTFLAGS = -O2 -g
Expand Down
2 changes: 1 addition & 1 deletion bin/makefile-darwin.aarch64-x
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ XFILES = $(OBJECTDIR)xmkicon.o \
$(OBJECTDIR)xwinman.o


XFLAGS = -I/opt/X11/include -DXWINDOW
XFLAGS = -I/opt/X11/include -DXWINDOW -DLOCK_X_UPDATES

# OPTFLAGS is normally -O2.
OPTFLAGS = -O2
Expand Down
2 changes: 1 addition & 1 deletion bin/makefile-darwin.ppc-x
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ XFILES = $(OBJECTDIR)xmkicon.o \
$(OBJECTDIR)xwinman.o


XFLAGS = -I/usr/X11/include -DXWINDOW
XFLAGS = -I/usr/X11/include -DXWINDOW -DLOCK_X_UPDATES

# OPTFLAGS is normally -O2.
OPTFLAGS = -O2 -g
Expand Down
2 changes: 1 addition & 1 deletion bin/makefile-darwin.x86_64-x
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ XFILES = $(OBJECTDIR)xmkicon.o \
$(OBJECTDIR)xwinman.o


XFLAGS = -I/opt/X11/include -DXWINDOW
XFLAGS = -I/opt/X11/include -DXWINDOW -DLOCK_X_UPDATES

# OPTFLAGS is normally -O2.
OPTFLAGS = -O1 -g
Expand Down
2 changes: 1 addition & 1 deletion bin/makefile-init-darwin.386
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ XFILES = $(OBJECTDIR)xmkicon.o \
$(OBJECTDIR)xwinman.o


XFLAGS = -I/opt/X11/include -DXWINDOW
XFLAGS = -I/opt/X11/include -DXWINDOW -DLOCK_X_UPDATES

# OPTFLAGS is normally -O2, for INIT we want unoptimized in case we need to debug it
OPTFLAGS = -O0 -g
Expand Down
2 changes: 1 addition & 1 deletion bin/makefile-init-darwin.aarch64
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ XFILES = $(OBJECTDIR)xmkicon.o \
$(OBJECTDIR)xwinman.o


XFLAGS = -I/opt/X11/include -DXWINDOW
XFLAGS = -I/opt/X11/include -DXWINDOW -DLOCK_X_UPDATES

# OPTFLAGS is normally -O2.
OPTFLAGS = -O0 -g3
Expand Down
2 changes: 1 addition & 1 deletion bin/makefile-init-darwin.x86_64
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ XFILES = $(OBJECTDIR)xmkicon.o \
$(OBJECTDIR)xwinman.o


XFLAGS = -I/opt/X11/include -DXWINDOW
XFLAGS = -I/opt/X11/include -DXWINDOW -DLOCK_X_UPDATES

# OPTFLAGS is normally -O2.
OPTFLAGS = -O0 -g
Expand Down
2 changes: 1 addition & 1 deletion bin/makefile-init-linux.x86_64
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ XFILES = $(OBJECTDIR)xmkicon.o \
$(OBJECTDIR)xwinman.o


XFLAGS = -DXWINDOW
XFLAGS = -DXWINDOW -DLOCK_X_UPDATES

# OPTFLAGS is normally -O2, for INIT we want unoptimized in case we need to debug it
OPTFLAGS = -O0 -g
Expand Down
2 changes: 1 addition & 1 deletion bin/makefile-init-sunos5.sparc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ XFILES = $(OBJECTDIR)xmkicon.o \
$(OBJECTDIR)xrdopt.o \
$(OBJECTDIR)xwinman.o

XFLAGS = -DXWINDOW
XFLAGS = -DXWINDOW -DLOCK_X_UPDATES

# OPTFLAGS is normally -g for MAKEINIT, as it needs debugging often.
OPTFLAGS = -g3 -O0
Expand Down
2 changes: 1 addition & 1 deletion bin/makefile-linux.386-x
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ XFILES = $(OBJECTDIR)xmkicon.o \
$(OBJECTDIR)xwinman.o


XFLAGS = -DXWINDOW
XFLAGS = -DXWINDOW -DLOCK_X_UPDATES

# OPTFLAGS is normally -O2.
OPTFLAGS = -O2 -g3
Expand Down
2 changes: 1 addition & 1 deletion bin/makefile-linux.aarch64-x
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ XFILES = $(OBJECTDIR)xmkicon.o \
$(OBJECTDIR)xrdopt.o \
$(OBJECTDIR)xwinman.o

XFLAGS = -DXWINDOW
XFLAGS = -DXWINDOW -DLOCK_X_UPDATES

# OPTFLAGS is normally -O2.
OPTFLAGS = -O2 -g3
Expand Down
2 changes: 1 addition & 1 deletion bin/makefile-linux.armv7l-x
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ XFILES = $(OBJECTDIR)xmkicon.o \
$(OBJECTDIR)xrdopt.o \
$(OBJECTDIR)xwinman.o

XFLAGS = -DXWINDOW
XFLAGS = -DXWINDOW -DLOCK_X_UPDATES

# OPTFLAGS is normally -O2.
OPTFLAGS = -O2 -g3
Expand Down
2 changes: 1 addition & 1 deletion bin/makefile-linux.x86_64-x
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ XFILES = $(OBJECTDIR)xmkicon.o \
$(OBJECTDIR)xwinman.o


XFLAGS = -DXWINDOW
XFLAGS = -DXWINDOW -DLOCK_X_UPDATES

# OPTFLAGS is normally -O2.
OPTFLAGS = -O2 -g3
Expand Down
2 changes: 1 addition & 1 deletion bin/makefile-openbsd.x86_64-x
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ XFILES = $(OBJECTDIR)xmkicon.o \
$(OBJECTDIR)xwinman.o


XFLAGS = -I/usr/X11R6/include -DXWINDOW
XFLAGS = -I/usr/X11R6/include -DXWINDOW -DLOCK_X_UPDATES

# OPTFLAGS is normally -O2.
OPTFLAGS = -O2 -g3
Expand Down
2 changes: 1 addition & 1 deletion bin/makefile-sunos5.386-x
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ XFILES = $(OBJECTDIR)xmkicon.o \
$(OBJECTDIR)xrdopt.o \
$(OBJECTDIR)xwinman.o

XFLAGS = -DXWINDOW
XFLAGS = -DXWINDOW -DLOCK_X_UPDATES

# OPTFLAGS is normally -O2.
OPTFLAGS = -O2 -g
Expand Down
2 changes: 1 addition & 1 deletion bin/makefile-sunos5.i386-x
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ XFILES = $(OBJECTDIR)xmkicon.o \
$(OBJECTDIR)xrdopt.o \
$(OBJECTDIR)xwinman.o

XFLAGS = -DXWINDOW
XFLAGS = -DXWINDOW -DLOCK_X_UPDATES

# OPTFLAGS is normally -O2.
OPTFLAGS = -O2 -g3
Expand Down
2 changes: 1 addition & 1 deletion bin/makefile-sunos5.sparc-x
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ XFILES = $(OBJECTDIR)xmkicon.o \
$(OBJECTDIR)xrdopt.o \
$(OBJECTDIR)xwinman.o

XFLAGS = -DXWINDOW
XFLAGS = -DXWINDOW -DLOCK_X_UPDATES

# OPTFLAGS is normally -O2.
OPTFLAGS = -O2 -g3
Expand Down
2 changes: 1 addition & 1 deletion bin/makefile-sunos5.x86_64-x
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ XFILES = $(OBJECTDIR)xmkicon.o \
$(OBJECTDIR)xrdopt.o \
$(OBJECTDIR)xwinman.o

XFLAGS = -DXWINDOW
XFLAGS = -DXWINDOW -DLOCK_X_UPDATES

# OPTFLAGS is normally -O2.
OPTFLAGS = -O2 -g
Expand Down
4 changes: 3 additions & 1 deletion src/xinit.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,15 @@ void lisp_Xexit(DspInterface dsp)
{
assert(Lisp_Xinitialized);

#if defined(OS5) && defined(I_SETSIG)
#if defined(I_SETSIG)
ioctl(ConnectionNumber(dsp->display_id), I_SETSIG, 0); /* so no interrupts happen during */
#endif

XLOCK;
XDestroySubwindows(dsp->display_id, dsp->LispWindow);
XDestroyWindow(dsp->display_id, dsp->LispWindow);
XCloseDisplay(dsp->display_id);
XUNLOCK(dsp);

Lisp_Xinitialized = false;
} /* end lisp_Xexit */
Expand Down