Skip to content
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

Window position shifts after each new login #569

Open
jin-eld opened this issue Nov 17, 2019 · 25 comments
Open

Window position shifts after each new login #569

jin-eld opened this issue Nov 17, 2019 · 25 comments

Comments

@jin-eld
Copy link

jin-eld commented Nov 17, 2019

When windows get restored after each new login, their position shifts compared to the position that they had before logout.

Not sure if its a marco bug or if this should be filed vs some other component...

This is actually a regression, it worked well till some point. Unfortunately I failed to note what update has caused it (I did not update my system regularly). Originally I noticed it on Fedora 29 which used marco 1.22.3, but I did not file a bug since by that time Fedora 30 was already available and I assumed I did not have the latest MATE version. In the meantime I updated to Fedora 31 yesterday and it's still using marco 1.22.3 - the problem is also still there.

Arrange the terminal window the way you like it, make sure the session is saved and log out.

Expected behaviour

This is how I arrange my terminals, I'd like to see the same arrangement when I log back in:

correct

Actual behaviour

Instead, the windows shift by a few pixels, this is the screenshot after I logged out and had them arranged as above, and then logged in again:

shifted_01

Steps to reproduce the behaviour

Make sure you have "Save session" active, arrange the windows and log out. Log back in and see that they got restored with a certain offset compared to the previous position.

MATE general version

1.22

Package version

marco-1.22.3-1.fc31.x86_64

Linux Distribution

Fedora 31

Link to downstream report of your Distribution

I reported it here directly, please let me know if you'd like me to submit a bug with Fedora.

@lukefromdc
Copy link
Member

lukefromdc commented Nov 17, 2019 via email

@raveit65
Copy link
Member

To be sure try downgrade to marco-1.22.1-1.fc31
https://koji.fedoraproject.org/koji/buildinfo?buildID=1256950
Support for invisible border feature was added with marco-1.22.2-1 in fedora.

@jin-eld
Copy link
Author

jin-eld commented Nov 17, 2019

Can you check to see if all applicatiom wimdows or just terminal windows are moving?

Tried with mate-calculator and pluma, while mate-calculator was not restored at all (is that another issue?), pluma got restored shifted as well:

Saved:
noshift_other

Loaded:
shift_other

To be sure try downgrade to marco-1.22.1-1.fc31
https://koji.fedoraproject.org/koji/buildinfo?buildID=1256950
Support for invisible border feature was added with marco-1.22.2-1 in fedora.

I tried to downgrade, but that does not appear to be so easy as dnf starts to look for further dependencies and fails to find them, I'll try to check if there is some easy way to mass-downgrade it, otherwise I may try to compile the older version and install it manually if you think that it would help you to pinpoint the issue.

@raveit65
Copy link
Member

raveit65 commented Nov 17, 2019

I tried to downgrade, but that does not appear to be so easy as dnf starts to look for further dependencies and fails to find them, I'll try to check if there is some easy way to mass-downgrade it, otherwise I may try to compile the older version and install it manually if you think that it would help you to pinpoint the issue.

You need to install marco-1.22.1-1.fc31 by hand, i don't think that this version is available in repos via dnf.

  1. Check which packages are installed with
[root@mother rave]# rpm -qa marco*
marco-libs-debuginfo-1.23.1-2.fc30.x86_64
marco-debugsource-1.23.1-2.fc30.x86_64
marco-devel-1.23.1-2.fc30.x86_64
marco-libs-1.23.1-2.fc30.x86_64
marco-1.23.1-2.fc30.x86_64
marco-debuginfo-1.23.1-2.fc30.x86_64
[root@mother rave]# 
  1. Download needed packages by hand from https://koji.fedoraproject.org/koji/buildinfo?buildID=1256950
  2. remove marco packages with rpm --nodeps command. Eg.
rpm -e marco-libs-debuginfo-1.23.1-2.fc30.x86_64 marco-debugsource-1.23.1-2.fc30.x86_64 marco-devel-1.23.1-2.fc30.x86_64 marco-libs-1.23.1-2.fc30.x86_64 marco-1.23.1-2.fc30.x86_64 marco-debuginfo-1.23.1-2.fc30.x86_64 --nodeps
  1. Install marco rpms in download folder with
 dnf install  marco-libs-1.2.1-1.fc31.x86_64 marco-1.22.1-1.fc31.x86_64

or with rpm -ivh marco-libs-1.22.1-1.fc31.x86_64 marco-1.22.1-1.fc31.x86_64 command.

@raveit65
Copy link
Member

raveit65 commented Nov 17, 2019

Btw. i think you need to uninstall compiz packages to solve dependencies issues.
Maybe this is easier.

@jin-eld
Copy link
Author

jin-eld commented Nov 17, 2019

I had to remove marco and marco libs with all their deps and then install the old versions from koji, that seemed to work in the end. Login takes longer now, I think it does not like the mix of old and new mate applications. Anyway, I now have:

$ rpm -qa | grep marco
marco-libs-1.22.1-1.fc31.x86_64
marco-1.22.1-1.fc31.x86_64

Logged out, logged in -> terminal windows are shifted. Should I try another, more older version?

@raveit65
Copy link
Member

No, because it isn't clear that this is caused by marco.
When it happens with marco-1.22.1-1.fc31.x86_64 than it isn't caused by invisible-border support.
We need some more infos.
Are you using a monitor with HIDPI resolutions and window-scaling-factor (more than 1920x1080 px)?

[rave@mother ~]$ gsettings get org.mate.interface window-scaling-factor
2

Do you use windows-tiling (corner-tiling) with mouse or a keyboard shortcut to move the windows into their positions?
Are you sure that the issue wasn't there with the beginning of fedora 29 release?
If true it should be easier to test a fedora 29 releases iso image in a VM for me.

At least i can reproduce the issue with mate-1.23.x when i restart the marco with marco --replace and 4 open terminals without restarting the session.
Do you have same results?
If yes, i am thinking this is an older issue.
I am still wondering that this was ever working for you.
Session-saving code from mate-session-manager was always buggy and didn't work correctly.

@raveit65
Copy link
Member

raveit65 commented Nov 18, 2019

I forgot, you can restart marco with marco --replace or use fusion-icon to restart WMs, which is very comfortable.
Start it with fusion-icon -n to avoid to executing compiz WM during start of the applet.

@raveit65
Copy link
Member

I can't reproduce the issue if i only start 4 terminal like this without moving them to the monitor corners.
Bildschirmfoto zu 2019-11-18 11-39-08
Those 4 windows are exactly at their positions after restarting session or only marco.

When moving windows to corners of monitor it is clear reproducible for me. doesn't matter if restarting whole the session or only marco.
Bildschirmfoto zu 2019-11-18 11-44-45
After restarting marco:
Bildschirmfoto zu 2019-11-18 11-47-26

@jin-eld
Copy link
Author

jin-eld commented Nov 18, 2019

Thank you for looking into it!

Sorry, I will only be able to answer in detail in the evening, I don't use HIDPI resolutions and I don't think that I use any tiling features (at least not on purpose?), I have no shortcuts for moving windows.

I have a shortcut for moving windows into background though, actually I have two terminal windows over each other and I can switch between them by a keypress, which simply lowers the active window, making the one behind it become visible.

Indeed my terminals are arranged at monitor corners, so you seem to have found the trigger...

I am pretty sure that I did not have any problems with this on F29 before some update (yes, I should have written down the versions, but by that time F30 was already out and I did not want to submit a report vs an old distro).

I know that session saving is still not at 100%, in GNOME2 one could save the session once, untick the "save at exit" check box and the session would remain in the same setup forever which was a really cool feature; but since my terminal positioning never changes the current possibilities in MATE worked for me. Sure, it is a bit annoying to move firefox manually to another virtual desktop after each login, but I can live with that. My terminal setup however spreads over 3 virtual desktops and the terminals have different sizes and a specific placement, so repositioning all of them each time was quite a pain point after session restore stopped working properly.

Since you have found the trigger, do you still want me to retest the steps from your earlier post today evening, or are the current findings enough for now?

@raveit65
Copy link
Member

Btw. i have same results with caja. Starting 4 caja windows without resizing or moving them into monitor corners, doesn't cause the issue.
Bildschirmfoto zu 2019-11-18 11-58-04
Windows are at their origin positions.

@raveit65
Copy link
Member

raveit65 commented Nov 18, 2019

I am pretty sure that I did not have any problems with this on F29 before some update (yes, I should have written down the versions, but by that time F30 was already out and I did not want to submit a report vs an old distro).

Np, currently all fedora versions are using same MATE release and packages, so it should be the same.

Since you have found the trigger, do you still want me to retest the steps from your earlier post today evening, or are the current findings enough for now?

It is OK for the moment. The important point is to find out the package and his version which caused the issue, when you say it was working before.
I will try to install original fedora 29 in a VM.

@raveit65
Copy link
Member

I found out that session-state-files at `~.config/mate-session/saved-session/ won't be removed when you disable this feature.
Can you please clean up this folder and test behaviour with marco-1.22.1-1.fc31.x86_64 again?

@raveit65
Copy link
Member

You're right, issue doesn't exists with a fresh installed f29 from this iso. https://kojipkgs.fedoraproject.org/compose/29/Fedora-29-20181024.1/compose/Spins/x86_64/iso/Fedora-MATE_Compiz-Live-x86_64-29-1.2.iso
(original f29 release).
Well, main different is that f29 was release with MATE-1.20. Later after f30 release i updated f29 with MATE-1.22.

@jin-eld
Copy link
Author

jin-eld commented Nov 18, 2019

I found out that session-state-files at ~.config/mate-session/saved-session/ won't be removed when you disable this feature.
Can you please clean up this folder and test behaviour with marco-1.22.1-1.fc31.x86_64 again?

Sure, will downgrade again tonight and report back.

I did not leave the older versions installed, because it seemed to make the desktop unresponsive, i was also getting at-spi-bus-launcher related errors (not sure what that is), I assume that the older marco versions miss some functionality that has been added recently.

@raveit65
Copy link
Member

In a full updated f29 VM the issue starts with using
marco-1.22.2-1.fc29.x86_64 and mate-control-center-1.22.1-2.fc29.x86_64.
They are bundled because of marco library version (soname) bump.
With older marco-1.22.1-1.fc29.x86_64 and mate-control-center-1.22.1-1.fc29.x86_64 terminal windows doesn't shift here.

[rave@f29-original 1.22]$ ls
marco-1.22.1-1.fc29.x86_64.rpm
marco-libs-1.22.1-1.fc29.x86_64.rpm
mate-control-center-1.22.1-1.fc29.x86_64.rpm
mate-control-center-filesystem-1.22.1-1.fc29.x86_64.rpm
probably-bad
[rave@f29-original 1.22]$ ls probably-bad/
marco-1.22.2-1.fc29.x86_64.rpm
marco-libs-1.22.2-1.fc29.x86_64.rpm
mate-control-center-1.22.1-2.fc29.x86_64.rpm
mate-control-center-filesystem-1.22.1-2.fc29.x86_64.rpm

So, issue is sadly caused by invisible-border-support :/
I will look next into f31...

@jin-eld
Copy link
Author

jin-eld commented Nov 18, 2019

Would you still like that I to do the downgrade check with saved session removal or is it no longer needed?

@raveit65
Copy link
Member

raveit65 commented Nov 18, 2019

You need to downgrade to this package versions and the issue is gone.
Download them from koji.

[root@f31 without-invisible-borders]# ls
compiz-0.8.16.1-1.fc31.x86_64.rpm
marco-1.22.1-1.fc31.x86_64.rpm
marco-libs-1.22.1-1.fc31.x86_64.rpm
mate-control-center-1.22.1-1.fc31.x86_64.rpm
mate-control-center-filesystem-1.22.1-1.fc31.x86_64.rpm

I did that like this:

[root@f31 without-invisible-borders]# rpm -qa marco\*
marco-1.22.3-1.fc31.x86_64
marco-libs-1.22.3-1.fc31.x86_64
[root@f31 without-invisible-borders]# rpm -qa mate-contr\*
mate-control-center-1.22.2-2.fc31.x86_64
mate-control-center-filesystem-1.22.2-2.fc31.x86_64
[root@f31 without-invisible-borders]$ rpm -qa compiz\*
compiz-0.8.16.1-4.fc31.x86_64
[root@f31 without-invisible-borders]# rpm -e --nodeps marco-1.22.3-1.fc31.x86_64 marco-libs-1.22.3-1.fc31.x86_64 mate-control-center-1.22.2-2.fc31.x86_64 mate-control-center-filesystem-1.22.2-2.fc31.x86_64 compiz-0.8.16.1-4.fc31.x86_64
[root@f31 without-invisible-borders]# dnf install marco-1.22.1-1.fc31.x86_64.rpm marco-libs-1.22.1-1.fc31.x86_64.rpm mate-control-center-1.22.1-1.fc31.x86_64.rpm mate-control-center-filesystem-1.22.1-1.fc31.x86_64.rpm compiz-0.8.16.1-1.fc31.x86_64.rpm

With python3-dnf-plugin-versionlock-4.0.9-1.fc31.noarch you can lock version of this packages to prevent updating.

[root@f31 without-invisible-borders]# cat /etc/dnf/plugins/versionlock.list 
compiz-0.8.16.1-1.fc31.x86_64.rpm
marco-1.22.1-1.fc31.x86_64.rpm
marco-libs-1.22.1-1.fc31.x86_64.rpm
mate-control-center-1.22.1-1.fc31.x86_64.rpm
mate-control-center-filesystem-1.22.1-1.fc31.x86_64.rpm

Ok now we need to find a fix for this regression.

@jin-eld
Copy link
Author

jin-eld commented Nov 18, 2019

Thanks a lot for the instructions and for the investigation!

If you would like me to compile and try something out once you have a patch - we could do that as well.

@raveit65
Copy link
Member

@vkareh
Can you please take a look at it?
Not sure if marco is the right place to fix it, maybe mate-session-manager?
Geometry infos of windows are stored here, eg.

[rave@mother ~]$ tail -n 2 ~/.config/session-state/caja-1574075284.desktop 
[Caja]
documents=<?xml version="1.0" encoding="UTF-8"?>\n<session>\n  <history>\n    <bookmark name="rave" icon="user-home" uri="file:///home/rave"/>\n  </history>\n  <window location="file:///home/rave" type="navigation" geometry="660x436+994+524">\n    <slot location="file:///home/rave" active="TRUE"/>\n  </window>\n  <window location="file:///home/rave" type="navigation" geometry="660x436+332+58">\n    <slot location="file:///home/rave" active="TRUE"/>\n  </window>\n  <window location="file:///home/rave" type="navigation" geometry="660x436+994+58">\n    <slot location="file:///home/rave" active="TRUE"/>\n  </window>\n  <window location="file:///home/rave" type="navigation" geometry="660x436+332+524">\n    <slot location="file:///home/rave" active="TRUE"/>\n  </window>\n</session>\n

So the fix should be go into the application who write this session-state file.

@jin-eld
Copy link
Author

jin-eld commented Nov 28, 2019

In the meantime... (looking for a workaround), is it somehow possible to "lock" the last session? If I could edit the session file manually and prevent further saving, then it would always remain in the same state (which is what I want anyway). I remember when I first hit this issue I was trying to make it read-only and things like that, but it did not seem to work out.

@raveit65
Copy link
Member

No, there isn't an option to lock the session files. So mate-session creates a new session file when the old one is read-only?

@jin-eld
Copy link
Author

jin-eld commented Nov 30, 2019

No, there isn't an option to lock the session files. So mate-session creates a new session file when the old one is read-only?

If I recall correctly, then this has been the result of my tests, yes. I can recheck.
At the same time, if you untick the "Automatically remember running applications when logging out" checkbox in mate-session-properties, then it does not use the session that has been saved last, but starts without any session.

I looked in ~/.config/session-state now and see about 900 .desktop files in there which is somewhat odd. Most of them start with caja- but there are about 14 of them that stsart with terminal-:

caja-1573865598.desktop
caja-1573915250.desktop
caja-1574020953.desktop
caja-1574988194.desktop
mate-terminal-1522887005.desktop
mate-terminal-1540944553.desktop
mate-terminal-1553107005.desktop

In GNOME2 I could set up my windows, save the session and then untick the "Automatically remember..." checkbox. As a result, my saved session stayed the same forever, which is exactly what I am looking for.

What exactly is the logic of selecting the "last" session, how is the session file identified? I am thinking of adding some script on Xorg startup that would simply copy a correct "default" session file into the appropriate directory, but I need to know how to name it so that the right one gets selected. Is this saved somewhere? I tried to search for those .desktop files in dconf-editor, but was not able to find them. At least that would be a workaround... It would be great if you could hint me in the right direction or maybe suggest a better way of doing this?

@raveit65
Copy link
Member

@vkareh
Any idea how we can fix this regression by invisible-border support?

@jin-eld
Copy link
Author

jin-eld commented Jan 29, 2020

I'm also still very interested in a resolution since the behaviour is quite annoying if you have lots of terminals and can't hibernate...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants