aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi.dcr@tutanota.com>2022-03-10 22:31:51 +0100
committerXavier Del Campo Romero <xavi.dcr@tutanota.com>2023-10-05 14:32:10 +0200
commit9736fe51834282adcbb58a1c793f7cfd14c6a8dc (patch)
tree4f137f99286c11a96e8b161821896b626f6dfb29
parentf89a108af45626c885d4f80c5adf62b44e82d7b6 (diff)
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.
-rw-r--r--main/src/ui/conversation_content_view/conversation_view.vala7
1 files changed, 7 insertions, 0 deletions
diff --git a/main/src/ui/conversation_content_view/conversation_view.vala b/main/src/ui/conversation_content_view/conversation_view.vala
index fb3bfc32..d7660488 100644
--- a/main/src/ui/conversation_content_view/conversation_view.vala
+++ b/main/src/ui/conversation_content_view/conversation_view.vala
@@ -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;