This should not be needed, but i can totally reproduce that without it
top is still reporting lots of memory used by Okular when it's really
not (heaptrack reports memory freed correctly)
BUGS: 394834
Summary:
As a side effect of f0a80a67 a recalculation was triggered
by the notifyFormChanges called in EditFormTextCommand::redo,
which is called for each edit. So calculation was done twice.
Test Plan: The calculate forms test still passes.
Reviewers: aacid
Subscribers: okular-devel
Tags: #okular
Differential Revision: https://phabricator.kde.org/D12825
Summary:
Put the file into a file descriptor and open this file descriptor.
Just application/pdf for now.
Test Plan: opened some documents on my phone
Reviewers: #okular, aacid, mart
Reviewed By: mart
Subscribers: okular-devel
Tags: #okular
Differential Revision: https://phabricator.kde.org/D12770
Summary:
This adds support for multiple actions following each
other through the "Next" value of Action dictionaries.
Test Plan: Activates the corresponding part of the visibilitytest.
Reviewers: #okular
Subscribers: sander, aacid
Tags: #okular
Maniphest Tasks: T8278
Differential Revision: https://phabricator.kde.org/D11609
There's no need to continue generating something that won't be useful.
Also fixes a crash if the request would report partial updates since at that stage it uses the observer and that is gone
The crash would happen because we were setting partial updates to true on requests
that were synchronous, because that sync request was cancelling an async one (prerender)
so now we only set newRequest partial updates to true when cancellingm another one if it's asynchronous
And a sync but with partial updates request would make stuff crash because the request
would all be processed on the main thread but generator_pdf.cpp cakks signalPartialPixmapRequest
with a queued connection so we that function was called the request would have already gone
Summary:
notifyFormChanged is called by documentcommands when
Form fields are changed. E.g. by Undo / Redo.
We need to recalculate after such changes.
Test Plan:
Tested with simple_calculate example.
Run the unit test with the added line commented out and it failed, with the added line it passes.
Reviewers: #okular
Subscribers: aacid, ltoscano
Tags: #okular
Maniphest Tasks: T7805
Differential Revision: https://phabricator.kde.org/D10547
Summary:
If a field is updated because of a calculate form action /
a script execution, not only refresh the rendered pixmap but
also the corresponding formWidget.
Test Plan: Unittest in separate revision. Tested it manually, too.
Reviewers: #okular
Subscribers: aacid
Tags: #okular
Maniphest Tasks: T7805
Differential Revision: https://phabricator.kde.org/D10048
Probably doesn't happen very often since most of the times people don't save while rendering is still happening
but if that is the case we need to wait for all the rendering to finish otherwise we remove the document
from under the render thread feet and bad things happen
Summary:
Only supported by the pdf backend if using poppler >= 0.63
Sadly had to change the generator API
Text cancellation is a bit wobbly still since poppler has large parts
of the code where doesn't check for the cancellation flag, but that
is something that will get automagically fixed for us if the poppler
side is improved
Test Plan: Needs https://bugs.freedesktop.org/show_bug.cgi?id=104263
Reviewers: ervin, rkflx
Reviewed By: ervin, rkflx
Subscribers: #okular
Tags: #okular
Differential Revision: https://phabricator.kde.org/D9328
Summary:
This way pages that take more than 500ms to render get updated every so often so that the
user can see that the program didn't hang, it's just that it's taking long to render
Tags:
incremental rendering, partial updates
BUGS: 344081
Subscribers: #okular
Tags: #okular
Differential Revision: https://phabricator.kde.org/D8379
How does it work:
* What it does is really closing and opening the file again through poppler
* This means that things that are generated in "open" time like Page, Rects, Annotations, Forms need to be updated
* For Page what we do is swap the PagePrivate so that other classes that hold Page* don't break
* Since some parts of the PagePrivate can be reused, we move them in PagePrivate::adoptGeneratedContents
* For all the commands in the undo stack we need to update the annotations/forms it refers to, added a new function to do that
* The annotationmodel needs updating it's pointers
* The widgets for the forms are reused and their form* updated
* the widgets for the videos are recreased since videos don't really hold much content (you lose the playing status on save but i think that's acceptable)
TODO: Make this work for .okular files
TODO: For files with password we will need to reload the file, asking for the password again and thus losing the undo stack, warn the user
TODO: autotests
Summary:
This patch enables HiDPI throughout the application
Every pixmap is multiplied by the devicePixelRatioF
QPainter code is ajusted to take the DPR value into account
All pixmaps get cached with the highest DPR of all screens. When moving the application to another screen, the cache doesn't have to be invalidated.
BUGS: 362856 383589
REVIEW: D6268
Show non-intrusive info messages whenever the search start over from the
beginning or the bottom of the document, instead of asking the user if
s/he wants to continue the search. This is consistent with search in
KWrite/Kate and with web browsers.
Based on work of and reviewed by Elvis Angelaccio
Summary:
This should prevent crashes when reloading some synctex-enabled pdf
files created with newer versions of TeXLive. We also gain bugfixes,
features and improved accuracy from the last 6 years of synctex
development.
Procedure followed:
- svn co svn://tug.org/texlive/trunk/Build/source/texk/web2c/synctexdir
- Check out revision 45150
- Update files present in core/synctex/*
- Adapt Okular code to changes
- Review and drop or update/apply old patches using quilt
- Create missing patches for local synctex changes
- New patch: Omit warning message when opening non-synctex pdf
- Two new patches to fix more compiler warnings
- New patch: Plug multiple leaks and prevent a segfault
TODO for later:
- Move sync file detection code to Okular to never call into synctex C code for non-synctex files
- Evaluate feasibility of upstreaming all patches for TeXLive 2018 and using synctex as a library
BUG: 383915
FIXED-IN: 17.12.0
Test Plan:
- No crash in synctex on reloading empty.pdf from bugreport anymore.
- Shift-clicking on a word in a simple pdf opens Kate with the corresponding tex line.
- Forward and backward search in Kile seems to work.
- Works with synctex files from both TeXLive 2015 and 2017.
- PartTest::testForwardPDF still passes.
- No additional memory leaks in autotests and with basic synctex and non-synctex usage of Okular.
Reviewers: #okular, sander, #kile, aacid
Reviewed By: #okular, aacid
Subscribers: mludwig, aacid
Tags: #okular
Differential Revision: https://phabricator.kde.org/D7594
Usage:
If you left-click an annotation, it gets selected. Resize handles appear on the selection rectangle. When cursor is moved over one of the 8 resize handles on the corners/edges, the cursor shape changes to indicate resize mode. Everywhere else on the annotation means "move", just as it was before resize feature was added. Pressing ESC or clicking an area outside the annotation cancels a selection. Pressing Del deletes a selected annotation.
Feature is only applicable for annotation types AText, AStamp and AGeom.
Implementation:
It works by eventually changing AnnotationPrivate::m_boundary and notifying generator (i.e. poppler) about that change. Annotation state handling is shifted out of PageView into a new class MouseAnnotation (ui/pageviewmouseannotation.cpp). Some functionality not related to resizing but to annotation interaction in general is also shifted to class MouseAnnotation, to build a single place of responsiblity.
Other changes:
Add method Document::adjustPageAnnotation, backed by a QUndoCommand.
class Okular::AdjustAnnotationCommand.
Add Annotation::adjust and Annotation::canBeResized methods.
Draw resize handles in PagePainter::paintCroppedPageOnPainter.
Resize and move work
-for types AText, AStamp and AGeom
-on all pages of document
-when viewport position changes
-when zoom level changes
-for all page rotations (0°, 90°, 180°, 270°)
Selection is canceled
-when currently selected annotation is deleted
-on mouse click outside of currently selected annotation
-ESC is pressed
Viewport is shifted when mouse cursor during move/resize comes close to viewport border.
Resize to negative is prevented.
Tiny annotations are still selectable.
If mouse is moved over an annotation type that we can focus, and the annotation is not yet focused, mouse cursor shape changes to arrow.
If mouse cursor rests over an annotation A, while annotation B is focused, a tooltip for annotation A is shown.
Selected Annotation is deleted when Del is pressed.
Test for regressions:
-Annotation interaction (focus, move, resize, start playback, ...) are only done in mode EnumMouseMode::Browse.
-If mouse is moved over an annotation type where we can start an action, mouse cursor shape changes to pointing hand.
-If mouse is moved over an annotation type that we can't interact with, mouse cursor shape stays a open hand.
-If mouse cursor rests over an annotation of any type, a tooltip for that annotation is shown.
-Grab/move scroll area (on left click + mouse move) is prevented, if mouse is over focused annotation, or over AMovie/AScreen/AFileAttachment annotation.
-A double click on a annotation starts the "annotator".
REVIEW: 127366
BUG: 177778
BUG: 314843
BUG: 358060