Daniel Brötzmann pushed to branch master at gajim / gajim


Commits:
d7c25b18 by wurstsalat at 2022-01-28T18:36:56+01:00
Notifications: Windows improvements

- - - - -
55087e41 by wurstsalat at 2022-01-28T18:58:00+01:00
ChatControl: Remove unnecessary AdditionalDataDict

- - - - -
288ab807 by wurstsalat at 2022-01-28T18:59:03+01:00
BaseControl: Prevent mark as read when not active

Fixes #10751

- - - - -


3 changed files:

- gajim/gtk/controls/base.py
- gajim/gtk/controls/chat.py
- gajim/gtk/notification.py


Changes:

=====================================
gajim/gtk/controls/base.py
=====================================
@@ -1007,7 +1007,8 @@ def _on_autoscroll_changed(self,
             return
 
         self._jump_to_end_button.toggle(False)
-        app.window.mark_as_read(self.account, self.contact.jid)
+        if app.window.is_chat_active(self.account, self.contact.jid):
+            app.window.mark_as_read(self.account, self.contact.jid)
 
     def _on_jump_to_end(self, _button: Gtk.Button) -> None:
         self.scroll_to_end(force=True)
@@ -1212,6 +1213,9 @@ def add_message(self,
         if additional_data is None:
             additional_data = AdditionalDataDict()
 
+        chat_active = app.window.is_chat_active(
+            self.account, self.contact.jid)
+
         if self._allow_add_message():
             self.conversation_view.add_message(
                 text,
@@ -1246,9 +1250,6 @@ def add_message(self,
             if notify:
                 self._notify(name, text, tim, additional_data)
 
-            chat_active = app.window.is_chat_active(
-                self.account, self.contact.jid)
-
             if not chat_active:
                 if self.is_groupchat:
                     needs_highlight = message_needs_highlight(
@@ -1262,7 +1263,8 @@ def add_message(self,
 
             if chat_active and self._scrolled_view.get_autoscroll():
                 # Send chat marker if we’re actively following the chat
-                app.window.mark_as_read(self.account, self.contact.jid)
+                pass
+                #app.window.mark_as_read(self.account, self.contact.jid)
 
     def _notify(self,
                 name: str,


=====================================
gajim/gtk/controls/chat.py
=====================================
@@ -558,9 +558,6 @@ def add_message(self,
                     notify: bool = True
                     ) -> None:
 
-        if additional_data is None:
-            additional_data = AdditionalDataDict()
-
         if kind == 'incoming':
             name = self.contact.name
         else:


=====================================
gajim/gtk/notification.py
=====================================
@@ -152,6 +152,7 @@ def __init__(self, event: events.Notification, timeout: 
int) -> None:
         self.set_accept_focus(False)
         self.set_skip_taskbar_hint(True)
         self.set_decorated(False)
+        self.set_keep_above(True)
 
         self._timeout_id: Optional[int] = None
         self._event = event
@@ -221,6 +222,9 @@ def _on_button_press(self,
                                            sub_type=self._event.sub_type or '',
                                            account=self._event.account,
                                            jid=jid)
+            # present_with_time needs to be called at this instant in order to
+            # work on Windows
+            app.window.present_with_time(event.time)
             app.app.activate_action(f'app.{self._event.account}-open-event',
                                     params.to_variant())
 



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/compare/b53c508041e100e2d25c41a9de56d1511a49461c...288ab8073a5f9ee654d72f8c6339e46e9ed44a26

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/compare/b53c508041e100e2d25c41a9de56d1511a49461c...288ab8073a5f9ee654d72f8c6339e46e9ed44a26
You're receiving this email because of your account on dev.gajim.org.


_______________________________________________
Commits mailing list
[email protected]
https://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to