Comments (30)
On GitLab by @knuesel on Feb 12, 2018, 11:25
added 4 commits
- d625c0d - Distinguish zoom and scale, always apply DPI correction on scale
- b4eca29 - Replace monitor "dpi" with "ppi"
- 5505575 - Assume PPI=100 (typical value) if info unavailable
- f6dd368 - Fix compilation for GTK+ < 3.22
from zathura.
Is this just for the sake of renaming of does the meaning of the value change as well? If it's only the former, please don't. If it's the latter, it requires migration code in both database backends.
from zathura.
We can easily rename it everywhere in the code, but changes to the database on-disk format always need to have the code that handles upgrades from previous versions.
from zathura.
On GitLab by @knuesel on Feb 12, 2018, 14:46
Commented on zathura/database-plain.c line 27
There is a change in meaning:
Currently, zoom is the same as scale: it's the number of pixels per document
point. In particular, zoom 100% means 1 pixel per point.
This MR redefines zoom 100% as "same size on screen as on paper". The scale is
still the number of pixels per point, and this value is now different from the
zoom (it's a function of the zoom and the monitor DPI/PPI).
These meanings for zoom and scale actually match the old code in many places: zoom
was used for the user concept in girara settings, and scale was used wherever a
"pixel per point" factor was needed.
Unfortunately, "scale" was also used as the name to store the zoom in the
database and in data structures (such as mark and link target) where it really
meant the user setting and not the "pixel per point". This is what I propose to
change here.
Regarding the database upgrade: do you think it's worth migrating 'scale' to
'zoom' it if the meaning has changed anyway? Should I just add code to delete
'scale' if present?
from zathura.
On GitLab by @knuesel on Feb 12, 2018, 14:50
added 1 commit
- 1a12214 - Bump GTK+ to 3.22
from zathura.
On GitLab by @knuesel on Feb 12, 2018, 15:18
added 1 commit
- 4f3837c - Remove Cairo 1.14 version checks
from zathura.
Okay, in that case it should be enough to upgrade the sqlite based database by dropping the old scale column and adding a new zoom column.
from zathura.
On GitLab by @knuesel on Feb 13, 2018, 19:50
Commented on zathura/database-plain.c line 27
OK but I wonder if it wouldn't be best to leave the scale column in place, since dropping a column is a bit complex in sqlite, and the scale column wouldn't interfere in any way?
from zathura.
Yes, that would suffice. Sample code to add the new column on demand is readily available in the sqlite backend.
from zathura.
On GitLab by @knuesel on Feb 13, 2018, 20:01
added 1 commit
- 09d8a37 - Add zoom column to sqlite database if missing
from zathura.
On GitLab by @knuesel on Feb 13, 2018, 20:01
Commented on zathura/database-plain.c line 27
Perfect, commit pushed.
from zathura.
This change requires updates to all plugins:
utils.c: In function ‘poppler_link_to_zathura_link’:
utils.c:37:19: error: ‘zathura_link_target_t {aka struct zathura_link_target_s}’ has no member named ‘scale’
target.scale = poppler_destination->zoom;
^
Makefile:49: recipe for target 'utils.o' failed
(from zathura-pdf-poppler).
Could you changes this to an anonymous union { double scale; double zoom; } and mark
scale` as deprecated? Once we merged these changes in zathura, we can then update all the plugins and drop the workaround before the release.
from zathura.
hmm, does this function really take a gpointer
instead of a GCallback
as second-to-last argument? That smells like a bug in glib.
from zathura.
On GitLab by @knuesel on Feb 15, 2018, 18:08
Commented on zathura/types.h line 182
changed this line in version 6 of the diff
from zathura.
On GitLab by @knuesel on Feb 15, 2018, 18:08
added 1 commit
- 8b93be9 - Add scale/zoom union in link target
from zathura.
On GitLab by @knuesel on Feb 15, 2018, 18:09
Commented on zathura/types.h line 182
Sorry, I miss that indeed. I've made the changes.
from zathura.
On GitLab by @knuesel on Feb 15, 2018, 18:12
Commented on zathura/callbacks.c line 247
Yes it also causes a compilation warning (for good reasons)... I'm not sure what should be done about this.
from zathura.
Elsewhere we store the signal handler id in the zathura
object and use g_signal_handlers_disconnect
. Couldn't this work here too?
from zathura.
On GitLab by @knuesel on Feb 16, 2018, 16:43
Commented on zathura/callbacks.c line 247
changed this line in version 7 of the diff
from zathura.
On GitLab by @knuesel on Feb 16, 2018, 16:43
added 1 commit
- af90d40 - Store monitors-changed handler for disconnection
from zathura.
On GitLab by @knuesel on Feb 16, 2018, 16:47
Commented on zathura/callbacks.c line 247
Yes, I've pushed changes accordingly.
from zathura.
resolved all discussions
from zathura.
@knuesel Anything else you want to change before merging this MR? I've played with it a little on a single monitor HiDPI setup and it looked go to me.
from zathura.
On GitLab by @knuesel on Feb 19, 2018, 20:07
@sebastinas I just tried it on a double-monitor setup today and there are a few issues I'd like to fix:
- a change in monitor resolution is detected, but no action is taken except to store the new pixel-per-inch value. This should be trivial to fix (render_all, refresh_view)
- window moved to another monitor is not detected. A possible fix would be to connect to the top widget's configure-event. The callback would be called repeatedly when a window is being or resized, but the computation should be negligible, e.g. causing refresh only if the PPI value changed). Would you be OK with that?
from zathura.
Okay. Yes, that should be fine.
from zathura.
On GitLab by @knuesel on Feb 23, 2018, 15:30
added 3 commits
- 1e170f0 - Indentation fix
- 8e3f056 - If new PPI is significantly different, yes render and refresh
- 5d362c2 - Listen on configure event for PPI changes
from zathura.
On GitLab by @knuesel on Feb 23, 2018, 15:36
added 1 commit
- 063b234 - Listen on configure event for PPI changes
from zathura.
On GitLab by @knuesel on Feb 23, 2018, 15:49
added 17 commits
- 063b234...dfc31a3 - 16 commits from branch
pwmt:develop
- f1ebe9e - Merge remote-tracking branch 'upstream/develop' into feature/physical-size
from zathura.
On GitLab by @knuesel on Feb 23, 2018, 16:30
I've made the discussed changes and merged develop
for the meson changes. Playing a bit on dual monitor setups I didn't find any issue so feel free to merge.
from zathura.
merged
from zathura.
Related Issues (20)
- [PLACEHOLDER] - for issue #318
- Scroll top/bottom doesn't create jumplist entry
- Chaining function combinations/combos
- Searching in index HOT 1
- Expanding/collapsing ALL in index could be improved
- Is it possible to run a command (wakatime-cli) to statistic the time of browsing pdf? HOT 4
- Horizontal Scrolling support HOT 4
- Various glitches caused by dependence on X11's reported screen physical size. Desired: a user config option to ignore per-screen DPI. HOT 1
- [Feature request] Preview link without following
- Searching is slow and blocking on a large document HOT 1
- Crash when scrolling pdf HOT 1
- Toggle_statusbar and adjust window with "a" or "s"
- Documentation: missing various commands
- Documentation: some missing settings
- Zathura crashes with 'Bad system call' on specific pdf file
- An option to switch `[current_page / total_pages]` to just `total_pages` HOT 1
- zathura crashes regularly HOT 9
- Crashes with: *** stack smashing detected ***: terminated on i686 HOT 2
- Segfault on fast mouse scrolling with mupdf HOT 1
- longjmp causes uninitialized stack frame HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zathura.