[gimp] Issue #2495: different code for Windows and Linux on duplicate devices.



commit 74a7a5d3e2cbc1f070d548cc455bb68d9317964d
Author: Jehan <jehan girinstud io>
Date:   Tue Dec 11 16:05:41 2018 +0100

    Issue #2495: different code for Windows and Linux on duplicate devices.
    
    After discussing with Mitch, it turn out commit 717c183a3e was fixing
    (or rather working around) actual issues of broken device/usb stack
    issues on Linux, as expected.
    Nevertheless on Windows, this broke in turn many tablets (see commit
    ce24e16083). Therefore we do a very ugly #ifdef to bail from duplicate
    devices on Windows whereas we continue on Linux. This fix and difference
    of behavior is completely empirical, rather than based on actual good
    logics, so that's quite annoying, but well… not much choice here.
    
    Also note that since we had no report of breakage on other OSes (such as
    macOS/BSD), at least that I know of, I let them with the Linux code
    path.

 app/widgets/gimpdeviceinfo.c | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)
---
diff --git a/app/widgets/gimpdeviceinfo.c b/app/widgets/gimpdeviceinfo.c
index 51ee25f351..bbc094c922 100644
--- a/app/widgets/gimpdeviceinfo.c
+++ b/app/widgets/gimpdeviceinfo.c
@@ -618,19 +618,26 @@ gimp_device_info_set_device (GimpDeviceInfo *info,
                   "which already has a device\n",
                   G_STRFUNC, gdk_device_get_name (device));
 
-      /*  We tried to simply continue and overwrite the info's old
-       *  device (assuming it to be dead) with the new one but this
-       *  broke a lot of devices. See the regression bug #2495.
+#ifdef G_OS_WIN32
+      /*  This is a very weird/dirty difference we make between Win32 and
+       *  Linux. On Linux, we had breakage because of duplicate devices,
+       *  fixed by overwriting the info's old device (assuming it to be
+       *  dead) with the new one. Unfortunately doing this on Windows
+       *  too broke a lot of devices (which used to work with the old
+       *  way). See the regression bug #2495.
        *
        *  NOTE that this only happens if something is wrong on the USB
        *  or udev or libinput or whatever side and the same device is
        *  present multiple times. Therefore there doesn't seem to be an
        *  absolute single "solution" to this problem (well there is, but
-       *  probably not in GIMP, where we can only react). Nevertheless
-       *  experience taught us that bailing out may break less devices
-       *  (at the very least on Windows).
+       *  probably not in GIMP, where we can only react). This is more
+       *  of an experimenting-in-real-life kind of bug.
+       *  Also we had no clear report on macOS or BSD (AFAIK) of broken
+       *  tablets with any of the version of the code. So let's keep
+       *  these similar to Linux for now.
        */
       return FALSE;
+#endif /* G_OS_WIN32 */
     }
   else if (! device && ! info->device)
     {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]