summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-10-06 23:43:10 +0200
committerLennart Poettering <lennart@poettering.net>2009-10-07 00:39:47 +0200
commitff02074558d23fc2ebc992e83073815a7c9141e8 (patch)
tree47b73630343f45d4a75eb52d7ad611d54607a6e1
parent7ca175c463cd6edfeca47cd5de6b554427951347 (diff)
gtk: fix calculation of event hpos/vpos
-rw-r--r--src/canberra-gtk.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/canberra-gtk.c b/src/canberra-gtk.c
index cc6719b..b9de2fe 100644
--- a/src/canberra-gtk.c
+++ b/src/canberra-gtk.c
@@ -377,10 +377,10 @@ int ca_gtk_proplist_set_for_event(ca_proplist *p, GdkEvent *e) {
* libc applies locale information on the formatting of
* floating numbers. */
- if ((ret = ca_proplist_setf(p, CA_PROP_EVENT_MOUSE_HPOS, "%i.%03i", (int) (x/width), (int) (1000.0*x/width) % 1000)) < 0)
+ if ((ret = ca_proplist_setf(p, CA_PROP_EVENT_MOUSE_HPOS, "%i.%03i", (int) (x/(width-1)), (int) (1000.0*x/(width-1)) % 1000)) < 0)
return ret;
- if ((ret = ca_proplist_setf(p, CA_PROP_EVENT_MOUSE_VPOS, "%i.%03i", (int) (y/height), (int) (1000.0*y/height) % 1000)) < 0)
+ if ((ret = ca_proplist_setf(p, CA_PROP_EVENT_MOUSE_VPOS, "%i.%03i", (int) (y/(height-1)), (int) (1000.0*y/(height-1)) % 1000)) < 0)
return ret;
}
}