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.
This commit is contained in:
Xavier Del Campo Romero 2022-03-10 22:31:51 +01:00
parent f89a108af4
commit 9736fe5183
Signed by: xavi
GPG Key ID: 84FF3612A9BF43F2
1 changed files with 7 additions and 0 deletions

View File

@ -76,6 +76,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);
@ -109,6 +111,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;