summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@redhat.com>2006-07-15 01:14:53 -0400
committerKristian Høgsberg <krh@redhat.com>2006-07-15 01:14:53 -0400
commit86a22797c7970393095ac678619dbad042d0a81b (patch)
treec338ba21cbe96edce753d2124c8b71e49f7daad1
parent5447070929c00935f9c539ea3f87a8673907017d (diff)
Add icon throwing from tibrisch.
-rw-r--r--dock.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/dock.c b/dock.c
index 87118de..f6df955 100644
--- a/dock.c
+++ b/dock.c
@@ -73,6 +73,7 @@ struct _KibaDock
int drag_offset_y;
int drag_distance;
KibaLauncher *dragging_launcher;
+ int dx, dy;
GConfClient *gconf_client;
};
@@ -607,6 +608,11 @@ kiba_dock_button_release_event (GtkWidget *widget,
if (dock->dragging_launcher && dock->drag_distance <= 1)
g_idle_add (kiba_launcher_exec, dock->dragging_launcher);
+ else
+ {
+ dock->dragging_launcher->object->previous_position.x -= dock->dx / 2;
+ dock->dragging_launcher->object->previous_position.y -= dock->dy / 2;
+ }
dock->dragging_launcher = NULL;
dock->mouse_anchor->object = NULL;
@@ -628,6 +634,9 @@ kiba_dock_motion_notify_event (GtkWidget *widget,
dx = new_x - dock->mouse_anchor->x;
dy = new_y - dock->mouse_anchor->y;
+ dock->dx = dx;
+ dock->dy = dy;
+
dock->mouse_anchor->x =
CLAMP (new_x, ICON_SIZE / 2, dock->geometry.width - ICON_SIZE /2 );
dock->mouse_anchor->y =