After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 510688 - Window moves when "View -> Reload" is selected
Window moves when "View -> Reload" is selected
Status: RESOLVED FIXED
Product: evince
Classification: Core
Component: general
2.20.x
Other Linux
: Normal normal
: ---
Assigned To: Evince Maintainers
Evince Maintainers
: 535663 570783 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2008-01-19 21:49 UTC by Sven Arvidsson
Modified: 2009-02-06 20:02 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Sven Arvidsson 2008-01-19 21:49:30 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.
Comment 1 Eugen Dedu 2008-03-25 14:14:51 UTC
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
Comment 2 Eugen Dedu 2008-03-25 14:51:00 UTC
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
Comment 3 Nickolay V. Shmyrev 2008-03-26 21:55:58 UTC
And for this one too.
Comment 4 Nickolay V. Shmyrev 2008-05-30 06:53:43 UTC
*** Bug 535663 has been marked as a duplicate of this bug. ***
Comment 5 Nickolay V. Shmyrev 2008-05-30 06:54:11 UTC
Isn't it a compiz bug?
Comment 6 Andrea Antolini 2008-06-06 11:39:19 UTC
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 
Comment 7 Nickolay V. Shmyrev 2008-06-07 02:47:38 UTC
Great, thanks for testing.
Comment 8 Nickolay V. Shmyrev 2009-02-06 20:02:08 UTC
*** Bug 570783 has been marked as a duplicate of this bug. ***