]> git.donarmstrong.com Git - xournal.git/blobdiff - src/xo-callbacks.c
don't attempt to link with libX11 under MinGW
[xournal.git] / src / xo-callbacks.c
index 0e8e02bdc47248619def955e9cf89713cc9c575c..a9fb39cf2f5759c861fc3712a764ddc88c7ce2d8 100644 (file)
@@ -1,3 +1,19 @@
+/*
+ *  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
@@ -2558,11 +2574,15 @@ on_canvas_enter_notify_event           (GtkWidget       *widget,
     /* re-enable input devices after they've been emergency-disabled
        by leave_notify */
   if (!gtk_check_version(2, 17, 0)) {
+    gdk_flush();
+    gdk_error_trap_push();
     for (dev_list = gdk_devices_list(); dev_list != NULL; dev_list = dev_list->next) {
       dev = GDK_DEVICE(dev_list->data);
       gdk_device_set_mode(dev, GDK_MODE_SCREEN);
     }
     ui.is_corestroke = ui.saved_is_corestroke;
+    gdk_flush();
+    gdk_error_trap_pop();
   }
   return FALSE;
 }
@@ -2580,13 +2600,17 @@ on_canvas_leave_notify_event           (GtkWidget       *widget,
 #endif
     /* emergency disable XInput to avoid segfaults (GTK+ 2.17) or 
        interface non-responsiveness (GTK+ 2.18) */
-  if (!gtk_check_version(2, 17, 0)) { 
+  if (!gtk_check_version(2, 17, 0)) {
+    gdk_flush();
+    gdk_error_trap_push();
     for (dev_list = gdk_devices_list(); dev_list != NULL; dev_list = dev_list->next) {
       dev = GDK_DEVICE(dev_list->data);
       gdk_device_set_mode(dev, GDK_MODE_DISABLED);
     }
     ui.saved_is_corestroke = ui.is_corestroke;
     ui.is_corestroke = TRUE;
+    gdk_flush();
+    gdk_error_trap_pop();
   }
   return FALSE;
 }