When toggling Trim Margins, Okular applies the View Mode settings as saved in okularpartrc, independently of which mode is set in the current Okular window. For example, this is problematic when viewing multiple documents with different view modes and toggling Trim Margins on one of them. Reproducible: Always Steps to Reproduce: 1. Open two or more documents in Okular. 2. Set one document to Single Page. 3. Set another document to Facing Pages. 4. Toggle Trim Margins on the first document. Actual Results: The view mode of the first document (which was originally in Single Page mode and on which Trim Margins was toggled) is now in Facing Pages mode. Moreover, the view mode settings still show it being "Single Page", which is obviously not true. Expected Results: The first document should still be in Single Page mode after toggling Trim Margins.
Confirmed with Okular 1.7.2. It’s simple: Every tab is a Part, and when changing the view mode in a Part, it is written to the configuration file. (Only the viewport position is stored per-document.) Trim margins changes the page geometries, and thus calls slotRelayoutPages(). That will calculate a new layout (i. e. move the pages closer together because they don’t have margins anymore), but has to read the View Mode (the “layout mode”) from the configuration file. The bug could be expressed: Parts don’t syncronize their View Mode, so changing the View Mode in one Part makes the others unsynchronized to the configuration file.