[gimp] app: don't request motion hints on the canvas
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: don't request motion hints on the canvas
- Date: Sat, 10 Dec 2011 22:24:05 +0000 (UTC)
commit 8569c6e2f7ebe2204bc01b682397f2cd125393d9
Author: Michael Natterer <mitch gimp org>
Date: Sat Dec 10 23:22:08 2011 +0100
app: don't request motion hints on the canvas
They are a dark ages concept, and it's almost 2012.
app/display/gimpdisplayshell-tool-events.c | 30 ----------------------------
app/display/gimpdisplayshell.c | 13 +++++------
app/tools/gimptoolcontrol.c | 4 +-
app/tools/tools-enums.h | 1 -
4 files changed, 8 insertions(+), 40 deletions(-)
---
diff --git a/app/display/gimpdisplayshell-tool-events.c b/app/display/gimpdisplayshell-tool-events.c
index 7de6579..0ce60b9 100644
--- a/app/display/gimpdisplayshell-tool-events.c
+++ b/app/display/gimpdisplayshell-tool-events.c
@@ -444,7 +444,6 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas,
case GDK_BUTTON_PRESS:
{
GdkEventButton *bevent = (GdkEventButton *) event;
- GimpTool *active_tool;
/* ignore new mouse events */
if (gimp->busy || shell->scrolling || shell->pointer_grabbed)
@@ -480,8 +479,6 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas,
gimp_display_shell_update_cursor (shell, &display_coords,
&image_coords, state, FALSE);
- active_tool = tool_manager_get_active (gimp);
-
if (gdk_event_triggers_context_menu (event))
{
GimpUIManager *ui_manager;
@@ -509,30 +506,6 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas,
}
else if (bevent->button == 1)
{
- GdkEventMask event_mask = (GDK_BUTTON1_MOTION_MASK |
- GDK_BUTTON_RELEASE_MASK);
-
- if (active_tool &&
- (! shell->display->config->perfect_mouse ||
- (gimp_tool_control_get_motion_mode (active_tool->control) !=
- GIMP_MOTION_MODE_EXACT)))
- {
- GdkDisplay *gdk_display = gtk_widget_get_display (canvas);
- GimpDeviceManager *manager;
-
- manager = gimp_devices_get_manager (gimp);
-
- /* don't request motion hins for XInput devices because
- * the wacom driver is known to report crappy hints
- * (#6901) --mitch
- */
- if (gimp_device_manager_get_current_device (manager)->device ==
- gdk_display_get_core_pointer (gdk_display))
- {
- event_mask |= GDK_POINTER_MOTION_HINT_MASK;
- }
- }
-
if (! gimp_display_shell_pointer_grab (shell, NULL, 0))
return TRUE;
@@ -837,9 +810,6 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas,
}
}
- /* Ask for more motion events in case the event was a hint */
- gdk_event_request_motions (mevent);
-
/* call proximity_in() here because the pointer might already
* be in proximity when the canvas starts to receive events,
* like when a new image has been created into an empty
diff --git a/app/display/gimpdisplayshell.c b/app/display/gimpdisplayshell.c
index f03de66..a39957f 100644
--- a/app/display/gimpdisplayshell.c
+++ b/app/display/gimpdisplayshell.c
@@ -317,13 +317,12 @@ gimp_display_shell_init (GimpDisplayShell *shell)
shell->zoom_focus_pointer_queue = g_queue_new ();
- gtk_widget_set_events (GTK_WIDGET (shell), (GDK_POINTER_MOTION_MASK |
- GDK_POINTER_MOTION_HINT_MASK |
- GDK_BUTTON_PRESS_MASK |
- GDK_KEY_PRESS_MASK |
- GDK_KEY_RELEASE_MASK |
- GDK_FOCUS_CHANGE_MASK |
- GDK_VISIBILITY_NOTIFY_MASK |
+ gtk_widget_set_events (GTK_WIDGET (shell), (GDK_POINTER_MOTION_MASK |
+ GDK_BUTTON_PRESS_MASK |
+ GDK_KEY_PRESS_MASK |
+ GDK_KEY_RELEASE_MASK |
+ GDK_FOCUS_CHANGE_MASK |
+ GDK_VISIBILITY_NOTIFY_MASK |
GDK_SCROLL_MASK));
/* zoom model callback */
diff --git a/app/tools/gimptoolcontrol.c b/app/tools/gimptoolcontrol.c
index 071dc27..58c29f2 100644
--- a/app/tools/gimptoolcontrol.c
+++ b/app/tools/gimptoolcontrol.c
@@ -51,7 +51,7 @@ gimp_tool_control_init (GimpToolControl *control)
control->handle_empty_image = FALSE;
control->dirty_mask = GIMP_DIRTY_NONE;
- control->motion_mode = GIMP_MOTION_MODE_HINT;
+ control->motion_mode = GIMP_MOTION_MODE_EXACT;
control->auto_snap_to = TRUE;
control->snap_offset_x = 0;
@@ -234,7 +234,7 @@ gimp_tool_control_set_motion_mode (GimpToolControl *control,
GimpMotionMode
gimp_tool_control_get_motion_mode (GimpToolControl *control)
{
- g_return_val_if_fail (GIMP_IS_TOOL_CONTROL (control), GIMP_MOTION_MODE_HINT);
+ g_return_val_if_fail (GIMP_IS_TOOL_CONTROL (control), GIMP_MOTION_MODE_EXACT);
return control->motion_mode;
}
diff --git a/app/tools/tools-enums.h b/app/tools/tools-enums.h
index 2bcdc33..a8fd663 100644
--- a/app/tools/tools-enums.h
+++ b/app/tools/tools-enums.h
@@ -161,7 +161,6 @@ typedef enum /*< skip >*/
typedef enum /*< skip >*/
{
GIMP_MOTION_MODE_EXACT,
- GIMP_MOTION_MODE_HINT,
GIMP_MOTION_MODE_COMPRESS
} GimpMotionMode;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]