Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/xwt.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLluis Sanchez <lluis@xamarin.com>2013-10-11 11:57:02 +0400
committerLluis Sanchez <lluis@xamarin.com>2013-10-11 11:57:02 +0400
commite5039036f61623d282caff8951b43f3714907cc0 (patch)
tree330fb5c875e1b633df1765217d511d3f312b0588 /Xwt.Gtk
parentd7db244af2e5038a2666a43b9ac72bbedac47e9b (diff)
[GTK] Mouse position calculation fixes
Diffstat (limited to 'Xwt.Gtk')
-rw-r--r--Xwt.Gtk/Xwt.GtkBackend/WidgetBackend.cs16
1 files changed, 6 insertions, 10 deletions
diff --git a/Xwt.Gtk/Xwt.GtkBackend/WidgetBackend.cs b/Xwt.Gtk/Xwt.GtkBackend/WidgetBackend.cs
index 53aa2ede..f4135a41 100644
--- a/Xwt.Gtk/Xwt.GtkBackend/WidgetBackend.cs
+++ b/Xwt.Gtk/Xwt.GtkBackend/WidgetBackend.cs
@@ -711,10 +711,9 @@ namespace Xwt.GtkBackend
[GLib.ConnectBefore]
void HandleScrollEvent(object o, Gtk.ScrollEventArgs args)
{
- var sc = ConvertToScreenCoordinates (new Point (0, 0));
var direction = args.Event.Direction.ToXwtValue ();
- var a = new MouseScrolledEventArgs ((long) args.Event.Time, args.Event.XRoot - sc.X, args.Event.YRoot - sc.Y, direction);
+ var a = new MouseScrolledEventArgs ((long) args.Event.Time, args.Event.X, args.Event.Y, direction);
ApplicationContext.InvokeUserCode (delegate {
EventSink.OnMouseScrolled(a);
});
@@ -759,8 +758,7 @@ namespace Xwt.GtkBackend
void HandleMotionNotifyEvent (object o, Gtk.MotionNotifyEventArgs args)
{
- var sc = ConvertToScreenCoordinates (new Point (0, 0));
- var a = new MouseMovedEventArgs ((long) args.Event.Time, args.Event.XRoot - sc.X, args.Event.YRoot - sc.Y);
+ var a = new MouseMovedEventArgs ((long) args.Event.Time, args.Event.X, args.Event.Y);
ApplicationContext.InvokeUserCode (delegate {
EventSink.OnMouseMoved (a);
});
@@ -770,10 +768,9 @@ namespace Xwt.GtkBackend
void HandleButtonReleaseEvent (object o, Gtk.ButtonReleaseEventArgs args)
{
- var sc = ConvertToScreenCoordinates (new Point (0, 0));
var a = new ButtonEventArgs ();
- a.X = args.Event.XRoot - sc.X;
- a.Y = args.Event.YRoot - sc.Y;
+ a.X = args.Event.X;
+ a.Y = args.Event.Y;
a.Button = (PointerButton) args.Event.Button;
ApplicationContext.InvokeUserCode (delegate {
EventSink.OnButtonReleased (a);
@@ -785,10 +782,9 @@ namespace Xwt.GtkBackend
[GLib.ConnectBeforeAttribute]
void HandleButtonPressEvent (object o, Gtk.ButtonPressEventArgs args)
{
- var alloc = Widget.Allocation;
var a = new ButtonEventArgs ();
- a.X = args.Event.X;// - alloc.X;
- a.Y = args.Event.Y;// - alloc.Y;
+ a.X = args.Event.X;
+ a.Y = args.Event.Y;
a.Button = (PointerButton) args.Event.Button;
if (args.Event.Type == Gdk.EventType.TwoButtonPress)