summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@redhat.com>2006-07-09 02:32:36 -0400
committerKristian Høgsberg <krh@redhat.com>2006-07-09 02:32:36 -0400
commit652ea75b88a109481a7a2492a448eff9f35d5973 (patch)
tree762ec416df3cdba846af8e2cc1ba3a93f5b5bd67
parentb8958ea8248d4067830b0770bd7d39b33d6aad5d (diff)
Bounce icon correctly according to dock orientation.
-rw-r--r--dock.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/dock.c b/dock.c
index c7336c6..f759f99 100644
--- a/dock.c
+++ b/dock.c
@@ -532,9 +532,17 @@ kiba_launcher_exec (gpointer data)
KibaLauncher *launcher = data;
char **argv;
GError *error = NULL;
+ const KibaDockLayoutData *d;
/* Bounce the icon. */
- launcher->object->previous_position.y += g_random_double_range (5, 10);
+ d = &kiba_dock_layout_data[launcher->dock->position];
+
+ if (d->orientation == GTK_ORIENTATION_VERTICAL)
+ launcher->object->previous_position.x +=
+ (d->halignment - 1) * g_random_double_range (5, 10);
+ else
+ launcher->object->previous_position.y +=
+ (d->valignment - 1) * g_random_double_range (5, 10);
/* FIXME: Support drag and drop on launchers with %U and %F */
/* FIXME: Use g_shell_quote or split or whatever it was... */