aboutsummaryrefslogtreecommitdiff
path: root/main/src
diff options
context:
space:
mode:
authorselurvedu <selurvedu@users.noreply.github.com>2020-04-22 02:10:31 +0000
committerfiaxh <fiaxh@users.noreply.github.com>2020-04-22 20:13:24 +0200
commita74d44ad93fdbf637d6eccc7a116639287db207c (patch)
treefb6e208347e2bbadfeb96113c83d51184df50715 /main/src
parent1f4899df166e35e1f10d811323c4a4933e824723 (diff)
downloaddino-a74d44ad93fdbf637d6eccc7a116639287db207c.tar.gz
dino-a74d44ad93fdbf637d6eccc7a116639287db207c.zip
Fix mouse hover highlighting the wrong message
Fixes #795.
Diffstat (limited to 'main/src')
-rw-r--r--main/src/ui/conversation_content_view/conversation_view.vala9
1 files changed, 5 insertions, 4 deletions
diff --git a/main/src/ui/conversation_content_view/conversation_view.vala b/main/src/ui/conversation_content_view/conversation_view.vala
index 07fa8945..1cf15892 100644
--- a/main/src/ui/conversation_content_view/conversation_view.vala
+++ b/main/src/ui/conversation_content_view/conversation_view.vala
@@ -128,11 +128,12 @@ public class ConversationView : Box, Plugins.ConversationItemCollection, Plugins
last_y_root = y_root;
- // Get pointer location in main
- int geometry_x, geometry_y, geometry_width, geometry_height, dest_x, dest_y;
+ int toplevel_window_pos_x, toplevel_window_pos_y, dest_x, dest_y;
Widget toplevel_widget = this.get_toplevel();
- toplevel_widget.get_window().get_geometry(out geometry_x, out geometry_y, out geometry_width, out geometry_height);
- toplevel_widget.translate_coordinates(main, x_root - geometry_x, y_root - geometry_y, out dest_x, out dest_y);
+ // Obtain the position of the main application window relative to the root window
+ toplevel_widget.get_window().get_origin(out toplevel_window_pos_x, out toplevel_window_pos_y);
+ // Get the pointer location relative to the `main` box
+ toplevel_widget.translate_coordinates(main, x_root - toplevel_window_pos_x, y_root - toplevel_window_pos_y, out dest_x, out dest_y);
// Get widget under pointer
int h = 0;