summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2ec2d4e)
raw | patch | inline | side by side (parent: 2ec2d4e)
author | buliabyak <buliabyak@users.sourceforge.net> | |
Tue, 11 Aug 2009 01:40:49 +0000 (01:40 +0000) | ||
committer | buliabyak <buliabyak@users.sourceforge.net> | |
Tue, 11 Aug 2009 01:40:49 +0000 (01:40 +0000) |
index 985e3ac5153cecf1194f03502a2d4db8bacbdbc5..aa17ea8597a960a570aad2767670bdbdd17a0ada 100644 (file)
--- a/src/dropper-context.cpp
+++ b/src/dropper-context.cpp
SPDropperContext *dc = SP_DROPPER_CONTEXT(ec);
ec->enableGrDrag(false);
+
+ if (dc->grabbed) {
+ sp_canvas_item_ungrab(dc->grabbed, GDK_CURRENT_TIME);
+ dc->grabbed = NULL;
+ }
if (dc->area) {
gtk_object_destroy(GTK_OBJECT(dc->area));
@@ -171,6 +176,12 @@ static gint sp_dropper_context_root_handler(SPEventContext *event_context, GdkEv
dc->dragging = TRUE;
ret = TRUE;
}
+
+ sp_canvas_item_grab(SP_CANVAS_ITEM(desktop->acetate),
+ GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK,
+ NULL, event->button.time);
+ dc->grabbed = SP_CANVAS_ITEM(desktop->acetate);
+
break;
case GDK_MOTION_NOTIFY:
if (event->motion.state & GDK_BUTTON2_MASK) {
@@ -311,6 +322,11 @@ static gint sp_dropper_context_root_handler(SPEventContext *event_context, GdkEv
{
sp_canvas_item_hide(dc->area);
dc->dragging = FALSE;
+
+ if (dc->grabbed) {
+ sp_canvas_item_ungrab(dc->grabbed, event->button.time);
+ dc->grabbed = NULL;
+ }
double alpha_to_set = setalpha? dc->alpha : 1.0;
diff --git a/src/dropper-context.h b/src/dropper-context.h
index 678ab6b47f875abe861cbec70545bee93c37e36e..64181e3c8764860e4d438cfdbecc5ea7ca1d04e4 100644 (file)
--- a/src/dropper-context.h
+++ b/src/dropper-context.h
unsigned int dragging : 1;
+ SPCanvasItem *grabbed;
SPCanvasItem *area;
Geom::Point centre;
diff --git a/src/node-context.cpp b/src/node-context.cpp
index a0fb78ba19cd737a7e1c273d79de5b86b37bbc78..3535ae9e0c7be19a73b74b40897db22a00047c55 100644 (file)
--- a/src/node-context.cpp
+++ b/src/node-context.cpp
SPEventContext *ec = SP_EVENT_CONTEXT(object);
ec->enableGrDrag(false);
+
+ if (nc->grabbed) {
+ sp_canvas_item_ungrab(nc->grabbed, GDK_CURRENT_TIME);
+ nc->grabbed = NULL;
+ }
nc->sel_changed_connection.disconnect();
nc->sel_changed_connection.~connection();
event->button.y);
Geom::Point const button_dt(desktop->w2d(button_w));
Inkscape::Rubberband::get(desktop)->start(desktop, button_dt);
+
+ sp_canvas_item_grab(SP_CANVAS_ITEM(desktop->acetate),
+ GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK,
+ NULL, event->button.time);
+ nc->grabbed = SP_CANVAS_ITEM(desktop->acetate);
+
nc->current_state = SP_NODE_CONTEXT_INACTIVE;
desktop->updateNow();
ret = TRUE;
}
ret = TRUE;
Inkscape::Rubberband::get(desktop)->stop();
+
+ if (nc->grabbed) {
+ sp_canvas_item_ungrab(nc->grabbed, event->button.time);
+ nc->grabbed = NULL;
+ }
+
desktop->updateNow();
nc->rb_escaped = false;
nc->drag = FALSE;
diff --git a/src/node-context.h b/src/node-context.h
index 0e141274f635c96b8623888faa73aa09458e509a..2345ffc7e798d7359aab7bc8eed6b3f8e37979b7 100644 (file)
--- a/src/node-context.h
+++ b/src/node-context.h
unsigned int current_state;
SPItem * flashed_item;
+ SPCanvasItem *grabbed;
Inkscape::Display::TemporaryItem * flash_tempitem;
int remove_flash_counter;
};
diff --git a/src/zoom-context.cpp b/src/zoom-context.cpp
index 2f0185731073dbb6dd0c94304bb6525fc6beaf22..f8212069e11e4398b160ccad45c51c6887307620 100644 (file)
--- a/src/zoom-context.cpp
+++ b/src/zoom-context.cpp
#include "macros.h"
#include "rubberband.h"
+#include "display/sp-canvas-util.h"
#include "desktop.h"
#include "pixmaps/cursor-zoom.xpm"
#include "pixmaps/cursor-zoom-out.xpm"
static void
sp_zoom_context_finish (SPEventContext *ec)
{
+ SPZoomContext *zc = SP_ZOOM_CONTEXT(ec);
+
ec->enableGrDrag(false);
+
+ if (zc->grabbed) {
+ sp_canvas_item_ungrab(zc->grabbed, GDK_CURRENT_TIME);
+ zc->grabbed = NULL;
+ }
}
static void sp_zoom_context_setup(SPEventContext *ec)
@@ -119,6 +127,8 @@ static gint sp_zoom_context_root_handler(SPEventContext *event_context, GdkEvent
{
SPDesktop *desktop = event_context->desktop;
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
+
+ SPZoomContext *zc = SP_ZOOM_CONTEXT(event_context);
tolerance = prefs->getIntLimited("/options/dragtolerance/value", 0, 0, 100);
double const zoom_inc = prefs->getDoubleLimited("/options/zoomincrement/value", M_SQRT2, 1.01, 10);
@@ -147,6 +157,12 @@ static gint sp_zoom_context_root_handler(SPEventContext *event_context, GdkEvent
desktop->zoom_relative_keep_point(button_dt, zoom_rel);
ret = TRUE;
}
+
+ sp_canvas_item_grab(SP_CANVAS_ITEM(desktop->acetate),
+ GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK,
+ NULL, event->button.time);
+ zc->grabbed = SP_CANVAS_ITEM(desktop->acetate);
+
break;
}
@@ -188,6 +204,12 @@ static gint sp_zoom_context_root_handler(SPEventContext *event_context, GdkEvent
ret = TRUE;
}
Inkscape::Rubberband::get(desktop)->stop();
+
+ if (zc->grabbed) {
+ sp_canvas_item_ungrab(zc->grabbed, event->button.time);
+ zc->grabbed = NULL;
+ }
+
xp = yp = 0;
escaped = false;
break;
diff --git a/src/zoom-context.h b/src/zoom-context.h
index aadba9551cbe544b11535768f7bb7f6678750b76..133267135a6f39acb19d40e814074eab3431d1de 100644 (file)
--- a/src/zoom-context.h
+++ b/src/zoom-context.h
struct SPZoomContext {
SPEventContext event_context;
+ SPCanvasItem *grabbed;
};
struct SPZoomContextClass {