clipmap 1.6 max-texts-in-history vs max-menu-items?

andre at andreldm.com andre at andreldm.com
Fri Oct 1 00:11:12 CEST 2021


Hi Sylvain,
As the original author doesn't hang around anymore, I think Simon is the current maintainer, in any case the source code is the best reference.

I think your understanding of max-menu-items is correct, just to be sure, only max-texts-in-history that I think is about the number of items not bytes. Also notice in _clipman_history_add_item that it is used to truncated the in-memory list of all items, including images. With regards to writing to disk, yes the items history is persisted/loaded if "save-on-quit" is enabled.

Well, I don't know how this impacts your implementation, but I hope this helps.

Cheers,
Andre Miranda

Sep 29, 2021, 03:33 by sylvain at opensource-expert.com:

> Hi,
>  
>  I'm trying to figure out the purpose of max-menu-items vs the    max-texts-in-history?
>  
>  I'm modifying the code of clipman to handle Secure Item, this fork > https://gitlab.xfce.org/Sylvain/xfce4-clipman-plugin
>  I'm planing to submit a merge request for future version of clipman,    as my use of the PoC is satisfying.
>  
>  So during my journey in the code, it brings me to extensively    modifying the way items are stored in memory, still not altering the    existing behavior.
>  I disabled saving history to disk which is obviously not compatible    with secret non-disclosure.
>  
>  So the memory data structure in my fork has been changed to a GList    double linked list + I'm crafting a circular Indexes array to handle    my 
>  newly introduced index / ID on the stored item. So they can be    delete any item from history with an external cli by index:    ./clipman_cli.sh del 12
>  
>  The goal here was to avoid secret disclosure.
>  
>  I decided to keep indexes in a circular buffer of the same size of    the history (max-texts-in-history).
>  The indexes are kept to low ID values because I use them in the    preview of Secure Item: "🔐 SECURE %2d *********", item->id
>  My history size in memory is generally of 40 or 50 items, and I    generally handle at most 4 or 5 Secure Item in the history at the    same time.
>  Some Secure Item are ephemeral so are going out quite quickly.    Keeping ID low also helps human to figure out which secret is the    one hidden in the history.
>   
>  I'm actually finalizing my circular buffer code and handling history    size change enlarge / shrink the history.
>  
>  But I'm discovering the distinct behavior or those two max values:    max-texts-in-history  / max-menu-items
>  
>  To what I understand:
>  
> max-menu-items is a visual limitation in the popup menu
> max-texts-in-history is the actual history size in memory (may        be also on disk, I didn't explore this part, as it was not        involved in my changes)
>
> in clipman 1.6 the max-texts-in-history is set with this visual    interface:
>  
>  
>  
>  Which is greyed as I disabled it in my use case.
>  
>  So what is exactly the purpose of max-texts-in-history? 
>  Should I use this value for my in memory history size or should I    use a different size matching max-menu-items?
>  
>  Regards,
>  Sylvain.
>  
> -- Sylvain Viart - GNU/Linux Sysadmin/Developer/DevOps - France
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.xfce.org/pipermail/xfce4-dev/attachments/20211001/a8508a47/attachment.html>


More information about the Xfce4-dev mailing list