Commit de8c4c42 authored by Morten Welinder's avatar Morten Welinder

Canvas: simplify code.

parent 15e582fb
2016-01-16 Morten Welinder <terra@gnome.org>
* src/gnumeric-simple-canvas.c (gnm_simple_canvas_ungrab): Drop
unused time argument. All callers changed.
* src/item-bar.c (item_bar_button_pressed): Handle multiple clicks
without regrabbing the focus. See #760639.
......
......@@ -1160,7 +1160,7 @@ cb_pane_drag_end (GtkWidget *widget, GdkDragContext *context,
/* ungrab any grabbed item */
GocItem *item = goc_canvas_get_grabbed_item (GOC_CANVAS (source_pane));
if (item)
gnm_simple_canvas_ungrab (item, gtk_get_current_event_time ());
gnm_simple_canvas_ungrab (item);
/* sync the ctrl-pts with the object in case the drag was canceled. */
gnm_pane_objects_drag (source_pane, NULL,
source_pane->drag.origin_x,
......@@ -2680,7 +2680,7 @@ control_point_button_released (GocItem *item, int button, G_GNUC_UNUSED double x
so = g_object_get_data (G_OBJECT (item), "so");
idx = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (item), "index"));
pane->drag.button = 0;
gnm_simple_canvas_ungrab (item, gdk_event_get_time (event));
gnm_simple_canvas_ungrab (item);
gnm_pane_slide_stop (pane);
control_point_set_cursor (scg, item);
if (idx == 8)
......
......@@ -54,7 +54,7 @@ gnm_simple_canvas_new (SheetControlGUI *scg)
}
void
gnm_simple_canvas_ungrab (GocItem *item, guint32 etime)
gnm_simple_canvas_ungrab (GocItem *item)
{
GnmSimpleCanvas *gcanvas = GNM_SIMPLE_CANVAS(item->canvas);
......
......@@ -22,7 +22,7 @@ typedef struct {
GType gnm_simple_canvas_get_type (void);
GocCanvas *gnm_simple_canvas_new (SheetControlGUI *scg);
void gnm_simple_canvas_ungrab (GocItem *item, guint32 etime);
void gnm_simple_canvas_ungrab (GocItem *item);
int gnm_simple_canvas_grab (GocItem *item, unsigned int event_mask,
GdkCursor *cursor, guint32 etime);
......
......@@ -1116,7 +1116,7 @@ item_bar_button_released (GocItem *item, int button, double x, double y)
{
GnmItemBar *ib = GNM_ITEM_BAR (item);
if (item == goc_canvas_get_grabbed_item (item->canvas))
gnm_simple_canvas_ungrab (item, 0);
gnm_simple_canvas_ungrab (item);
if (ib->colrow_being_resized >= 0) {
if (ib->has_resize_guides)
......
......@@ -669,7 +669,7 @@ item_cursor_selection_motion (GocItem *item, double x_, double y_)
button = ic->drag_button;
ic->drag_button = -1;
gnm_simple_canvas_ungrab (item, gdk_event_get_time (event));
gnm_simple_canvas_ungrab (item);
scg_special_cursor_start (ic->scg, style, button);
special_cursor = pane->cursor.special;
......@@ -1149,7 +1149,7 @@ item_cursor_button2_pressed (GocItem *item, int button, double x_, double y_)
return TRUE;
ic->drag_button = -1;
gnm_simple_canvas_ungrab (item, gdk_event_get_time (event));
gnm_simple_canvas_ungrab (item);
if (sheet_is_region_empty (sheet, &ic->pos))
return TRUE;
......@@ -1364,7 +1364,7 @@ item_cursor_button_released (GocItem *item, int button, G_GNUC_UNUSED double x,
/* Double clicks may have already released the drag prep */
if (ic->drag_button >= 0) {
gnm_simple_canvas_ungrab (item, gdk_event_get_time (event));
gnm_simple_canvas_ungrab (item);
ic->drag_button = -1;
}
go_cmd_context_progress_message_set (GO_CMD_CONTEXT (wbcg),
......@@ -1376,7 +1376,7 @@ item_cursor_button_released (GocItem *item, int button, G_GNUC_UNUSED double x,
return TRUE;
gnm_pane_slide_stop (GNM_PANE (item->canvas));
gnm_simple_canvas_ungrab (item, gdk_event_get_time (event));
gnm_simple_canvas_ungrab (item);
item_cursor_do_drop (ic, event);
go_cmd_context_progress_message_set (GO_CMD_CONTEXT (wbcg),
......@@ -1392,7 +1392,7 @@ item_cursor_button_released (GocItem *item, int button, G_GNUC_UNUSED double x,
SheetControlGUI *scg = ic->scg;
gnm_pane_slide_stop (GNM_PANE (item->canvas));
gnm_simple_canvas_ungrab (item, gdk_event_get_time (event));
gnm_simple_canvas_ungrab (item);
cmd_autofill (scg_wbc (scg), scg_sheet (scg), default_increment,
ic->pos.start.col, ic->pos.start.row,
......
......@@ -1176,7 +1176,7 @@ item_grid_button_released (GocItem *item, int button, G_GNUC_UNUSED double x_, G
}
ig->selecting = GNM_ITEM_GRID_NO_SELECTION;
gnm_simple_canvas_ungrab (item, gdk_event_get_time (event));
gnm_simple_canvas_ungrab (item);
if (selecting == GNM_ITEM_GRID_SELECTING_FORMULA_RANGE)
gnm_expr_entry_signal_update (
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment