Philipp Hörist pushed to branch gtk4 at gajim / gajim
Commits:
32584f39 by Philipp Hörist at 2024-10-23T22:51:39+02:00
fix: Fix present_with_time
- - - - -
2 changed files:
- gajim/gtk/application.py
- gajim/gtk/notification.py
Changes:
=====================================
gajim/gtk/application.py
=====================================
@@ -36,7 +36,7 @@
from datetime import timezone
from urllib.parse import unquote
-from gi.repository import Gio
+from gi.repository import Gdk, Gio
from gi.repository import GLib
from gi.repository import Gtk
from nbxmpp import JID
@@ -803,9 +803,7 @@ def _on_open_event_action(_action: Gio.SimpleAction,
jid = JID.from_string(params.jid)
app.window.select_chat(params.account, jid)
- app.window.present()
- # app.window.present_with_time(Gtk.get_current_event_time())
- # TODO GTK4
+ app.window.present_with_time(Gdk.CURRENT_TIME)
@structs.actionmethod
def _on_mark_as_read_action(self,
=====================================
gajim/gtk/notification.py
=====================================
@@ -274,7 +274,7 @@ def _on_button_press(self,
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.window.present_with_time(Gdk.CURRENT_TIME)
app.app.activate_action(f'{self._event.account}-open-event',
params.to_variant())
@@ -360,7 +360,7 @@ def _on_activated(self, event: ToastActivatedEventArgs) ->
None:
# Calls need to be executed with GLib.idle_add to avoid threading
issues,
# because Toasts run in a different thread.
if event.arguments is None:
- GLib.idle_add(app.window.present_with_time,
Gtk.get_current_event_time())
+ GLib.idle_add(app.window.present_with_time, Gdk.CURRENT_TIME)
return
if event.arguments.startswith('open-event-'):
@@ -387,7 +387,7 @@ def _on_activated(self, event: ToastActivatedEventArgs) ->
None:
)
return
- GLib.idle_add(app.window.present_with_time,
Gtk.get_current_event_time())
+ GLib.idle_add(app.window.present_with_time, Gdk.CURRENT_TIME)
def _get_toast_image(self, event: events.Notification) -> ToastImage:
if event.type == 'incoming-message':
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/commit/32584f395dae2475399fb204df0e5a9ff3705924
--
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/commit/32584f395dae2475399fb204df0e5a9ff3705924
You're receiving this email because of your account on dev.gajim.org.
_______________________________________________
Commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]