New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix scroll to selection & Hide iconview when changing window width #482
Fix scroll to selection & Hide iconview when changing window width #482
Conversation
Hiding the iconview make resizing smoother but for some reason, the iconview takes some time to be back. Sometime the iconview remains grey until I move the mouse on the window. |
d0f570f
to
482292b
Compare
I haven't been able to reproduce that. But I have done some small changes that should make iconview visible a bit faster. The mouse button release event and enter notify event are not emitted always, but for theese cases the timeout should make iconview visible again. @jeromerobert can you still see the problem? It does take some time for iconview to get visible again after changing window width, but at least for me iconview is ready for interaction faster with this commit than before. For example on a 3670 page pdf, when resizing by double-clicking on headerbar iconview is ready for interaction in about 4 seconds, where it before took about 8 seconds to get ready. And resizing window by dragging window edge is almost impossible in main for such large pdf. |
As far as I can see, it's not "changing", but only increasing. Reducing the width is always fast. When I increase the width I often (i.e. not always) have a 4s delay before the iconview gets back. It does not depends on the size of the PDF file as I can reproduce it with a 10 pages PDF files. I will take a closer look (i.e. add some trace) to understand why this is happening. |
|
I don't know if that can help but, as far as I can see, the only event which is always called with resizing end is |
Adding |
7c7eee0
to
3f01e2b
Compare
Okay thanks. On my machine |
When starting with the window already maximized the iconview remains grey. When switching from maximize to unmaximize the iconview remains grey for a while. I'm trying to find the right additional events where to call |
I think a
|
It does ! Calling |
Scroll to selection can sometimes fail because vertical scollbar is not yet ready for the new value. With this approach the action will be repeated until it is successfull.
This will make it possible to do smooth width changes even if there are a large number of pages in iconview.
This is if self.iconview.get_columns() return -1
3f01e2b
to
2b3eba5
Compare
Codecov Report
@@ Coverage Diff @@
## main #482 +/- ##
==========================================
- Coverage 73.72% 73.64% -0.08%
==========================================
Files 10 10
Lines 2793 2827 +34
==========================================
+ Hits 2059 2082 +23
- Misses 734 745 +11
Continue to review full report at Codecov.
|
I can see that it sometimes takes 1,5s longer before iconview gets visible again (when timeout make it visible). This is for example when pressing maximizing and unmaximizing buttons on headerbar. I can't find a good way to fix it. What desktop environment do you see the longer delays on @jeromerobert ? Do you think this delay is acceptable? |
It's with XFWM4/XFCE4. Well yes, it's acceptable like this. |
No description provided.