#18297 closed bug (fixed)

IMAP folders lose saved window position on mail_daemon start

Reported by: zdykstra Owned by: nobody
Priority: normal Milestone: R1/beta5
Component: Applications/Mail Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

Any folder that's an IMAP Folder managed by mail_daemon has default attributes reset when mail_daemon is started. In practice, this means that if you move and resize the Inbox folder for an e-mail account, then reboot, the previous Tracker window position is reset.

After a bit of poking around and tracing things, it looks like https://git.haiku-os.org/haiku/tree/src/add-ons/mail_daemon/inbound_protocols/imap/IMAPProtocol.cpp#n284 is the culprit.

The three attributes associated with /boot/home/config/settings/Tracker/DefaultQueryTemplates/text_x-email are applied to any IMAP folders, new or existing - overwriting _trk/windframe.

Change History (5)

comment:1 by waddlesplash, 21 months ago

Probably we should eliminate _trk/windframe from the DefaultQueryTemplates, then.

comment:2 by zdykstra, 21 months ago

The downside to that is that if anybody opens one the DefaultQueryTemplates folders up, _trk/windframe would get set and then applied. Would it be better to explicitly filter out that attribute when copying things over?

This might be a good time to also set default columns that are appropriate for a mail folder and copy those in as well. That would potentially address https://dev.haiku-os.org/ticket/15801 .

Last edited 21 months ago by zdykstra (previous) (diff)

comment:3 by zdykstra, 21 months ago

After digging around, I think there might be cause for a bit of a refactor here.

Attributes from /boot/home/config/settings/Tracker/DefaultQueryTemplates/text_x-email are copied over to IMAP folders. This was done in https://git.haiku-os.org/haiku/commit/?id=618cc43b64d2acb8614c7f49eaadf8028d606539 to resolve https://dev.haiku-os.org/ticket/3498 .

The attribute source, /boot/home/config/settings/Tracker/DefaultQueryTemplates/text_x-email was originally used in the Mail reader/viewer application. When a query is picked from the Queries menu, a query results window is created that clones all of the attributes from the source folder.

The effect of this is that you have key attributes (window position +size, columns + order) being applied to an ephemeral query window and to persistent folders. So if you want your query windows to look one way and your IMAP folders another, that's not possible right now.

I think there are realistically two different problems here that need to be solved:

1)

IMAP folders have their position reset every time mail_daemon was restarted.

Solving this issue can be done by storing _trk/windframe, calling CopyMailFolderAttributes, then restoring it.

Alternatively, CopyAttributes and CopyMailFolderAttributes can be refactored to accept an optional list of attributes that should NOT be copied, and then where appropriate exclude _trk/windframe (and others).

2)

Ephemeral Query windows and persistent IMAP Folders likely shouldn't have key attributes sourced from the same folder template.

If this is considered an actual problem, possibly/probably a new default source for IMAPFolder attributes should be created and used. That'll mean CopyMailFolderAttributes would need to accept a source BPath, instead of having it hard-coded. There are only two uses of this specific CopyAttributes instance - one used by the Mail viewer application, and one used by mail_daemon / IMAPFolder.

Version 0, edited 21 months ago by zdykstra (next)

comment:5 by waddlesplash, 20 months ago

Milestone: UnscheduledR1/beta5
Resolution: fixed
Status: newclosed

Fix merged in hrev56833.

Note: See TracTickets for help on using tickets.