...
 
Commits (2)
dosbox (0.74-2-2) UNRELEASED; urgency=medium
dosbox (0.74-2-2) unstable; urgency=medium
[ Ondřej Nový ]
* d/watch: Use https protocol
-- Ondřej Nový <onovy@debian.org> Mon, 01 Oct 2018 10:05:16 +0200
[ Stephen Kitt ]
* Apply upstream fix to allow grabbing the mouse again with recent
X.org. Closes: #907271.
-- Stephen Kitt <skitt@debian.org> Sun, 23 Dec 2018 21:30:44 +0100
dosbox (0.74-2-1) unstable; urgency=medium
......
Description: Allow grabbing the mouse with recent X.org
Origin: https://www.dosbox.com/downloads/74-2-events.diff
--- a/src/gui/sdlmain.cpp
+++ b/src/gui/sdlmain.cpp
@@ -1426,6 +1426,12 @@
#define DB_POLLSKIP 1
#endif
+#if defined(LINUX)
+#define SDL_XORG_FIX 1
+#else
+#define SDL_XORG_FIX 0
+#endif
+
void GFX_Events() {
//Don't poll too often. This can be heavy on the OS, especially Macs.
//In idle mode 3000-4000 polls are done per second without this check.
@@ -1449,6 +1455,19 @@
}
#endif
while (SDL_PollEvent(&event)) {
+#if SDL_XORG_FIX
+ // Special code for broken SDL with Xorg 1.20.1, where pairs of inputfocus gain and loss events are generated
+ // when locking the mouse in windowed mode.
+ if (event.type == SDL_ACTIVEEVENT && event.active.state == SDL_APPINPUTFOCUS && event.active.gain == 0) {
+ SDL_Event test; //Check if the next event would undo this one.
+ if (SDL_PeepEvents(&test,1,SDL_PEEKEVENT,SDL_ACTIVEEVENTMASK) == 1 && test.active.state == SDL_APPINPUTFOCUS && test.active.gain == 1) {
+ // Skip both events.
+ SDL_PeepEvents(&test,1,SDL_GETEVENT,SDL_ACTIVEEVENTMASK);
+ continue;
+ }
+ }
+#endif
+
switch (event.type) {
case SDL_ACTIVEEVENT:
if (event.active.state & SDL_APPINPUTFOCUS) {
fix_manpage_errors.patch
74-2-events.diff