From 518608a04e9304af5df55e92891ccc1897b7b40a Mon Sep 17 00:00:00 2001 From: James Magahern Date: Sat, 3 May 2025 21:45:17 -0700 Subject: [PATCH] attempt to resolve chatter problems --- src/application/main-window.vala | 6 ++++-- src/message-list/message-layout.vala | 17 +++++++++-------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/application/main-window.vala b/src/application/main-window.vala index 6ce22cc..9d8d7a7 100644 --- a/src/application/main-window.vala +++ b/src/application/main-window.vala @@ -39,8 +39,10 @@ public class MainWindow : Adw.ApplicationWindow if (conversation_guid == null) { transcript_view.message_list.model = null; } else { - transcript_view.message_list.model = new MessageListModel (conversation_guid); - Repository.get_instance().sync_conversation(conversation_guid); + if (transcript_view.message_list.model == null || transcript_view.message_list.model.conversation_guid != conversation_guid) { + transcript_view.message_list.model = new MessageListModel (conversation_guid); + Repository.get_instance().sync_conversation(conversation_guid); + } } } diff --git a/src/message-list/message-layout.vala b/src/message-list/message-layout.vala index 85e57fd..266534b 100644 --- a/src/message-list/message-layout.vala +++ b/src/message-list/message-layout.vala @@ -131,8 +131,6 @@ private class MessageLayout : Object private void draw_background(Snapshot snapshot) { - snapshot.save(); - var width = get_width(); var height = get_height(); var color = background_color; @@ -152,17 +150,20 @@ private class MessageLayout : Object }; snapshot.append_linear_gradient(bounds, start_point, end_point, stops); - - snapshot.restore(); } private void with_bubble_clip(Snapshot snapshot, Func func) { var width = get_width(); var height = get_height(); - var path = create_bubble_path(width, height, from_me); - snapshot.push_fill(path, Gsk.FillRule.WINDING); - func(snapshot); - snapshot.pop(); + + if (width > 10 && height > 10) { + var path = create_bubble_path(width, height, from_me); + snapshot.push_fill(path, Gsk.FillRule.WINDING); + func(snapshot); + snapshot.pop(); + } else { + func(snapshot); + } } private Gsk.Path create_bubble_path(float width, float height, bool tail_on_right = false)