GNOME Bugzilla – Bug 764664
Segfault when initializing WINTAB pressure-sensitive tablets (Wacom, Huion, ...)
Last modified: 2016-04-11 20:26:37 UTC
Downstream issue: https://github.com/mypaint/mypaint/issues/636 (user-level details and a bit more) Programs using WINTAB drivers crash immediately when the program starts. Affects multiple Huion and Wacom drivers. Reproducible with hardware in MSYS2's gtk3 packages, 3.20.1 and 3.20.2. Version 3.18.6 is unaffected. Before 3.20.2, there was a CRITICAL which seems to have been removed in 3.20.2: > (python2.exe:3160): Gdk-CRITICAL **: _gdk_win32_display_create_window_impl: assertion 'display == gdk_display_get_default ()' failed I do not know if it it's related, but it might indicate where/when to look.
Affects gtk3-demo too, not just programs actually trying to use tablet input. Backtrace for debug+unstripped builds of MSYS2's gtk3 3.20.2-1 and glib2 2.48.0-3 for x86_64. With Wacom PTH-650 inserted at program start, gtk3-demo segfaults. Without the tablet plugged in at program start, it operates normally. (As mentioned in the downstream report, users really cannot plug their tablet in after the program has started as a workaround for this bug. The result works as a mouse, but pressure is absent.) $ gdb -ex r --args gtk3-demo GNU gdb (GDB) 7.11 Copyright (C) 2016 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-w64-mingw32". Type "show configuration" for configuration details. For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from gtk3-demo...(no debugging symbols found)...done. Starting program: C:\msys64\mingw64\bin\gtk3-demo.exe [New Thread 5724.0x1670] [New Thread 5724.0x1284] [New Thread 5724.0x1530] [New Thread 5724.0x1790] [New Thread 5724.0x388] [New Thread 5724.0x117c] [New Thread 5724.0x16c4] [New Thread 5724.0xd90] Thread 1 received signal SIGSEGV, Segmentation fault. 0x0000000070eea1f6 in ?? () from C:\msys64\mingw64\bin\libgdk-3-0.dll (gdb) bt
+ Trace 236147
A debugging session is active. Inferior 1 [process 5724] will be killed. Quit anyway? (y or n) [answered Y; input not from terminal] $
Downgrading the glib2 package to non-debug 2.44.1 doesn't fix this (and the backtrace still refers to 2.48... let me know if you would like me to rebuild gtk3 against debug glib or something like that - these two debug builds were done in parallel against stock MSYS2 <everything-else>). Downgrading the gtk3 package alone to 3.18.6 *is* sufficient to fix this problem.
Better backtrace. Somehow my debug build didn't have symbols available before. This is with the Huion tablet not plugged in, just with its manufacturer's drivers installed at their latest version (V12.2.14 from https://www.huiontablet.com/all-products/graphic-tablets/h610.html → Download tab → "Driver for HUION H610", click on the Windows logo). Anyone can reproduce this regardless of whether they own actual tablet hardware, I hope :) Wacom tablets require the tablet to be plugged in at startup for the crash to happen. I'll drop a trace in from that scenario shortly for confirmation. $ gdb -ex r --args gtk3-demo GNU gdb (GDB) 7.11 Copyright (C) 2016 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-w64-mingw32". Type "show configuration" for configuration details. For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from gtk3-demo...done. Starting program: C:\msys64\mingw64\bin\gtk3-demo.exe [New Thread 1940.0x6dc] [New Thread 1940.0xeb4] [New Thread 1940.0xff4] [New Thread 1940.0xe14] [New Thread 1940.0xe58] [New Thread 1940.0x74c] [New Thread 1940.0xd90] warning: WTContextManager() this:f84de310 warning: WTRoundArray() this:f84deb90 Thread 1 received signal SIGSEGV, Segmentation fault. 0x0000000070eeb46e in wintab_init_check (device_manager=0x202b280) at gdkdevicemanager-win32.c:512 512 if ((*hctx = (*p_WTOpenA) (GDK_WINDOW_HWND (wintab_window), &lc, TRUE)) == NULL) (gdb) bt full
+ Trace 236149
And again, this time from a plugged-in Wacom device. Debug build of GTK 3.20.2 as in comment 3. $ gdb -ex r --args gtk3-demo GNU gdb (GDB) 7.11 Copyright (C) 2016 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-w64-mingw32". Type "show configuration" for configuration details. For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from gtk3-demo...done. Starting program: C:\msys64\mingw64\bin\gtk3-demo.exe [New Thread 3464.0xb94] [New Thread 3464.0x368] [New Thread 3464.0xc74] [New Thread 3464.0x540] [New Thread 3464.0xf60] [New Thread 3464.0x378] [New Thread 3464.0xd90] [New Thread 3464.0xe40] Thread 1 received signal SIGSEGV, Segmentation fault. 0x0000000070eeb46e in wintab_init_check (device_manager=0x1fab280) at gdkdevicemanager-win32.c:512 512 if ((*hctx = (*p_WTOpenA) (GDK_WINDOW_HWND (wintab_window), &lc, TRUE)) == NULL) (gdb) bt full
+ Trace 236150
Blind guess: could you try to add gdk_window_ensure_native at line 451 of gdkdevicemanager-win32.c ? Something like: ... wa.window_type = GDK_WINDOW_TOPLEVEL; if ((wintab_window = gdk_window_new (root, &wa, GDK_WA_X | GDK_WA_Y)) == NULL) { g_warning ("gdk_input_wintab_init: gdk_window_new failed"); return; } g_object_ref (wintab_window); gdk_window_ensure_native (wintab_window); for (devix = 0; devix < ndevices; devix++) { ... Basically I am wondering if wintab_window actually has window->impl->hwnd More in general I do not understand why this code needs to create a GdkWindow if it just needs a native handle... wouldn't it be better to just use CreateWindow etc?
Can you please give us also the bt using --g-fatal-warnings?
nacho: with the same 3.20.2 build as in comment 4 and comment 3, *with no Wacom attached at startup*: $ gdb -ex r --args gtk3-demo --g-fatal-warnings GNU gdb (GDB) 7.11 Copyright (C) 2016 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-w64-mingw32". Type "show configuration" for configuration details. For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from gtk3-demo...done. Starting program: C:\msys64\mingw64\bin\gtk3-demo.exe --g-fatal-warnings [New Thread 3960.0x8dc] [New Thread 3960.0x1010] [New Thread 3960.0xf1c] [New Thread 3960.0x1340] [New Thread 3960.0x10c0] [New Thread 3960.0xccc] [New Thread 3960.0x12b4] [New Thread 3960.0xc9c] Thread 1 received signal SIGTRAP, Trace/breakpoint trap. 0x00000000685f816b in _g_log_abort (breakpoint=1) at ../../glib-2.48.0/glib/gmessages.c:325 325 G_BREAKPOINT (); (gdb) bt full
+ Trace 236153
nacho: and again, the same same 3.20.2 build as in comment 4 and comment 3 and comment 7, this time *with* the Wacom device plugged in at startup. $ gdb -ex r --args gtk3-demo --g-fatal-warnings GNU gdb (GDB) 7.11 Copyright (C) 2016 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-w64-mingw32". Type "show configuration" for configuration details. For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from gtk3-demo...done. Starting program: C:\msys64\mingw64\bin\gtk3-demo.exe --g-fatal-warnings [New Thread 1100.0xa94] [New Thread 1100.0x1198] [New Thread 1100.0x106c] [New Thread 1100.0x1020] [New Thread 1100.0xd84] [New Thread 1100.0x9a4] [New Thread 1100.0x41c] [New Thread 1100.0x127c] Thread 1 received signal SIGTRAP, Trace/breakpoint trap. 0x00000000685f816b in _g_log_abort (breakpoint=1) at ../../glib-2.48.0/glib/gmessages.c:325 325 G_BREAKPOINT (); (gdb) bt full
+ Trace 236154
Paolo: I patched with ----------------------------------8<-------------------------------- diff -rU2 gtk+-3.20.2.upstream-as-patched/gdk/win32/gdkdevicemanager-win32.c gtk+-3.20.2-mine/gdk/win32/gdkdevicemanager-win32.c --- gtk+-3.20.2.upstream-as-patched/gdk/win32/gdkdevicemanager-win32.c 2016-03-26 02:46:38.000000000 +0000 +++ gtk+-3.20.2-mine/gdk/win32/gdkdevicemanager-win32.c 2016-04-06 18:37:54.120123700 +0100 @@ -449,4 +449,10 @@ g_object_ref (wintab_window); + if (! gdk_window_ensure_native (wintab_window)) + { + g_warning ("gdk_input_wintab_init: dummy GdkWindow has no native window"); + return; + } + for (devix = 0; devix < ndevices; devix++) { ---------------------------------->8----------------------------------- and rebuilt. That HWND is definitely there. $ gdb -ex r --args gtk3-demo GNU gdb (GDB) 7.11 Copyright (C) 2016 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-w64-mingw32". Type "show configuration" for configuration details. For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from gtk3-demo...done. Starting program: C:\msys64\mingw64\bin\gtk3-demo.exe [New Thread 3232.0x90c] [New Thread 3232.0x10a4] [New Thread 3232.0xa9c] [New Thread 3232.0x160] [New Thread 3232.0x918] [New Thread 3232.0x12c] [New Thread 3232.0x1178] [New Thread 3232.0x970] Thread 1 received signal SIGSEGV, Segmentation fault. 0x0000000070eeb48e in wintab_init_check (device_manager=0x209b280) at gdkdevicemanager-win32.c:518 518 if ((*hctx = (*p_WTOpenA) (GDK_WINDOW_HWND (wintab_window), &lc, TRUE)) == NULL) (gdb) break gdkdevicemanager-win32.c:443 Breakpoint 1 at 0x70eeb119: file gdkdevicemanager-win32.c, line 443. (gdb) r The program being debugged has been started already. Start it from the beginning? (y or n) [answered Y; input not from terminal] Starting program: C:\msys64\mingw64\bin\gtk3-demo.exe [New Thread 4516.0xec0] [New Thread 4516.0x1208] [New Thread 4516.0x860] [New Thread 4516.0x105c] [New Thread 4516.0xe44] [New Thread 4516.0x1264] [New Thread 4516.0x11c8] [New Thread 4516.0x7d8] Thread 1 hit Breakpoint 1, wintab_init_check (device_manager=0x1fdb280) at gdkdevicemanager-win32.c:443 443 wa.window_type = GDK_WINDOW_TOPLEVEL; (gdb) l 438 wa.event_mask = GDK_ALL_EVENTS_MASK; 439 wa.width = 2; 440 wa.height = 2; 441 wa.x = -100; 442 wa.y = -100; 443 wa.window_type = GDK_WINDOW_TOPLEVEL; 444 if ((wintab_window = gdk_window_new (root, &wa, GDK_WA_X | GDK_WA_Y)) == NULL) 445 { 446 g_warning ("gdk_input_wintab_init: gdk_window_new failed"); 447 return; (gdb) n 444 if ((wintab_window = gdk_window_new (root, &wa, GDK_WA_X | GDK_WA_Y)) == NULL) (gdb) n 449 g_object_ref (wintab_window); (gdb) p wintab_window $1 = (GdkWindow *) 0x200f1f0 (gdb) n 451 if (! gdk_window_ensure_native (wintab_window)) (gdb) p wintab_window $2 = (GdkWindow *) 0x200f1f0 (gdb) n 467 (*p_WTInfoW) (WTI_DEVICES + devix, DVC_NAME, devname); (gdb) n 0x000007fef10960ff in Wintab32!WTInfoW () from C:\Windows\system32\Wintab32.dll (gdb) c Continuing. [New Thread 4516.0x1194] [Thread 4516.0x860 exited with code 0] [New Thread 4516.0xadc] Thread 1 received signal SIGSEGV, Segmentation fault. 0x0000000070eeb48e in wintab_init_check (device_manager=0x1fdb280) at gdkdevicemanager-win32.c:518 518 if ((*hctx = (*p_WTOpenA) (GDK_WINDOW_HWND (wintab_window), &lc, TRUE)) == NULL) (gdb) p wintab_window $3 = (GdkWindow *) 0x200f1f0 (gdb) bt full
+ Trace 236155
Wait, what. [N.b. below is probably me misunderstanding gdb. Forgive me, I'm a Python guy.] $ gdb -ex r --args gtk3-demo GNU gdb (GDB) 7.11 Copyright (C) 2016 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-w64-mingw32". Type "show configuration" for configuration details. For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from gtk3-demo...done. Starting program: C:\msys64\mingw64\bin\gtk3-demo.exe [New Thread 1668.0xcc0] [New Thread 1668.0x9a4] [New Thread 1668.0xf70] [New Thread 1668.0x1d0] [New Thread 1668.0x41c] [New Thread 1668.0x368] [New Thread 1668.0x180] [New Thread 1668.0x127c] Thread 1 received signal SIGSEGV, Segmentation fault. 0x0000000070eeb48e in wintab_init_check (device_manager=0x67b280) at gdkdevicemanager-win32.c:518 518 if ((*hctx = (*p_WTOpenA) (GDK_WINDOW_HWND (wintab_window), &lc, TRUE)) == NULL) (gdb) break gdkdevicemanager-win32.c:443 Breakpoint 1 at 0x70eeb119: file gdkdevicemanager-win32.c, line 443. (gdb) r The program being debugged has been started already. Start it from the beginning? (y or n) [answered Y; input not from terminal] Starting program: C:\msys64\mingw64\bin\gtk3-demo.exe [New Thread 1664.0x1018] [New Thread 1664.0x10b4] [New Thread 1664.0x118c] [New Thread 1664.0x130] [New Thread 1664.0xdb0] [New Thread 1664.0xd28] [New Thread 1664.0xd1c] [New Thread 1664.0xd80] Thread 1 hit Breakpoint 1, wintab_init_check (device_manager=0x1fab280) at gdkdevicemanager-win32.c:443 443 wa.window_type = GDK_WINDOW_TOPLEVEL; (gdb) l 438 wa.event_mask = GDK_ALL_EVENTS_MASK; 439 wa.width = 2; 440 wa.height = 2; 441 wa.x = -100; 442 wa.y = -100; 443 wa.window_type = GDK_WINDOW_TOPLEVEL; 444 if ((wintab_window = gdk_window_new (root, &wa, GDK_WA_X | GDK_WA_Y)) == NULL) 445 { 446 g_warning ("gdk_input_wintab_init: gdk_window_new failed"); 447 return; (gdb) n 444 if ((wintab_window = gdk_window_new (root, &wa, GDK_WA_X | GDK_WA_Y)) == NULL) (gdb) n 449 g_object_ref (wintab_window); (gdb) n 451 if (! gdk_window_ensure_native (wintab_window)) (gdb) p wintab_window->impl $1 = (GdkWindowImpl *) 0x0 (gdb) n 467 (*p_WTInfoW) (WTI_DEVICES + devix, DVC_NAME, devname); (gdb) p wintab_window->impl $2 = (GdkWindowImpl *) 0x0 (gdb) p wintab_window->impl->hwnd There is no member named hwnd. (gdb) q
I think I know the reason: - when the display is opened the device manager is created passing in the display to it. - in the device manager constructed we initialize the wintab - in the wintab initialization we create a gdk_window which has the assertion where display == default display - at this point the default display is still NULL because display_open has not yet returned so _gdk_display is still not set.
Out of curiosity what if you change _gdk_display_create_window_impl to have this other assertion? g_return_if_fail (display == _gdk_display);
nacho: it fails to compile, with [...] gdkdisplay.c: In function '_gdk_display_create_window_impl': gdkdisplay.c:2178:32: error: '_gdk_display' undeclared (first use in this function) g_return_if_fail (display == _gdk_display); ^ [...] $ cat 0090-extra-assert.patch diff -rU2 gtk+-3.20.2.upstream-as-patched/gdk/gdkdisplay.c gtk+-3.20.2-mine/gdk/gdkdisplay.c --- gtk+-3.20.2.upstream-as-patched/gdk/gdkdisplay.c 2016-03-26 02:46:38.000000000 +0000 +++ gtk+-3.20.2-mine/gdk/gdkdisplay.c 2016-04-07 20:44:28.027523500 +0100 @@ -2176,4 +2176,5 @@ gint attributes_mask) { + g_return_if_fail (display == _gdk_display); GDK_DISPLAY_GET_CLASS (display)->create_window_impl (display, window,
I hope I've given enough information for people who know the GTK codebase better than I do to help debug and fix this. The presence of installed Huion drivers alone on Win7 is enough to trigger this in 3.20.{1,2}, although it can be triggered by the presence of both the Wacom drivers and a plugged-in Wacom tablet too. Both tablet models' GTK symptoms are alleviated by reverting to 3.18.6, changing nothing else on the system. Both tablet models' symptoms seem the same in all respects. Please let me know if you want me to try anything else, but I won't have a great deal of time available over the upcoming weekend to help diagnose this bug myself.
Please try somethign like this: --- a/gdk/win32/gdkwindow-win32.c +++ b/gdk/win32/gdkwindow-win32.c @@ -643,7 +643,7 @@ _gdk_win32_display_create_window_impl (GdkDisplay *display, /* check consistency of redundant information */ guint remaining_mask = attributes_mask; - g_return_if_fail (display == gdk_display_get_default ()); + g_return_if_fail (display == _gdk_display); GDK_NOTE (MISC, g_print ("_gdk_window_impl_new: %s %s\n",
nacho: fixing the assertion fixes the segfault. With that patch: $ gdb -ex r --args gtk3-demo GNU gdb (GDB) 7.11 Copyright (C) 2016 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-w64-mingw32". Type "show configuration" for configuration details. For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from gtk3-demo...done. Starting program: C:\msys64\mingw64\bin\gtk3-demo.exe [New Thread 2020.0x125c] [New Thread 2020.0xa78] [New Thread 2020.0xc98] [New Thread 2020.0xb48] [New Thread 2020.0xebc] [New Thread 2020.0xc8c] [New Thread 2020.0xd58] [New Thread 2020.0x12d0] [New Thread 2020.0x11f8] [New Thread 2020.0xef0] [New Thread 2020.0x10a0] [Thread 2020.0xebc exited with code 0] [Thread 2020.0xc8c exited with code 0] [Thread 2020.0xef0 exited with code 0] [Thread 2020.0x12d0 exited with code 0] [Thread 2020.0xb48 exited with code 0] [Thread 2020.0xa78 exited with code 0] [Thread 2020.0x10a0 exited with code 0] [Thread 2020.0x11f8 exited with code 0] [Thread 2020.0xd58 exited with code 0] [Thread 2020.0xc98 exited with code 0] [Inferior 1 (process 2020) exited normally] (gdb) break gdkwindow-win32.c:646 Breakpoint 1 at 0x70f075ce: file gdkwindow-win32.c, line 646. (gdb) r Starting program: C:\msys64\mingw64\bin\gtk3-demo.exe [New Thread 372.0xfa8] [New Thread 372.0x132c] [New Thread 372.0x6ec] [New Thread 372.0xc68] [New Thread 372.0x40c] [New Thread 372.0x2f4] [New Thread 372.0x264] [New Thread 372.0x11dc] Thread 1 hit Breakpoint 1, _gdk_win32_display_create_window_impl ( display=0x1ffe000, window=0x1fff1f0, real_parent=0x1fff090, screen=0x1fcfbd0, event_mask=16777206, attributes=0x22f1d0, attributes_mask=12) at gdkwindow-win32.c:646 646 g_return_if_fail (display == _gdk_display); (gdb) p display $1 = (GdkDisplay *) 0x1ffe000 (gdb) p _gdk_display $2 = (GdkDisplay *) 0x1ffe000 (gdb) bt full
+ Trace 236162
Continuing. [New Thread 372.0xa1c] [New Thread 372.0x150] {{{ program opens its main window here -- achadwick }}} [Thread 372.0x40c exited with code 0] [Thread 372.0x2f4 exited with code 0] [Thread 372.0x150 exited with code 0] [Thread 372.0xcac exited with code 0] [Thread 372.0x11dc exited with code 0] [Thread 372.0xc68 exited with code 0] [Thread 372.0x132c exited with code 0] [Thread 372.0xa1c exited with code 0] [Thread 372.0x1370 exited with code 0] [Thread 372.0x264 exited with code 0] [Inferior 1 (process 372) exited normally] (gdb) q
^ That's two traces not one, if anyone's looking at this in the GNOME Bugzilla. Just wanted to confirm how this func comes to be called twice. Ignore the initial successful run; that's just to get the symbols loaded.
Created attachment 325749 [details] [review] win32: rollback change and use _gdk_window This makes usage of _gdk_window again when creating a window. This is needed because there is a window created when the display is being initialized, so it becomes a chicken and egg problem. For now we roll back this to fix the wintab crash but we might want to fix this again in the future by improving the wintab initialization.
Thanks for the testing!