Gajim - 2025-02-18


  1. amogus

    exfat better

  2. betarays

    > exfat better UDF better

  3. 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?

  4. lovetox

    no that seems correct

  5. lovetox

    these views are for data models that have 10.000 or 100.000 entries

  6. lovetox

    my experience is they load ~ 200 entries

  7. lovetox

    but i read you can somehow implement lazy loading

  8. lovetox

    or rather asynchron loading

  9. 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.

  10. 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.

  11. lovetox

    i did not look at the code

  12. lovetox

    but i doubt they calculate what you see, its simply some kind of hard coded or calculated offset

  13. lovetox

    with the start chat dialog, they load 200 rows

  14. lovetox

    when i see 10

  15. lovetox

    but this still makes sense if you think this widget is for a dataset of 10.000 or more

  16. lovetox

    they need to load many items in both directions, because you can scroll very fast

  17. lovetox

    if you want inifite smooth scrolling

  18. lovetox

    you need to have items preloaded, and if i can scroll 50 items in 100 ms

  19. lovetox

    i cannot only hold 10 items in both directions in the buffer

  20. 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

  21. lovetox

    so the model probably holds only the path, and the widget loads the image once its bound to the model

  22. lovetox

    but with a async load method

  23. 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

  24. lovetox

    you can also ask in the gtk dev matrix channel

  25. 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.

  26. mesonium

    > you can also ask in the gtk dev matrix channel Thanks, I will definitely do that.

  27. lovetox

    what do you mean with creating a preview?

  28. mesonium

    when you've downloaded an image, but the preview is missing in cache

  29. mesonium

    the thumbnail

  30. lovetox

    but thats a one time job

  31. lovetox

    i mean yeah, we need to solve that, probably also thumbnail generation we need to do in a thread

  32. mesonium

    but if you start doing that for many, it block the gui thread

  33. mesonium

    but if you start doing that for many, it blocks the gui thread

  34. lovetox

    but that should be easy

  35. lovetox

    or even separate processes, https://docs.python.org/3/library/multiprocessing.html

  36. mesonium

    I had done that actually while I was writing the video prieview stuff, but had dumped it it again later

  37. mesonium

    * with threads, not multiprocess

  38. lovetox

    im not an expert on this topic, but thread is not good for cpu bound work

  39. lovetox

    thread is only good for I/O

  40. lovetox

    for cpu bound work you should use a separate process

  41. mesonium

    ok

  42. 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

  43. lovetox

    if you have threads it just context switches between the the different threads

  44. lovetox

    but can only execute one at a time

  45. lovetox

    if you have a separate process, its completely independent,

  46. lovetox

    the downside with processes is if you have to pass data between them

  47. 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

  48. lovetox

    but we dont in this instance so its perfect

  49. lovetox

    and processes cost more in terms of resources, are slower to start up etc

  50. lovetox

    but all these downsides dont matter for our use case

  51. 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

  52. mesonium

    right now it's like this:

  53. mesonium

    https://share.conversations.im/meeson_/jnCvaKFDsUcvk6L8/Screenshot_20250218_210240.png

  54. lovetox

    i think this is impossible with a gridview

  55. mesonium

    so you'd suggest not to use a gridview + layoutmanager, but instead...?

  56. lovetox

    No i have no idea, seems just not the use case for a gridview

  57. lovetox

    i have no idea how to solve that

  58. lovetox

    You would need to ask for help from the GTK Devs

  59. mesonium

    Alright

  60. lovetox

    you probably want also the functionality of a Gtk.FlowBox

  61. lovetox

    so pictures flow to different rows when you resize the window

  62. lovetox

    but to be honest, i would also fine with pictures all having the same size

  63. mesonium

    yes

  64. lovetox

    really, i dont think its necessary that you compare our media browser to a dedicated photo archiving software

  65. lovetox

    people just want to find fast images, and not do photo show for their family in Gajim

  66. 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
  67. 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

  68. 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)

  69. 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.

  70. lissine

    When a new message is received, the channel pops up again in the chat list.

  71. 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.

  72. 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.

  73. lissine

    Do you want me to copy the above in an issue?

  74. 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)

  75. lovetox

    yeah please copy it in a image

    👍 1
  76. lovetox

    but this is in 1.9.5

  77. lovetox

    hm

  78. lovetox

    so you click the x, and the chat closes?

  79. lovetox

    but on next message it pops up again?

  80. lissine

    yes

  81. lovetox

    and i guess if you restart you client, and then try to leave the chat it works?

  82. lissine

    I didn't try, but my guess is: yes

  83. lovetox

    my assumption is gajim does think we are not joined anymore

  84. lovetox

    but server thinks different

  85. 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

  86. 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

  87. 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?

  88. Schimon

    https://xmpp.pimux.de/file_share/cb0dbf53-ab70-4196-a91e-c953af8eaaa2/scrot-rofi_20250218-224057.png

  89. Schimon

    I think, that it would be nice to have a toggle button instead of check box in Data Forms.

  90. Schimon

    I think, that it would be nice to have a toggle button ( I \ O )instead of check box in Data Forms.

  91. Schimon

    I think, that it would be nice to have a toggle button ( I \ O ) instead of check box in Data Forms.

  92. Schimon

    I think, that it would be nice to have a toggle button ( I : O ) instead of check box in Data Forms.

  93. 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.

  94. lissine

    I can leave the channel normally then.

  95. 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?

  96. lovetox

    hm maybe, have to look at it

  97. lovetox

    but then it would not be easy to reproduce