]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Release buttons only when mouse is uncaptured, not when input devices are unacquired.
authorToni Wilen <twilen@winuae.net>
Sat, 14 Oct 2017 17:43:31 +0000 (20:43 +0300)
committerToni Wilen <twilen@winuae.net>
Sat, 14 Oct 2017 17:43:31 +0000 (20:43 +0300)
include/inputdevice.h
inputdevice.cpp
od-win32/win32.cpp

index 1a9a9ba3abbf1fa1fcafa0debf746810a1533085..6982930862f085ade0907b096a529714cb23cae5 100644 (file)
@@ -305,6 +305,7 @@ extern void inputdevice_default_prefs (struct uae_prefs *p);
 extern void inputdevice_acquire (int allmode);
 extern void inputdevice_unacquire(void);
 extern void inputdevice_unacquire(bool emulationactive, int inputmask);
+extern void inputdevice_releasebuttons(void);
 
 extern void indicator_leds (int num, int state);
 
index 573f7aa8a2ccf9f0cc9da038d7dc84af338e277b..7a553d5f91ff94bb750e097d97ce1bc853cefd9c 100644 (file)
@@ -5087,7 +5087,7 @@ void inputdevice_reset (void)
        }
        lightpen_trigger2 = 0;
        cubo_flag = 0;
-       alg_flag = 0;
+       alg_flag &= 1;
 }
 
 static int getoldport (struct uae_input_device *id)
@@ -8355,7 +8355,7 @@ void inputdevice_copy_single_config (struct uae_prefs *p, int src, int dst, int
        }
 }
 
-static void clearpressmask(void)
+void inputdevice_releasebuttons(void)
 {
        for (int i = 0; i < MAX_INPUT_DEVICES; i++) {
                for (int j = 0; j < 32; j++) {
@@ -8402,8 +8402,6 @@ void inputdevice_acquire (int allmode)
                        idev[IDTYPE_KEYBOARD].acquire (i, allmode < 0);
        }
 
-       clearpressmask();
-
        if (input_acquired)
                return;
 
@@ -8453,8 +8451,6 @@ void inputdevice_unacquire(bool emulationactive, int inputmask)
                idev[IDTYPE_MOUSE].unacquire(-1);
        if (!(inputmask & 1))
                idev[IDTYPE_KEYBOARD].unacquire(-1);
-
-       clearpressmask();
 }
 
 void inputdevice_unacquire(void)
@@ -9048,6 +9044,7 @@ void inputdevice_joyport_config_store(struct uae_prefs *p, const TCHAR *value, i
        }
        if (mode >= 0)
                jp->mode = mode;
+       jp->changed = true;
 }
 
 int inputdevice_joyport_config (struct uae_prefs *p, const TCHAR *value1, const TCHAR *value2, int portnum, int mode, int type, bool candefault)
@@ -9244,11 +9241,16 @@ int inputdevice_getjoyportdevice (int port, int val)
 void inputdevice_fix_prefs(struct uae_prefs *p, bool userconfig)
 {
        struct jport jport_config_store[MAX_JPORTS];
+       bool changed = false;
 
        for (int i = 0; i < MAX_JPORTS; i++) {
                memcpy(&jport_config_store[i], &p->jports[i], sizeof(struct jport));
+               changed |= p->jports[i].changed;
        }
 
+       if (!changed)
+               return;
+
        bool defaultports = userconfig == false;
        // Convert old style custom mapping to new style
        for (int i = 0; i < MAX_JPORTS_CUSTOM; i++) {
index 3b976c95ec666f35ed8d06e86dfa31287bf930da..925f7e6a6f0e2ebc899eed52cd8c43547a22acc7 100644 (file)
@@ -845,6 +845,7 @@ static void setmouseactive2 (int active, bool allowpause)
                }
 #endif
                inputdevice_acquire (FALSE);
+               inputdevice_releasebuttons();
        }
        if (!active && allowpause) {
                if (currprefs.win32_active_nocapture_pause) {