]> git.donarmstrong.com Git - xournal.git/blobdiff - src/main.c
don't attempt to link with libX11 under MinGW
[xournal.git] / src / main.c
index 54fd51d404ae2f146019a5428f3d22710d7b12eb..20d48fd21ec9878234bc4ba881b49613409c8265 100644 (file)
@@ -1,3 +1,18 @@
+/*
+ *  This program is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This software is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
 #ifdef HAVE_CONFIG_H
 #  include <config.h>
 #endif
@@ -187,14 +202,14 @@ void init_stuff (int argc, char *argv[])
   dev_list = gdk_devices_list();
   while (dev_list != NULL) {
     device = (GdkDevice *)dev_list->data;
-    if (device != gdk_device_get_core_pointer()) {
+    if (device != gdk_device_get_core_pointer() && device->num_axes >= 2) {
       /* get around a GDK bug: map the valuator range CORRECTLY to [0,1] */
 #ifdef ENABLE_XINPUT_BUGFIX
       gdk_device_set_axis_use(device, 0, GDK_AXIS_IGNORE);
       gdk_device_set_axis_use(device, 1, GDK_AXIS_IGNORE);
 #endif
       gdk_device_set_mode(device, GDK_MODE_SCREEN);
-      if (g_str_has_suffix(device->name, "eraser"))
+      if (g_strrstr(device->name, "raser"))
         gdk_device_set_source(device, GDK_SOURCE_ERASER);
       can_xinput = TRUE;
     }