GNOME Bugzilla – Bug 677993
Remember screen used in previous session
Last modified: 2012-06-26 14:56:14 UTC
Moving this from a downstream bug report: https://bugzilla.redhat.com/show_bug.cgi?id=831128 Description of problem: I am running a 2 monitor setup, and want Evolution to reside on Monitor #1, but it *always* comes up on monitor #2. Version-Release number of selected component (if applicable): 3.4.1-2.fc17 How reproducible: Always Steps to Reproduce: 1. (Move Evolution to screen #1) 2. (Close Evolution) 3. Start Evolution Actual results: Evolution comes up on screen #2 Expected results: Evolution comes up on screen #1 (the screen where it was last time)
I am the original reporter of the problem. I believe it did not happen with Evolution 3.2.x, but started happening in Evolution 3.4.x. Please let me know if you need any more information or help.
Since we do nothing to choose a screen at startup, I'm marking this as an enhancement request to remember the screen from the previous session.
I am not sure I agree. Consider the following: - It worked with previous versions of Evolution. - I doubt it is the responsibility of each application to remember the screen it's been on. - Instead, I would suspect it's up to the window manager to decide where to place the screen (unless the application does anything special) - Other applications work just fine in this respect (in some cases I am almost 100% sure they don't do anything special with respect to screen placement). - Evolution does not come up on what I would consider a reasonable default, i.e. screen #1, instead it insists to always come up on screen #2 (no other application does that, except those that I explicitely place there). All those points lead me to think that it must be some strange interaction between Evolution and the window manager (mutter I suppose).
What is stored in dconf-editor under /org/gnome/evolution/shell/window? Maybe the x/y is pointing to the second monitor (out of screen resolution of the first monitor)? Also, do you have the window maximized? I see some operations with window's screen, which are checking width/height of it, but that is supposed to be the screen, which is "assigned" to the window by a window manager.
Yes, the window is maximized and I tried to reproduce with unmaximized window, and in this case it comes up correctly (i.e. the problem only appears for maximized evolution). I also tried with other maximized apps, and they work correctly, i.e. it's still an evolution related problem. in the mention dconf I got: height: 937 maximized: true width: 1717 x: 0 y: 27 Both my screens have 1920x1080 geometry.
My guess would be, that the window manager didn't place window yet, but as evolution restores window's position and state (maximized), and that in maximized case it peeks window's screen with gtk_window_get_screen(), then this call "assigns" wrong monitor for the window. The test with not using maximized seems prove it.
Created attachment 217299 [details] [review] evo patch for evolution; OK, I found the issue, I caused it when I was making sure the window will be large enough by screen size. What I didn't know is that the screen consists of multiple monitors, thus, when one monitor is placed next to the second, the screen's width is width of the first monitor plus width of the second monitor. The current code (before this patch) sets window's width to whole screen, and the window manager decides to place the window, when maximized, to the second monitor, instead of the first. With this patch, evolution tests which monitor it was on the last time, and places it there, before it is maximized. There was no issue with unmaximized windows, thus I didn't touch that part of the code.
Created commit 5f0c512 in evo master (3.5.4+) Created commit bfcf55a in evo gnome-3-4 (3.4.4+)