[gimp] app: Removing code for making use of the X event history buffer
- From: Alexia Death <alexiade src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gimp] app: Removing code for making use of the X event history buffer
- Date: Sun, 20 Dec 2009 14:28:02 +0000 (UTC)
commit af4717e78f5bdf2773cb681c8ee1c5e0683cc85b
Author: Alexia Death <alexiadeath gmail com>
Date: Sun Dec 20 16:04:57 2009 +0200
app: Removing code for making use of the X event history buffer
X event history buffer is major source of problems. Almost all reports
about painting at an offset from the cursor in GIMP seem to originate
from history buffer bugs either at X or GTK level. There are device&X
combinations that work fine and there are others that are broken.
With current smothing the benefits of using the buffer are almost gone
and more exact does not always mean better to look at.
app/display/gimpdisplayshell-callbacks.c | 94 ++++--------------------------
1 files changed, 11 insertions(+), 83 deletions(-)
---
diff --git a/app/display/gimpdisplayshell-callbacks.c b/app/display/gimpdisplayshell-callbacks.c
index f9345a0..6071819 100644
--- a/app/display/gimpdisplayshell-callbacks.c
+++ b/app/display/gimpdisplayshell-callbacks.c
@@ -1311,8 +1311,6 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas,
(! gimp_image_is_empty (image) ||
gimp_tool_control_get_handle_empty_image (active_tool->control)))
{
- GdkTimeCoord **history_events;
- gint n_history_events;
/* if the first mouse button is down, check for automatic
* scrolling...
@@ -1326,89 +1324,19 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas,
gimp_display_shell_autoscroll_start (shell, state, mevent);
}
- /* gdk_device_get_history() has several quirks. First is
- * that events with borderline timestamps at both ends
- * are included. Because of that we need to add 1 to
- * lower border. The second is due to poor X event
- * resolution. We need to do -1 to ensure that the
- * amount of events between timestamps is final or
- * risk loosing some.
- */
- if ((gimp_tool_control_get_motion_mode (active_tool->control) ==
- GIMP_MOTION_MODE_EXACT) &&
- gdk_device_get_history (mevent->device, mevent->window,
- shell->last_read_motion_time + 1,
- mevent->time - 1,
- &history_events,
- &n_history_events))
+ /* Early removal of useless events saves CPU time. */
+ if (gimp_display_shell_eval_event (shell,
+ &image_coords,
+ active_tool->max_coord_smooth,
+ time))
{
- gint i;
-
- tool_manager_control_active (gimp, GIMP_TOOL_ACTION_PAUSE,
- display);
-
- for (i = 0; i < n_history_events; i++)
- {
- gimp_display_shell_get_time_coords (shell,
- mevent->device,
- history_events[i],
- &display_coords);
-
- /* GimpCoords passed to tools are ALWAYS in
- * image coordinates
- */
- gimp_display_shell_untransform_coordinate (shell,
- &display_coords,
- &image_coords);
-
- if (gimp_tool_control_get_snap_to (active_tool->control))
- {
- gint x, y, width, height;
-
- gimp_tool_control_get_snap_offsets (active_tool->control,
- &x, &y, &width, &height);
-
- gimp_display_shell_snap_coords (shell,
- &image_coords,
- x, y, width, height);
- }
-
- /* Early removal of useless events saves CPU time.
- */
- if (gimp_display_shell_eval_event (shell,
- &image_coords,
- active_tool->max_coord_smooth,
- history_events[i]->time))
- {
- gimp_display_shell_process_tool_event_queue (shell,
- state,
- history_events[i]->time);
- }
-
- shell->last_read_motion_time = history_events[i]->time;
- }
-
- tool_manager_control_active (gimp, GIMP_TOOL_ACTION_RESUME,
- display);
-
- gdk_device_free_history (history_events, n_history_events);
+ gimp_display_shell_process_tool_event_queue (shell,
+ state,
+ time);
}
- else
- {
- /* Early removal of useless events saves CPU time.
- */
- if (gimp_display_shell_eval_event (shell,
- &image_coords,
- active_tool->max_coord_smooth,
- time))
- {
- gimp_display_shell_process_tool_event_queue (shell,
- state,
- time);
- }
- shell->last_read_motion_time = time;
- }
+ shell->last_read_motion_time = time;
+
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]