Commit Graph

19 Commits

Author SHA1 Message Date
b31729f821 app: expect event == NULL in gimp_device_info_get_event_coords().
The problem was not happening with the master code of
gimpdisplayshell-tool-events.c, but I encountered it in gimp-2-10 with
the layer picking code.
Even then, it still works, but I need to protect calls to
gdk_event_get_axis() to avoid CRITICALs.

(cherry picked from commit b1fe1675ce)

Note: this was not absolutely necessary on master (no CRITICALs), but I
can see that the same piece of code applies, so I may as well sync.
2019-01-08 14:46:07 +01:00
5f700549e7 Change the license URL from http://www.gnu.org/licenses/ to https:// 2018-07-11 23:29:46 +02:00
ecb99ab445 app: add the new distance, rotation and slider axes to GimpCoords
and add code to get them from events and devices.
2018-05-20 21:06:35 +02:00
89a4ea85ef app: port GimpDeviceManager and GimpDeviceInfo to GdkSeat
and also be smarter about what devices we enable by default: enable
all tablet devices and disable all things mouse, they can still be
enabled in the device dialog.
2018-05-20 21:06:35 +02:00
24d0886f57 app: extended device concept does not seem to exist in GTK+3.
We were keeping around a flag telling us if coordinates are extended or
not. In GTK+2, a device indeed had to be enabled. In GTK+3, I can see
that device with extended inputs are enabled by default (they always
have pressure, etc.). This flag is made useless.
2018-05-20 21:06:35 +02:00
97df7535a1 app: gimp_device_info_get_device_coords(): workaround for XI2 b0rk
for the time being, use gdk_window_get_device_position() instead of
gdk_device_get_axis() for X and Y, which gets rid of subpixel
coordinates, but at least returns values != 0. Also, don't ask
keyboard devices for coordinates.
2018-05-20 21:06:29 +02:00
9c9ba4895d app: always ask the master device for its axes or state 2018-05-20 21:06:28 +02:00
660a7aed16 app: formatting cleanup in the last commit 2015-12-29 17:08:51 +01:00
53eb8677ea app: Allow for mypaint tool to differentiate extended and non-extended events
This adds a boolean to GimpCoords struct that is true for enabled
extended non-mouse devices and false for all the rest allowing
the mypaint brush to override the the pressure sent to the paint library.
2015-12-29 15:44:53 +02:00
391de600f1 app: don't ignore return value
...of gtk_widget_translate_coordinates()
2013-11-07 12:28:28 +01:00
c7b9728cc8 app: make handling of coordinates more robust against broken input drivers
Initialize the axes[] array with zeros and change pressure curve
mapping to not try to "interpolate" shit like NaN and crash.
2012-09-05 11:36:44 +02:00
867da8f293 app: add gimp_context_get_foreground,background_pixel()
which takes a Babl format to convert from/to.
Include <gegl.h> in a million places.
2012-05-02 17:50:41 +02:00
01f92a3b48 app: get rid of server grabs for almost all canvas interaction
Because it's generally the right thing to do, and server grabs broke
badly with input devices / client side windows.

gimpdisplayshell-grab.c: change logic to only server-grab if an event
is passed to the pointer grab/ungrab functions, but always use
gtk_grab_add/remove() which is sufficient in most cases.

gimpdisplayshell-tool-events.c: have the grab functions grab the
server only for space-bar scrolling and do all tool interaction,
including ruler clicks, with gtk_grab_add/remove(). Refactor things
a bit to also use the grab API for button-2 scrolling.

gimpdeviceinfo-coords.c: transform the event's coords to the canvas'
coordinate system, they might come from a ruler now.

This fixes the following bugs:

Bug 645315 - gimp_display_shell_pointer_grab: gdk_pointer_grab failed...
Bug 644351 - Gimp misses some strokes especially when drawing fast
Bug 645747 - Gimp is now unusable on xfce4
2011-12-09 20:20:02 +01:00
1bff2c8df2 app: sprinkle const qualifiers in the tool event callback functions 2011-05-31 23:18:11 +02:00
92f130fbc3 app: also run device history coords through the axis mapping curve function 2011-02-06 13:26:25 +01:00
5caee48645 app: run all input axes through gimp_device_info_map_axis()
and let that function alone worry about whether there actually is a
curve for that axis.
2010-12-20 20:00:47 +01:00
2a92f57577 app: actually use the device's pressure curve to map the pressure axis
unfortunately i have no way of testing this, so please test...
2010-02-16 13:27:46 +01:00
828e4d8452 app: some formatting before real changes happen 2010-02-16 13:05:17 +01:00
5af05cce0b app: move the entire get-coords API from GimpDisplayShell to GimpDeviceInfo
because GimpDeviceInfo will soon apply curves to the axes. Also change
everything to speak in terms of GimpDeviceInfo instead of GdkDevice.
2010-02-16 13:00:46 +01:00