-
amogus
exfat better
-
betarays
> exfat better UDF better ↺
-
mesonium
regarding the media browser: `ScrolledWindow -> GridView -> SignalListItemFactory + Gio.ListStore model` The model contains eg ~ 100 messages, the factory creates bare widgets and on bind the widget loads the preview from the model data. The bare widgets have a minimal size (eg 400x400). > The ListItemFactory is tasked with creating widgets for items taken from the model when the views need them I've expected that only slightly more widgets are created than fit into the view, however on appending items to the model, the factory creates new widgets and binds them, so in the end for all 100. Is that behaviour correct and I got something wrong or may I have done a mistake?
-
lovetox
no that seems correct
-
lovetox
these views are for data models that have 10.000 or 100.000 entries
-
lovetox
my experience is they load ~ 200 entries
-
lovetox
but i read you can somehow implement lazy loading
-
lovetox
or rather asynchron loading
-
mesonium
that's what would definitly like to do, but I thought lazy loading is kind of built in. https://gtk-rs.org/gtk4-rs/stable/latest/book/list_widgets.html > What makes this concept scalable is that GTK only has to create slightly more widgets than we can currently look at. As we scroll through our elements, the widgets which become invisible will be reused.✎ -
mesonium
that's what would definitly like to do, but I thought lazy loading is kind of built in. https://gtk-rs.org/gtk4-rs/stable/latest/book/list_widgets.html#views > What makes this concept scalable is that GTK only has to create slightly more widgets than we can currently look at. As we scroll through our elements, the widgets which become invisible will be reused. ✏
-
lovetox
i did not look at the code
-
lovetox
but i doubt they calculate what you see, its simply some kind of hard coded or calculated offset
-
lovetox
with the start chat dialog, they load 200 rows
-
lovetox
when i see 10
-
lovetox
but this still makes sense if you think this widget is for a dataset of 10.000 or more
-
lovetox
they need to load many items in both directions, because you can scroll very fast
-
lovetox
if you want inifite smooth scrolling
-
lovetox
you need to have items preloaded, and if i can scroll 50 items in 100 ms
-
lovetox
i cannot only hold 10 items in both directions in the buffer
-
lovetox
but if you start loading from the harddrive, i think you need to go a different way, like the widget probably needs to make the file access async, and only display the image later
-
lovetox
so the model probably holds only the path, and the widget loads the image once its bound to the model
-
lovetox
but with a async load method
-
lovetox
or you check out other gtk examples where they load image galleries, i guess there are a few apps for this in the gnome env
-
lovetox
you can also ask in the gtk dev matrix channel
-
mesonium
> so the model probably holds only the path, and the widget loads the image once its bound to the model yes, that's more or less how I do it in the moment. The model holds the message object > but with a async load method loading is actually quiet fast (at least on a nvme) but creating preview images, when they are missing, is a blocker Nontheless, for memory concers it would be nicer anyway to hold less than 200 at once in memory.
-
mesonium
> you can also ask in the gtk dev matrix channel Thanks, I will definitely do that.
-
lovetox
what do you mean with creating a preview?
-
mesonium
when you've downloaded an image, but the preview is missing in cache
-
mesonium
the thumbnail
-
lovetox
but thats a one time job
-
lovetox
i mean yeah, we need to solve that, probably also thumbnail generation we need to do in a thread
-
mesonium
but if you start doing that for many, it block the gui thread✎ -
mesonium
but if you start doing that for many, it blocks the gui thread ✏
-
lovetox
but that should be easy
-
lovetox
or even separate processes, https://docs.python.org/3/library/multiprocessing.html
-
mesonium
I had done that actually while I was writing the video prieview stuff, but had dumped it it again later
-
mesonium
* with threads, not multiprocess
-
lovetox
im not an expert on this topic, but thread is not good for cpu bound work
-
lovetox
thread is only good for I/O
-
lovetox
for cpu bound work you should use a separate process
-
mesonium
ok
-
lovetox
the reason is that in python there is a global interpreter lock, means python can in one process only do one thing, even if you have threads
-
lovetox
if you have threads it just context switches between the the different threads
-
lovetox
but can only execute one at a time
-
lovetox
if you have a separate process, its completely independent,
-
lovetox
the downside with processes is if you have to pass data between them
-
mesonium
right. The GIL might fall in the future, but we will see. I will check out the multiprocess approach and see if we can use it
-
lovetox
but we dont in this instance so its perfect
-
lovetox
and processes cost more in terms of resources, are slower to start up etc
-
lovetox
but all these downsides dont matter for our use case
-
mesonium
another thing I need to check: it seems GridView makes all cells to be equaled size in width / height. I'm afraid I will have to use a custom layout manager and somehow connect it to the ScrolledWindow, but if if control more the view, maybe there's a way to signal the ItemFactory when create widgets. However, I already feel like this could become complicated, so I'm not sure about it. For images I would like to have something like this in the end: https://demo.immich.app/photos
-
mesonium
right now it's like this:
-
mesonium
https://share.conversations.im/meeson_/jnCvaKFDsUcvk6L8/Screenshot_20250218_210240.png
-
lovetox
i think this is impossible with a gridview
-
mesonium
so you'd suggest not to use a gridview + layoutmanager, but instead...?
-
lovetox
No i have no idea, seems just not the use case for a gridview
-
lovetox
i have no idea how to solve that
-
lovetox
You would need to ask for help from the GTK Devs
-
mesonium
Alright
-
lovetox
you probably want also the functionality of a Gtk.FlowBox
-
lovetox
so pictures flow to different rows when you resize the window
-
lovetox
but to be honest, i would also fine with pictures all having the same size
-
mesonium
yes
-
lovetox
really, i dont think its necessary that you compare our media browser to a dedicated photo archiving software
-
lovetox
people just want to find fast images, and not do photo show for their family in Gajim
-
mesonium
yeah, I wanted to have a compact representation without wasting much space and if possible without cutting away too much from a picuture to make things fit. I will likely go with an easy solution first and then if that works and I got time, we can see if it's worth adding more complexity.
👍 1 -
lissine
FYI, I just had the same bug that was described by jjj333_p (any pronouns) recently, about not being able to leave a room. Gajim is not sending an unavailable presence to the room when I click the x button I'm running v1.9.5
-
lissine
The `Are you sure you want to leave this group chat` pop up doesn't show up. And no `presence unavailable` is sent to the group chat (I checked the XML console)
-
lissine
In fact, I have a PM chat with a participant in the channel, and Gajim shows a colored dot on its avatar, indicating it has its presence.
-
lissine
When a new message is received, the channel pops up again in the chat list.
-
lissine
And, interestingly, if I try to open the chat from the `Start Chat` menu, it shows me the menu with the channel info and the blue `join` button.
-
lissine
This indicates that there's an inconsistency in Gajim's state. As it thinks it's not joined to the chat when it in fact is.
-
lissine
Do you want me to copy the above in an issue?
-
lissine
(if a group chat is already joined, Gajim doesn't show the menu with its info and the `join` button, but opens it directly)
-
lovetox
yeah please copy it in a image
👍 1 -
lovetox
but this is in 1.9.5
-
lovetox
hm
-
lovetox
so you click the x, and the chat closes?
-
lovetox
but on next message it pops up again?
-
lissine
yes
-
lovetox
and i guess if you restart you client, and then try to leave the chat it works?
-
lissine
I didn't try, but my guess is: yes
-
lovetox
my assumption is gajim does think we are not joined anymore
-
lovetox
but server thinks different
-
mesonium
> with the start chat dialog, they load 200 rows Just checked: from a model with 400 messages, 160 widgets are created and bound in the gridview. When scrolling 60 new widgets are created and 60 get unbound✎ ↺ -
mesonium
> with the start chat dialog, they load 200 rows Just checked: from a model with 400 messages, 160 widgets are created and bound in the gridview. When scrolling 60 new widgets get bound and 60 get unbound ✏ ↺
-
lissine
> my assumption is gajim does think we are not joined anymore The channel in question is this one :) How am I able to send messages while Gajim thinks it's not joined to the room? ↺
-
Schimon
https://xmpp.pimux.de/file_share/cb0dbf53-ab70-4196-a91e-c953af8eaaa2/scrot-rofi_20250218-224057.png
-
Schimon
I think, that it would be nice to have a toggle button instead of check box in Data Forms.✎ -
Schimon
I think, that it would be nice to have a toggle button ( I \ O )instead of check box in Data Forms. ✏
-
Schimon
I think, that it would be nice to have a toggle button ( I \ O ) instead of check box in Data Forms. ✏
-
Schimon
I think, that it would be nice to have a toggle button ( I : O ) instead of check box in Data Forms. ✏
-
lissine
I created an issue and added more details: The issue persists after closing Gajim and reopening it. But, if I join the channel from the start chat menu, the issue stops happening.
-
lissine
I can leave the channel normally then.
-
lissine
Could it be some race condition, where you receive a message from the room while in the process of leaving it, and that breaks some state in Gajim?
-
lovetox
hm maybe, have to look at it
-
lovetox
but then it would not be easy to reproduce