GNOME Bugzilla – Bug 510688
Window moves when "View -> Reload" is selected
Last modified: 2009-02-06 20:02:08 UTC
[ From http://bugs.debian.org/437506 by Reid Priedhorsky ] "When I choose the "View -> Reload" option from the menus, the window moves a couple of dozen pixels up and to the left. This happens regardless of whether I am in Best Fit or some other zoom level. It is probably relevant that I am running FVWM 2.4. It seems to me that refreshing the view should be orthogonal to any window repositioning." The bug report has also reproduced this using twm, and provided two screenshots to illustrate the bug: After: http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=25;filename=437506-after.png;att=1;bug=437506 Before: http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=25;filename=437506-before.png;att=2;bug=437506 The closest match I have found is bug 463121, but I'm not entirely sure it's the same problem.
Hi, I think that the culprit is the line shell/ev-window.c:1485 (approx.): setup_size_from_metadata (ev_window); I propose to change it in order not to change/reload window parameters when doing reload. Can you try it? Replace that line with: if (!ev_window->priv->in_reload) setup_size_from_metadata (ev_window); Let me know if it is ok. I am not sure about this change, since I do not know very well the control flow of evince. Maybe someone can comment on this? Cheers, Eugen Dedu
Hi, I stop the investigation about this issue because it is too complex for me (and the code is not too well organised IMHO). However, I have a few remarks: - setup_size_from_metadata (ev_window); is called (at least) twice, once in ev_window_open_uri and once in ev_windowset_document. Why? - another bug related to reload: during reload, several unsatisfied assert appear on the screen in the following case: suppose page N is seen on screen; reload document, and this new document has fewer than N pages. I thought of the following code to put somewhere: if ((ev_window->priv->in_reload && view->end_page >= ev_page_cache_get_n_pages (view->page_cache)) { // fixme: take into account the page size changing too (reload doc, but doc has changed page size) gint diff = view->end_page - ev_page_cache_get_n_pages (view->page_cache); printf ("eugen diff=%d, end_page=%d\n", diff, view->end_page); view->start_page -= diff; view->current_page -= diff; if (view->start_page < 0) { view->start_page = 0; view->current_page = 0; // what's the best value to put here? } view->end_page -= diff; } but I do not know where is its place in the code (it seems that page_cache is reinitialised several times, difficult for me to see why). I put it in ev_view_set_document, just before setup_caches(view), but I received another assert... - also, during my investigation, I have a few questions whose answer I do not find out, maybe it's useful to put a few comments in the code: - what is ev_page_cache file good for? Is it the document cache (in order not to reload it from disk repeatedly)? What is view? - why is there a current_page in page_cache AND in view? Cheers, Eugen Dedu
And for this one too.
*** Bug 535663 has been marked as a duplicate of this bug. ***
Isn't it a compiz bug?
Seems that latest GTK+ libs (v.2.12.10) solved the issue, at least for me... Now using Reload button/function doesn't change the Evince windows position Andrea
Great, thanks for testing.
*** Bug 570783 has been marked as a duplicate of this bug. ***