Makefile.in
author Ryan C. Gordon
Mon, 21 Aug 2017 00:42:06 -0400
changeset 11334 749cb40916f2
parent 11291 a153a5c6d413
child 11365 a9bd2625fa01
permissions -rw-r--r--
x11: specify event mask for buttons when grabbing pointer (thanks, Stas!).

This fixes a strange corner case (notes appended below), and should be
safe to do anyhow.

Fixes Bugzilla #3674.

"I did more tests.
It appears the bug only happens if there is
another window on the screen that has "always
on top" property. For me it is xawtv - it is
always opened in a screen corner. Closing
xawtv or removing "always on top" property
from it makes the problem to go away.
Plus, it doesn't appear like the buttons are
not delivered at all. It appears that instead
the button presses are delivered on some mouse
positions, but not delivered when you move the
mouse to other part of the window... So this is
really weird and is likely somewhere deep in the
Xorg.
Maybe somehow it happens that the cursor is
actually above the xawtv window, but, because
my app uses grab, it is not visible there, and
in that case the events are not delivered to
my app?
But with my patch the button events are
always delivered flawlessly, it seems.

Hmm, and that indeed seems to explain my problem:
if the mask is set properly and my app uses
grab, then, even if the mouse is above some
other window, the events would still be delivered
to the grabbing app, which is what actually wanted
because my app uses relative mouse mode, so it
doesn't know the pointer can cross some other window
(my app draws the pointer itself).
So my current theory is that my patch only enforces
the mouse grab, which otherwise can be tricked by
some other window preventing the button events
delivery (but motion events are still delivered
via xinput2, which makes it all look very obscure)."
     1 # Makefile to build and install the SDL library
     2 
     3 top_builddir = .
     4 srcdir  = @srcdir@
     5 objects = build
     6 gen = gen
     7 prefix = @prefix@
     8 exec_prefix = @exec_prefix@
     9 bindir	= @bindir@
    10 libdir  = @libdir@
    11 includedir = @includedir@
    12 datarootdir = @datarootdir@
    13 datadir	= @datadir@
    14 auxdir	= @ac_aux_dir@
    15 distpath = $(srcdir)/..
    16 distdir = SDL2-@SDL_VERSION@
    17 distfile = $(distdir).tar.gz
    18 
    19 @SET_MAKE@
    20 SHELL	= @SHELL@
    21 CC      = @CC@
    22 INCLUDE = @INCLUDE@
    23 CFLAGS  = @BUILD_CFLAGS@
    24 EXTRA_CFLAGS = @EXTRA_CFLAGS@
    25 LDFLAGS = @BUILD_LDFLAGS@
    26 EXTRA_LDFLAGS = @EXTRA_LDFLAGS@
    27 LIBTOOL = @LIBTOOL@
    28 INSTALL = @INSTALL@
    29 AR	= @AR@
    30 RANLIB	= @RANLIB@
    31 WINDRES	= @WINDRES@
    32 
    33 TARGET  = libSDL2.la
    34 OBJECTS = @OBJECTS@
    35 GEN_HEADERS = @GEN_HEADERS@
    36 GEN_OBJECTS = @GEN_OBJECTS@
    37 VERSION_OBJECTS = @VERSION_OBJECTS@
    38 
    39 SDLMAIN_TARGET = libSDL2main.la
    40 SDLMAIN_OBJECTS = @SDLMAIN_OBJECTS@
    41 
    42 SDLTEST_TARGET = libSDL2_test.la
    43 SDLTEST_OBJECTS = @SDLTEST_OBJECTS@
    44 
    45 WAYLAND_SCANNER = @WAYLAND_SCANNER@
    46 
    47 SRC_DIST = *.txt acinclude Android.mk autogen.sh android-project build-scripts cmake cmake_uninstall.cmake.in configure configure.in debian docs include Makefile.* sdl2-config.cmake.in sdl2-config.in sdl2.m4 sdl2.pc.in SDL2.spec.in SDL2Config.cmake src test VisualC.html VisualC VisualC-WinRT Xcode Xcode-iOS
    48 GEN_DIST = SDL2.spec
    49 
    50 ifneq ($V,1)
    51 RUN_CMD_AR     = @echo "  AR    " $@;
    52 RUN_CMD_CC     = @echo "  CC    " $@;
    53 RUN_CMD_CXX    = @echo "  CXX   " $@;
    54 RUN_CMD_LTLINK = @echo "  LTLINK" $@;
    55 RUN_CMD_RANLIB = @echo "  RANLIB" $@;
    56 RUN_CMD_GEN    = @echo "  GEN   " $@;
    57 LIBTOOL += --quiet
    58 endif
    59 
    60 HDRS = \
    61 	SDL.h \
    62 	SDL_assert.h \
    63 	SDL_atomic.h \
    64 	SDL_audio.h \
    65 	SDL_bits.h \
    66 	SDL_blendmode.h \
    67 	SDL_clipboard.h \
    68 	SDL_cpuinfo.h \
    69 	SDL_egl.h \
    70 	SDL_endian.h \
    71 	SDL_error.h \
    72 	SDL_events.h \
    73 	SDL_filesystem.h \
    74 	SDL_gamecontroller.h \
    75 	SDL_gesture.h \
    76 	SDL_haptic.h \
    77 	SDL_hints.h \
    78 	SDL_joystick.h \
    79 	SDL_keyboard.h \
    80 	SDL_keycode.h \
    81 	SDL_loadso.h \
    82 	SDL_log.h \
    83 	SDL_main.h \
    84 	SDL_messagebox.h \
    85 	SDL_mouse.h \
    86 	SDL_mutex.h \
    87 	SDL_name.h \
    88 	SDL_opengl.h \
    89 	SDL_opengl_glext.h \
    90 	SDL_opengles.h \
    91 	SDL_opengles2_gl2ext.h \
    92 	SDL_opengles2_gl2.h \
    93 	SDL_opengles2_gl2platform.h \
    94 	SDL_opengles2.h \
    95 	SDL_opengles2_khrplatform.h \
    96 	SDL_pixels.h \
    97 	SDL_platform.h \
    98 	SDL_power.h \
    99 	SDL_quit.h \
   100 	SDL_rect.h \
   101 	SDL_render.h \
   102 	SDL_rwops.h \
   103 	SDL_scancode.h \
   104 	SDL_shape.h \
   105 	SDL_stdinc.h \
   106 	SDL_surface.h \
   107 	SDL_system.h \
   108 	SDL_syswm.h \
   109 	SDL_thread.h \
   110 	SDL_timer.h \
   111 	SDL_touch.h \
   112 	SDL_types.h \
   113 	SDL_version.h \
   114 	SDL_video.h \
   115 	begin_code.h \
   116 	close_code.h
   117 
   118 SDLTEST_HDRS = $(shell ls $(srcdir)/include | fgrep SDL_test)
   119 
   120 LT_AGE      = @LT_AGE@
   121 LT_CURRENT  = @LT_CURRENT@
   122 LT_RELEASE  = @LT_RELEASE@
   123 LT_REVISION = @LT_REVISION@
   124 LT_LDFLAGS  = -no-undefined -rpath $(libdir) -release $(LT_RELEASE) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
   125 
   126 all: $(srcdir)/configure Makefile $(objects) $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET) $(objects)/$(SDLTEST_TARGET)
   127 
   128 $(srcdir)/configure: $(srcdir)/configure.in
   129 	@echo "Warning, configure is out of date, please re-run autogen.sh"
   130 
   131 Makefile: $(srcdir)/Makefile.in
   132 	$(SHELL) config.status $@
   133 
   134 Makefile.in:;
   135 
   136 $(objects):
   137 	$(SHELL) $(auxdir)/mkinstalldirs $@
   138 
   139 update-revision:
   140 	$(SHELL) $(auxdir)/updaterev.sh
   141 
   142 .PHONY: all update-revision install install-bin install-hdrs install-lib install-data uninstall uninstall-bin uninstall-hdrs uninstall-lib uninstall-data clean distclean dist $(OBJECTS:.lo=.d)
   143 
   144 $(objects)/$(TARGET): $(GEN_HEADERS) $(GEN_OBJECTS) $(OBJECTS) $(VERSION_OBJECTS)
   145 	$(RUN_CMD_LTLINK)$(LIBTOOL) --tag=CC --mode=link $(CC) -o $@ $(OBJECTS) $(GEN_OBJECTS) $(VERSION_OBJECTS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS)
   146 
   147 $(objects)/$(SDLMAIN_TARGET): $(SDLMAIN_OBJECTS)
   148 	$(RUN_CMD_LTLINK)$(LIBTOOL) --tag=CC --mode=link $(CC) -static -o $@ $(SDLMAIN_OBJECTS) -rpath $(libdir)
   149 
   150 $(objects)/$(SDLTEST_TARGET): $(SDLTEST_OBJECTS)
   151 	$(RUN_CMD_LTLINK)$(LIBTOOL) --tag=CC --mode=link $(CC) -static -o $@ $(SDLTEST_OBJECTS) -rpath $(libdir)
   152 
   153 install: all install-bin install-hdrs install-lib install-data
   154 install-bin:
   155 	$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(bindir)
   156 	$(INSTALL) -m 755 sdl2-config $(DESTDIR)$(bindir)/sdl2-config
   157 install-hdrs: update-revision
   158 	$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(includedir)/SDL2
   159 	for file in $(HDRS) $(SDLTEST_HDRS); do \
   160 	    $(INSTALL) -m 644 $(srcdir)/include/$$file $(DESTDIR)$(includedir)/SDL2/$$file; \
   161 	done
   162 	$(INSTALL) -m 644 include/SDL_config.h $(DESTDIR)$(includedir)/SDL2/SDL_config.h
   163 	if test -f include/SDL_revision.h; then \
   164 	    $(INSTALL) -m 644 include/SDL_revision.h $(DESTDIR)$(includedir)/SDL2/SDL_revision.h; \
   165 	else \
   166 	    $(INSTALL) -m 644 $(srcdir)/include/SDL_revision.h $(DESTDIR)$(includedir)/SDL2/SDL_revision.h; \
   167 	fi
   168 
   169 install-lib: $(objects) $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET) $(objects)/$(SDLTEST_TARGET)
   170 	$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir)
   171 	$(LIBTOOL) --mode=install $(INSTALL) $(objects)/$(TARGET) $(DESTDIR)$(libdir)/$(TARGET)
   172 	$(LIBTOOL) --mode=install $(INSTALL) $(objects)/$(SDLMAIN_TARGET) $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET)
   173 	$(LIBTOOL) --mode=install $(INSTALL) $(objects)/$(SDLTEST_TARGET) $(DESTDIR)$(libdir)/$(SDLTEST_TARGET)
   174 install-data:
   175 	$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(datadir)/aclocal
   176 	$(INSTALL) -m 644 $(srcdir)/sdl2.m4 $(DESTDIR)$(datadir)/aclocal/sdl2.m4
   177 	$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir)/pkgconfig
   178 	$(INSTALL) -m 644 sdl2.pc $(DESTDIR)$(libdir)/pkgconfig
   179 	$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir)/cmake/SDL2
   180 	$(INSTALL) -m 644 sdl2-config.cmake $(DESTDIR)$(libdir)/cmake/SDL2
   181 
   182 uninstall: uninstall-bin uninstall-hdrs uninstall-lib uninstall-data
   183 uninstall-bin:
   184 	rm -f $(DESTDIR)$(bindir)/sdl2-config
   185 uninstall-hdrs:
   186 	for file in $(HDRS) $(SDLTEST_HDRS); do \
   187 	    rm -f $(DESTDIR)$(includedir)/SDL2/$$file; \
   188 	done
   189 	rm -f $(DESTDIR)$(includedir)/SDL2/SDL_config.h
   190 	rm -f $(DESTDIR)$(includedir)/SDL2/SDL_revision.h
   191 	-rmdir $(DESTDIR)$(includedir)/SDL2
   192 uninstall-lib:
   193 	$(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$(TARGET)
   194 	rm -f $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET)
   195 	rm -f $(DESTDIR)$(libdir)/$(SDLTEST_TARGET)
   196 uninstall-data:
   197 	rm -f $(DESTDIR)$(datadir)/aclocal/sdl2.m4
   198 	rm -f $(DESTDIR)$(libdir)/pkgconfig/sdl2.pc
   199 	rm -f $(DESTDIR)$(libdir)/cmake/SDL2/sdl2-config.cmake
   200 
   201 clean:
   202 	rm -rf $(objects)
   203 	rm -rf $(gen)
   204 	if test -f test/Makefile; then (cd test; $(MAKE) $@); fi
   205 
   206 distclean: clean
   207 	rm -f Makefile Makefile.rules sdl2-config
   208 	rm -f config.status config.cache config.log libtool
   209 	rm -rf $(srcdir)/autom4te*
   210 	find $(srcdir) \( \
   211 	    -name '*~' -o \
   212 	    -name '*.bak' -o \
   213 	    -name '*.old' -o \
   214 	    -name '*.rej' -o \
   215 	    -name '*.orig' -o \
   216 	    -name '.#*' \) \
   217 	    -exec rm -f {} \;
   218 	if test -f test/Makefile; then (cd test; $(MAKE) $@); fi
   219 
   220 dist $(distfile):
   221 	$(SHELL) $(auxdir)/mkinstalldirs $(distdir)
   222 	(cd $(srcdir); tar cf - $(SRC_DIST)) | (cd $(distdir); tar xf -)
   223 	tar cf - $(GEN_DIST) | (cd $(distdir); tar xf -)
   224 	find $(distdir) \( \
   225 	    -name '*~' -o \
   226 	    -name '*.bak' -o \
   227 	    -name '*.old' -o \
   228 	    -name '*.rej' -o \
   229 	    -name '*.orig' -o \
   230 	    -name '.#*' \) \
   231 	    -exec rm -f {} \;
   232 	if test -f $(distdir)/test/Makefile; then (cd $(distdir)/test && make distclean); fi
   233 	(cd $(distdir); build-scripts/updaterev.sh)
   234 	tar cvf - $(distdir) | gzip --best >$(distfile)
   235 	rm -rf $(distdir)
   236 
   237 rpm: $(distfile)
   238 	rpmbuild -ta $?