From: auroux Date: Thu, 26 Nov 2009 06:56:47 +0000 (+0000) Subject: Make xinput available in win32 X-Git-Url: https://git.donarmstrong.com/?p=xournal.git;a=commitdiff_plain;h=7e0f130c69b3a36d665b269a7e9cd1560f77bb0b Make xinput available in win32 --- diff --git a/src/TODO b/src/TODO index 7368f33..64679ce 100644 --- a/src/TODO +++ b/src/TODO @@ -20,16 +20,20 @@ List of features to be implemented (not in any particular order) BUGS: ** lingering issues with synaptics touchpads? (#2872667) (DONE) - add patch 0.4.5-fix-synaptics-v1.patch (fix ButtonDown events) - - set device to Absolute mode at startup? (GDK doesn't expose API, + (todo) - set device to Absolute mode at startup? (GDK doesn't expose API, cf XSetDeviceMode() in /usr/include/X11/extensions/XInput.h) ** color picker into canvas doesn't work in GTK+ 2.16 (should disable xinput first?) ** PDF export crashes in 64-bit due to wrong types (#2897699) - (DONE) patch by Robert Buchholz + --- DONE --- patch by Robert Buchholz +** export to PDF should see cropbox size if smaller, and map the + cropbox -- not the entire page -- to the page area! (2009-11-18 forum) WIN32: - test further - write an installer +- bug: opening files with accents in name? +- bug: cairo-scaled-font in printing? (2009-11-18 bug tracker) PATCHES TO INCORPORATE: ** Italian translation (add_it_po.patch unless updated on tracker) diff --git a/src/main.c b/src/main.c index 54fd51d..4eda9ea 100644 --- a/src/main.c +++ b/src/main.c @@ -187,14 +187,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; } diff --git a/src/xo-callbacks.c b/src/xo-callbacks.c index 7bc531a..cf887c7 100644 --- a/src/xo-callbacks.c +++ b/src/xo-callbacks.c @@ -2816,7 +2816,9 @@ on_optionsUseXInput_activate (GtkMenuItem *menuitem, non-responsive). */ +#ifndef WIN32 if (!gtk_check_version(2, 17, 0)) { +#endif /* GTK+ 2.17 and later: everybody shares a single native window, so we'll never get any core events, and we might as well set extension events the way we're supposed to. Doing so helps solve @@ -2824,14 +2826,18 @@ on_optionsUseXInput_activate (GtkMenuItem *menuitem, events in 2.18 */ gtk_widget_set_extension_events(GTK_WIDGET (canvas), ui.use_xinput?GDK_EXTENSION_EVENTS_ALL:GDK_EXTENSION_EVENTS_NONE); +#ifndef WIN32 } else { +#endif /* GTK+ 2.16 and earlier: we only activate extension events on the canvas's parent GdkWindow. This allows us to keep receiving core events. */ gdk_input_set_extension_events(GTK_WIDGET(canvas)->window, GDK_POINTER_MOTION_MASK | GDK_BUTTON_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK, ui.use_xinput?GDK_EXTENSION_EVENTS_ALL:GDK_EXTENSION_EVENTS_NONE); +#ifndef WIN32 } +#endif update_mappings_menu(); }