Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 08-02-2021, 08:27 AM   #31
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 5,766
Karma: 3571822
Join Date: Nov 2009
Device: many
Wow! Excellent detective work!

I can now recreate it. It seems there are bugs in QtWebEngineView with Zoom being set needing to be set-again after each page load.

The problem is it must be done before the location to scroll to is set but after the page's resources are loaded.

I will try to figure out some way to get it working properly.

Thanks!

KevinH

Quote:
Originally Posted by BeckyEbook View Post
I checked all steps twice and it works fine for me.

But…
I did a full test, in which I also overwritten my sigil.ini file, and then discovered that the issue really exists.

So I started to analyze step by step which line in the configuration file was causing the problem and found it.

The problem occurs at non-100% magnification in the preview window (both zoom in and zoom out).

zoom_preview in [user_preferences] section in your sigil.ini file

@Turtle91: Set the zoom for preview window to 100% until the issue is resolved.
KevinH is online now   Reply With Quote
Old 08-02-2021, 11:27 AM   #32
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 5,766
Karma: 3571822
Join Date: Nov 2009
Device: many
Okay, this is really messy. It seems a call to setZoomFactor for a QWebEngineView does not complete instantaneously nor is it immediately reflected in the internal state of the QWebEngineView after the call returns.

So any attempt to immediately scroll and centre the Preview Window on a location fails as the window inner height returned by javascript is incorrect for zoom values different from 100% until the zoom is done completely.

The interface for setZoomFactor is not designed to be asynchronous and so there is no way I know about to check if the zoom is complete yet (ie. to wait until setZoomFactor has completed and be reflected inside the QWebEngineView).

To make the situation worse, anytime a page is loaded, its internal zoom value is seemingly set back to 100%, requiring us to use setZoomFactor each time and then wait some amount of time before trying to scroll.

So a delay is needed between the call to Zoom (setZoomFactor) and when we try to scroll to a location. Among a bunch of other changes needed, I have tried to add that delay in PreviewWindow.cpp.

So right now, a delay of 50ms seems to be sufficient when set in DelayedScrollTo by a singleshot in PreviewWindow.cpp once the zoom is done. I have no way to know if that is enough for all platforms. I tried with a delay of 30ms and it fails.

I have pushed this approach to master. So we need people who can pull and build on Windows and Linux to see if this approach can be made workable for all platforms so that Preview syncing when Preview is not set to 100% works.

Please let me know what you find if you do get a chance to play around with this test case.
KevinH is online now   Reply With Quote
Advert
Old 08-02-2021, 11:38 AM   #33
BeckyEbook
Evangelist
BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.
 
BeckyEbook's Avatar
 
Posts: 466
Karma: 1497025
Join Date: Jan 2017
Location: Poland
Device: Kindle (Key3, PW2, PW3), Nook (ST, GLP), Kobo Touch, Tolino Vision 2
I built a version for Windows and it seems ok now.
BeckyEbook is offline   Reply With Quote
Old 08-02-2021, 11:49 AM   #34
Ashjuk
Addict
Ashjuk ought to be getting tired of karma fortunes by now.Ashjuk ought to be getting tired of karma fortunes by now.Ashjuk ought to be getting tired of karma fortunes by now.Ashjuk ought to be getting tired of karma fortunes by now.Ashjuk ought to be getting tired of karma fortunes by now.Ashjuk ought to be getting tired of karma fortunes by now.Ashjuk ought to be getting tired of karma fortunes by now.Ashjuk ought to be getting tired of karma fortunes by now.Ashjuk ought to be getting tired of karma fortunes by now.Ashjuk ought to be getting tired of karma fortunes by now.Ashjuk ought to be getting tired of karma fortunes by now.
 
Ashjuk's Avatar
 
Posts: 384
Karma: 1360975
Join Date: May 2011
Location: Surrey, UK
Device: Kobo Aura One, Sony PRS 600/650
That's puzzling as I can't replicate Becky's findings.

I always have my preview window set to 80% and the synch between code and preview when editing the code works as expected for me.

https://www.mobileread.com/forums/at...1&d=1627919338

https://www.mobileread.com/forums/at...1&d=1627919338
Attached Thumbnails
Click image for larger version

Name:	Sigil 01.jpg
Views:	39
Size:	321.7 KB
ID:	188480   Click image for larger version

Name:	Sigil 02.jpg
Views:	40
Size:	323.6 KB
ID:	188481  
Ashjuk is offline   Reply With Quote
Old 08-02-2021, 11:56 AM   #35
BeckyEbook
Evangelist
BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.
 
BeckyEbook's Avatar
 
Posts: 466
Karma: 1497025
Join Date: Jan 2017
Location: Poland
Device: Kindle (Key3, PW2, PW3), Nook (ST, GLP), Kobo Touch, Tolino Vision 2
@Ashjuk: Are you sure you have the 80% preview window?
The zoom is independent for the Code View and the Preview window.

Last edited by BeckyEbook; 08-02-2021 at 11:58 AM.
BeckyEbook is offline   Reply With Quote
Advert
Old 08-02-2021, 12:02 PM   #36
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 5,766
Karma: 3571822
Join Date: Nov 2009
Device: many
The same zoom control works for both. So click in Preview after it loads and then move the zoom slider and it should only zoom the Preview.


Quote:
Originally Posted by Ashjuk View Post
That's puzzling as I can't replicate Becky's findings.

I always have my preview window set to 80% and the synch between code and preview when editing the code works as expected for me.

https://www.mobileread.com/forums/at...1&d=1627919338

https://www.mobileread.com/forums/at...1&d=1627919338
KevinH is online now   Reply With Quote
Old 08-02-2021, 12:10 PM   #37
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 5,766
Karma: 3571822
Join Date: Nov 2009
Device: many
Thanks for testing it. I am going to also try moving the call to setZoomFactor even earlier to see if that helps.

KevinH



Quote:
Originally Posted by BeckyEbook View Post
@Ashjuk: Are you sure you have the 80% preview window?
The zoom is independent for the Code View and the Preview window.
KevinH is online now   Reply With Quote
Old 08-02-2021, 12:20 PM   #38
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 24,545
Karma: 167414566
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
We had a bug not all that long ago where the Zoom was resetting itself to 100% under certain conditions, but I can't seem to track it down now, to see just how we fixed it. I don't think it had anything to with what we're seeing now, but I just want to make sure that our fix for that (which was to reapply the zoom) isn't somehow exacerbating the problem and breaking sync.

I won't be able to test any builds on Linux until later this evening.
DiapDealer is offline   Reply With Quote
Old 08-02-2021, 12:32 PM   #39
Ashjuk
Addict
Ashjuk ought to be getting tired of karma fortunes by now.Ashjuk ought to be getting tired of karma fortunes by now.Ashjuk ought to be getting tired of karma fortunes by now.Ashjuk ought to be getting tired of karma fortunes by now.Ashjuk ought to be getting tired of karma fortunes by now.Ashjuk ought to be getting tired of karma fortunes by now.Ashjuk ought to be getting tired of karma fortunes by now.Ashjuk ought to be getting tired of karma fortunes by now.Ashjuk ought to be getting tired of karma fortunes by now.Ashjuk ought to be getting tired of karma fortunes by now.Ashjuk ought to be getting tired of karma fortunes by now.
 
Ashjuk's Avatar
 
Posts: 384
Karma: 1360975
Join Date: May 2011
Location: Surrey, UK
Device: Kobo Aura One, Sony PRS 600/650
Quote:
Originally Posted by BeckyEbook View Post
@Ashjuk: Are you sure you have the 80% preview window?
The zoom is independent for the Code View and the Preview window.
Yes. I have the preview set to 80% and the code view to 100%. Depending upon which window I have clicked the slider changes to reflect my setting.
If you look at the images I attached to my last post you can see the slider is at 80%.


Quote:
Originally Posted by KevinH View Post
The same zoom control works for both. So click in Preview after it loads and then move the zoom slider and it should only zoom the Preview.
I discovered that some time ago, as I just said to Becky, I have code set to 100% and preview to 80%.

Just a little puzzling that the 'bug' does not seem to affect me despite my having the preview window zoomed out.
Ashjuk is offline   Reply With Quote
Old 08-02-2021, 12:48 PM   #40
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 24,545
Karma: 167414566
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by Ashjuk View Post
Just a little puzzling that the 'bug' does not seem to affect me despite my having the preview window zoomed out.
It depends on the length of the file and where you are IN it as well. If the edits you're making are close enough to the top (or bottom) of a relatively small file, it's possible for the recent edit to still remain visible in the Preview Window even after the incorrect sync attempt. Try a good long xhtml file and scroll to the middle of it and see if that makes a difference.

I can see in the original images you posted that you're scrolled nearly to the bottom of the Preview Window. And that although the sync is still being botched after your edit, it's just not moving the needle enough to make a huge difference.

Last edited by DiapDealer; 08-02-2021 at 01:25 PM.
DiapDealer is offline   Reply With Quote
Old 08-02-2021, 12:49 PM   #41
BeckyEbook
Evangelist
BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.
 
BeckyEbook's Avatar
 
Posts: 466
Karma: 1497025
Join Date: Jan 2017
Location: Poland
Device: Kindle (Key3, PW2, PW3), Nook (ST, GLP), Kobo Touch, Tolino Vision 2
@Ashjuk: So how did you take your screenshots when we see Zoom 80% there? This can only be seen after clicking in the Preview window.
If you click on the Preview window, Code View synchronization will occur, and the problem we are discussing is Code View reverse synchronization -> Preview Window.

If you really have Code View 100% and Preview 80% then click on the red paragraph in the Code View and in the Preview window it will not be in the center, but a little above the center.

Last edited by BeckyEbook; 08-02-2021 at 12:59 PM.
BeckyEbook is offline   Reply With Quote
Old 08-02-2021, 01:22 PM   #42
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 5,766
Karma: 3571822
Join Date: Nov 2009
Device: many
Yes, that extra Zoom call fix was needed due to a bug in QtWebEngine when you use load() or setUrl() it remembers the old zoom level but does not apply it meaning that all pages appear to have the correct zoomFactor but it is never actually applied. I think it compares it against its previous value and then does nothing since it appears to have not changed.

This does make this bug much worse.

I am still trying other approaches to see if they fix the issue in a more reliable way.


Quote:
Originally Posted by DiapDealer View Post
We had a bug not all that long ago where the Zoom was resetting itself to 100% under certain conditions, but I can't seem to track it down now, to see just how we fixed it. I don't think it had anything to with what we're seeing now, but I just want to make sure that our fix for that (which was to reapply the zoom) isn't somehow exacerbating the problem and breaking sync.

I won't be able to test any builds on Linux until later this evening.
KevinH is online now   Reply With Quote
Old 08-02-2021, 01:32 PM   #43
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 5,766
Karma: 3571822
Join Date: Nov 2009
Device: many
It seems that nothing I try that sets the zoom factor anytime before the load/setURL completes (ie. the loadFinished signal is generated) is just ignored by QtWebEngine. This is a bug as far as I am concerned.

This is what makes this bug hard as every time we load or reload a page after edits with a zoom factor set to something other than 1.0, we need to re-apply that zoom before scrolling to a particular location. But since zoom seems to be actually done asynchronously, we have to delay since there is no signal to tell us zoom is done.

I might try reversing the older to see if that helps (scroll first and then zoom).

Update: That fails too!

So right now the only "solution" is already in master. Let's hope it works on a wide variety of Windows, macOS, and Linux machines because I do not have a different solution that works.

Last edited by KevinH; 08-02-2021 at 01:40 PM.
KevinH is online now   Reply With Quote
Old 08-02-2021, 01:58 PM   #44
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 24,545
Karma: 167414566
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Anything here useful? https://phabricator.kde.org/D12454

They seem to be moving their call to zoom to after a page starts to load: loadProgress()

I've also seen references to setZoomFactor being badly broken in QtWebEngine 5.15. Some people have resorted to calling it multiple times.

Last edited by DiapDealer; 08-02-2021 at 02:07 PM.
DiapDealer is offline   Reply With Quote
Old 08-02-2021, 02:29 PM   #45
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 5,766
Karma: 3571822
Join Date: Nov 2009
Device: many
They are seeing the same bug I am but they pointed out that doing zoom in loadProgress will also work as a location to set page zoom. But when it reaches 100% it is effectively the same as loadFinished so I am not sure since theirs fires at 100% as well Worth a shot though.


Quote:
Originally Posted by DiapDealer View Post
Anything here useful? https://phabricator.kde.org/D12454

They seem to be moving their call to zoom to after a page starts to load loadProgress()

I've also seen references to setZoomFactor being badly broken in QtWebEngine 5.15. Some people have resorted to calling it multiple times.

Last edited by KevinH; 08-02-2021 at 02:45 PM.
KevinH is online now   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sigil-0.9.10 Released DiapDealer Sigil 154 11-19-2018 10:20 PM
Sigil-0.9.7 Released DiapDealer Sigil 90 11-10-2016 01:30 PM
Sigil-0.9.6 Released DiapDealer Sigil 69 10-29-2016 10:35 AM
Sigil-0.8.900 released for testing - Wait for Sigil-0.8.901 KevinH Sigil 106 10-04-2015 10:41 AM
Sigil 0.7.0 Released user_none Sigil 75 03-03-2013 12:41 PM


All times are GMT -4. The time now is 11:16 AM.


MobileRead.com is a privately owned, operated and funded community.