From fe235628ae2e24499213030ba8b6533ad1ec1bc3 Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Thu, 10 Mar 2022 22:31:51 +0100 Subject: conversation_view.vala: update_highlight on touch event Mobile devices such as the PinePhone do not receive leave/enter events, so actions such as editing a previous message are not possible unless a keyboard shortcut is used, which not be as convenient or even possible under some DEs. This commit should not affect desktop platforms with mouse or touchpad. --- main/src/ui/conversation_content_view/conversation_view.vala | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'main/src') diff --git a/main/src/ui/conversation_content_view/conversation_view.vala b/main/src/ui/conversation_content_view/conversation_view.vala index d6cbed62..00140f53 100644 --- a/main/src/ui/conversation_content_view/conversation_view.vala +++ b/main/src/ui/conversation_content_view/conversation_view.vala @@ -73,6 +73,8 @@ public class ConversationView : Box, Plugins.ConversationItemCollection, Plugins // the pointer motion events as long as the pointer is above the message menu. // This ensures that the currently highlighted item remains unchanged when the pointer // reaches the overlapping part of a button. + main_wrap_event_box.events = EventMask.TOUCH_MASK; + main_wrap_event_box.touch_event.connect(on_touch_event); main_event_box.events = EventMask.POINTER_MOTION_MASK; main_event_box.motion_notify_event.connect(on_motion_notify_event); @@ -102,6 +104,11 @@ public class ConversationView : Box, Plugins.ConversationItemCollection, Plugins } } + private bool on_touch_event(Gdk.Event event) { + update_highlight((int)event.touch.x_root, (int)event.touch.y_root); + return false; + } + private bool on_enter_notify_event(Gdk.EventCrossing event) { update_highlight((int)event.x_root, (int)event.y_root); return false; -- cgit v1.2.3