Although not completely solved, this reduces database pauses
(along with prior commit improving parallelization of database) by
how ImapDB.Folder accesses the database. In particular, one code
path required an INNER JOIN that simply took too long (~8s) on large
databases, locking the entire db in the process. Tests and hacking
showed that, annoyingly, manually performing the INNER JOIN by
intersecting the results of two SQL transactions was more efficient.
In addition, creating/merging emails into the database is done in
chunks with a small pause between each chunk to allow other tasks
the opportunity to get to the database. Create/merge is one of the
most expensive operations on the database.
Folder now checks the open_count (as well as other details) to
determine if it should retry a closed connection; this prevents
certain race conditions where the Folder will continue to be reopened
even though it was legitimately closed by the caller.
Occassionally the EmailPrefetcher would not signal its work was
completed, causing the AccountSynchronizer to deadlock (it waits
until the EmailPrefetcher completes before closing the Folder and
moving on to the next one). The problem was due to the
EmailPrefetcher not clearing a timeout id, making other code think
other work was outstanding when it was in fact completed.
This doesn't completely solve bug #714450 but it does display a reply
or forwarded message more quickly in a conversation (rather than wait
for the Account object to signal that a Folder's contents has changed,
which is polled and may take minutes to notice).
This also slightly rearranges the priority order for background
synchronization, recognizing that some Folders (Drafts, Sent Mail) are
as active as All Mail but quicker to synchronize with (i.e. don't wait
for All Mail to complete synchronization before checking those).
Prior attempts to use multiple threads to access the SQLite database
failed due to locking reasons. This re-attempt fixes this, alloc'ing
four threads per database and slightly changing the locking strategy
for read-write transactions.
Part of the prior issues may have been an attempt to use a connection
pool (this patch simply opens a new connection for each transaction,
which for our purposes seems fine). The read-write strategy of
deferring locking until the write portion of the transaction was also
too optimistic, causing transactions to stall in the middle of their
operations.
This avoids the previously-mentioned bug in "font-family: initial".
Note that if you set the font size to 11pt in CSS, for example, you get
15px. But if you set it to 11pt with the WebSettings and then set that
size with font-size: medium, you get 14 px.
Set the WebSettings default and monospace fonts from the system
settings. Also, use "font: caption" to get the UI font for UI elements
in the webview. The former need to be updated each time they change.
The latter is automatically updated, though that only works
sporadically.
Unfortunately, this leaves messages in the conversation view in the UI
font, not the document font, because webkit treats "font-family:
initial" like "font-family: inherit" for some reason.
User may now add a brief signature in the Accounts manager for
each account. When starting a new message or replying, the signature
is prepended to the edit text.
Saving drafts may not be configured per-account. This is to assist
users who (a) are using Gmail clients that include trashed messages
in their conversations (which is where Geary's drafts wind up when
discarded) or (b) Gmail users where, for unexplained reasons, Geary
can't expunge their draft messages (bug #729136).
Toolbar improvments, primarily by removing label outright and letting
icons do all the work. Also, from some user request, have tried
moving icons to right side of toolbar, where they're closer to
the conversation viewer.
This does not fix dragging the window by the toolbar (that's fixed
in 3.10, bug #709914) or the title/subtitle in the GtkHeaderBar
being too close. We might consider using a custom title widget.
Unity doesn't deal well with pure GtkHeaderBar apps, so this allows
for the GtkHeaderBar to be treated like a toolbar and the window
retain its chrome.
Noticed this while working on Gtk.HeaderBar patch, that if the display
name changes it won't be reflected in the UI.
Conflicts:
src/client/components/main-window.vala
src/engine/abstract/geary-abstract-folder.vala
Nice code reduction using Gtk.HeaderBar in place of Gtk.Toolbar.
Main window no longer has chrome but composer window still does.
Conflicts:
src/client/components/main-window.vala
src/client/components/pill-toolbar.vala
src/client/composer/composer-toolbar.vala