Commit graph

10928 commits

Author SHA1 Message Date
Andrej Kacian
fe04873dd3 Fix a crash in litehtml plugin if one of the MIME parts has no Content-ID 2019-08-08 19:33:43 +02:00
Andrej Kacian
c8cb6c4ce1 Get rid of magic numbers in summary_msginfo_*_flags 2019-08-08 19:33:37 +02:00
Andrej Kacian
3c18210966 Fix a typo - it's CURL_CFLAGS, not CURL_FLAGS 2019-05-18 12:05:06 +02:00
Andrej Kacian
9fcee262ec Add missing libgumbo cflags and ldflags to litehtml_viewer 2019-05-18 12:05:05 +02:00
Andrej Kacian
5d2ffc6427 Return summaryview cursor to selected mail when popup menu is done
Fixes bug #3838: Canceled right-click on message
list leaves UI in inconsistent state
2019-05-14 23:20:08 +02:00
Andrej Kacian
bc6d725103 Move log timestamp format string to a separate macro in log.h 2019-05-14 16:16:49 +02:00
wwp
db96dbfbc9 Add date (ISO format) to log timestamps. 2019-05-14 16:16:45 +02:00
Andrej Kacian
e171555264 Fix a use after free crash when deleting message via a separate messageview
After the message has been deleted, summary_show() will
redisplay the folder and free all the MsgInfos, but we still
need the one for the message currently displayed in our
messageview window, so we add our own reference to it, and free
it ourselves when we're done.

This was only happening when summaryview already has a different
message displayed.

Fixes bug #4029: segfault after deleting message in a window
2019-05-14 16:03:45 +02:00
Andrej Kacian
56d48f8c2d Fix verify_folderlist_xml() for fresh starts
It was calling xml_free_tree(NULL) if folderlist.xml
did not yet exist.
2019-05-08 23:25:55 +02:00
Andrej Kacian
68486f4da9 Fix markup in 'key not fully trusted' warning in pgpcore 2019-05-08 21:29:37 +02:00
Andrej Kacian
e83ef13409 Get rid of deprecated GTK API calls in litehtml plugin
gdk_cairo_create(), gdk_cursor_new(), gtk_menu_popup()
2019-05-05 14:21:55 +02:00
Andrej Kacian
0b14aad2d4 Make litehtml plugin rendering work better with GTK3 widget redraw
Unlike GTK2's "expose-event", GTK3's "draw" signal provides the
handler function with an already prepared cairo context to draw
on. This fixes flickering when scrolling HTML messages.

Unfortunately, litehtml's redraw() doesn't allow us to pass
custom arguments, so we have to store a pointer to the cairo
context as a member variable of our document container, so that
redraw() can access it.
2019-05-05 13:52:08 +02:00
Andrej Kacian
3c7b518b7b Use "draw" signal to render the contents in litehtml plugin, instead of obsolete "expose-event" signal 2019-05-04 17:32:16 +02:00
Andrej Kacian
6e3ba6de4b Fix GTK3-related compile errors for litehtml plugin 2019-05-04 17:17:39 +02:00
Andrej Kacian
3d290a4f13 Fix two memory leaks in litehtml plugin 2019-05-04 16:56:59 +02:00
Andrej Kacian
4cb31b49ab Fix a memory leak in litehtml plugin's container_linux::load_image() 2019-05-04 16:56:54 +02:00
Andrej Kacian
b007c1233c Fix incorrect logic in lh_widget::set_cursor(). 2019-05-04 16:56:34 +02:00
Andrej Kacian
7c6693d708 Add a getter for litehtml::document's m_over_element member
This allows us to avoid some expensive GDK calls in
lh_widget::set_cursor().
2019-05-04 16:56:30 +02:00
Andrej Kacian
85fae2899e Make cursor and statusbar URL display smarter in litehtml plugin 2019-05-04 16:56:20 +02:00
Andrej Kacian
0ceccd127a Always remove local images from Litehtml image cache
Since their "url" in cache only includes MIME
file name, they are not guaranteed to be unique
across different messages.
2019-05-04 16:56:12 +02:00
Andrej Kacian
5e478fb048 Added support for local image attachments to the Litehtml plugin 2019-05-04 16:56:07 +02:00
Andrej Kacian
6cfa503d18 Update callers of procmime_get_part_as_string() 2019-05-04 16:56:01 +02:00
Andrej Kacian
e352c009ce Require GLib >= 2.36 for Litehtml plugin 2019-05-04 16:55:54 +02:00
Andrej Kacian
0e508b3410 Make Litehtml image loading non-blocking using threads 2019-05-04 16:55:27 +02:00
Andrej Kacian
6f207b2291 Add a mutex lock for Litehtml plugin image cache 2019-05-04 16:55:19 +02:00
Andrej Kacian
25389c8db3 Write missing prefs_done() in Litehtml plugin 2019-05-04 16:55:06 +02:00
Michael Rasmussen
f2915834e3 Remove useless debug code. Add copyright
Signed-off-by: Michael Rasmussen <mir@datanom.net>
2019-05-04 16:55:00 +02:00
Andrej Kacian
79659144fc Simplify Litehtml plugin's show_mimepart 2019-05-04 16:53:09 +02:00
Andrej Kacian
22a159866b Use Pango to render text in Litehtml plugin
Since we're no longer using the "toy" cairo text API, we
can now render all Unicode glyphs, and the code even ends
up slightly simpler.

The text-related Litehtml callbacks have been moved from
container_linux to lh_widget class, and into a separate
.cpp file.
2019-05-04 16:53:02 +02:00
Andrej Kacian
42231eff67 Use prepend document base url to #fragment links in Litehtml plugin 2019-05-04 16:52:53 +02:00
Andrej Kacian
fa7135fa3b Add default_font preference to Litehtml plugin 2019-05-04 16:52:45 +02:00
Michael Rasmussen
8071229a71 Fix build error
Signed-off-by: Michael Rasmussen <mir@datanom.net>
2019-05-04 16:52:39 +02:00
Andrej Kacian
cd43a4956b Make Litehtml display sub- and superscript correctly 2019-05-04 16:52:26 +02:00
Andrej Kacian
3d209145f3 Use height of the viewport, not the scrolled window when telling Litehtml size of the area it has available for rendering 2019-05-04 16:52:16 +02:00
Andrej Kacian
f0dc8213f7 Reset Litehtml scrolledwindow to top-left when displaying new content 2019-05-04 16:52:05 +02:00
Ricardo Mones
82106bb065 Fix typo in variable name 2019-05-04 16:51:59 +02:00
Andrej Kacian
9d95039f9c Show number of cleared Litehtml cache images on debug 2019-05-04 16:51:50 +02:00
Andrej Kacian
ab65f50374 Add image_cache_size pref to Litehtml 2019-05-04 16:51:41 +02:00
Andrej Kacian
79bf393df1 Implement size limit for Litehtml image cache 2019-05-04 16:51:33 +02:00
Andrej Kacian
f9d496bff6 Switch Litehtml's image cache from std::map to std::list
This makes the cache ordered, so we are able to remove
oldest entries if we want to trim memory usage.
2019-05-04 16:51:20 +02:00
Andrej Kacian
4271751d21 Do not build the litehtml plugin if a C++ compiler is not available 2019-05-04 16:51:09 +02:00
Andrej Kacian
0fafa987e7 Make Litehtml's "Copy Link" menuitem actually do something 2019-05-04 16:51:02 +02:00
Andrej Kacian
96d1595dcd Implement link context menu in Litehtml 2019-05-04 16:50:53 +02:00
Andrej Kacian
6e437d475f Add lh_widget::get_href_at() 2019-05-04 16:50:45 +02:00
Michael Rasmussen
a300f65525 Fix possible memory leak
Signed-off-by: Michael Rasmussen <mir@datanom.net>
2019-05-04 16:50:31 +02:00
Andrej Kacian
44fff45e2c Make Litehtml's curl writefunction add data directly to the GInputStream
This saves us some unnecessary reallocs, as data
inside a GMemoryInputStream do not need to be
contiguous.
2019-05-04 16:50:23 +02:00
Andrej Kacian
dc6e20c6eb Make Litehtml's curl write function a regular function instead of a static member function of the http class 2019-05-04 16:50:07 +02:00
Andrej Kacian
bd0e8d8455 Fix a memory leak in Litehtml plugin's http loader 2019-05-04 16:49:56 +02:00
Andrej Kacian
a75a6516bd Fix a huge memory leak in Litehtml 2019-05-04 16:49:43 +02:00
Andrej Kacian
03d8afe967 Properly free previous document from memory in litehtml's clear()
We also call paint_white() earlier in redraw().
This results in properly clearing the previously
rendered html content when opening a different
HTML part.
2019-05-04 16:49:35 +02:00