From 41571de3caa1638cf87b27ec007867245a4cc176 Mon Sep 17 00:00:00 2001 From: Marek Kasik Date: Tue, 18 Aug 2015 16:41:52 +0200 Subject: Fix selection rectangle when user leaves window Use zero instead of negative values for coordinates of mouse events. https://bugzilla.gnome.org/show_bug.cgi?id=753765 --- plugins/rdp/vinagre-rdp-tab.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/rdp/vinagre-rdp-tab.c b/plugins/rdp/vinagre-rdp-tab.c index 690a580..1074a63 100644 --- a/plugins/rdp/vinagre-rdp-tab.c +++ b/plugins/rdp/vinagre-rdp-tab.c @@ -532,8 +532,8 @@ frdp_button_pressed (GtkWidget *widget, { frdp_event->flags |= event->type == GDK_BUTTON_PRESS ? PTR_FLAGS_DOWN : 0; - frdp_event->x = event->x; - frdp_event->y = event->y; + frdp_event->x = event->x < 0.0 ? 0.0 : event->x; + frdp_event->y = event->y < 0.0 ? 0.0 : event->y; g_queue_push_tail (priv->events, frdp_event); } @@ -599,8 +599,8 @@ frdp_scroll (GtkWidget *widget, if (frdp_event->flags != 0) { - frdp_event->x = event->x; - frdp_event->y = event->y; + frdp_event->x = event->x < 0.0 ? 0.0 : event->x; + frdp_event->y = event->y < 0.0 ? 0.0 : event->y; g_queue_push_tail (priv->events, frdp_event); } @@ -625,8 +625,8 @@ frdp_mouse_moved (GtkWidget *widget, frdp_event->type = FRDP_EVENT_TYPE_BUTTON; frdp_event->flags = PTR_FLAGS_MOVE; - frdp_event->x = event->x; - frdp_event->y = event->y; + frdp_event->x = event->x < 0.0 ? 0.0 : event->x; + frdp_event->y = event->y < 0.0 ? 0.0 : event->y; g_queue_push_tail (priv->events, frdp_event); -- cgit v0.12