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

Windows spawn off-screen after remote desktop #471

Closed
3 tasks done
PotatoAdmin opened this issue Mar 22, 2017 · 20 comments · Fixed by #509
Closed
3 tasks done

Windows spawn off-screen after remote desktop #471

PotatoAdmin opened this issue Mar 22, 2017 · 20 comments · Fixed by #509

Comments

@PotatoAdmin
Copy link

I confirm (by marking "x" in the [ ] below):


Summary
Mattermost client spawns off-screen after using the remote desktop feature.

  • Operating System: Windows 10 Enterprise
  • Mattermost Desktop App version: 3.6.0
  • Mattermost Server version: 3.6.0 (3.6.1)

Steps to reproduce

1-Open mattermost.
2-Move the window to a secondary screen.
3-Access the computer using the remote desktop feature as the same user.
4-Disconnect from the remote desktop session.
5-After logging in the computer directly, the mattermost window is still running but it spawns to an off-screen location.

Expected behavior
The mattermost window should be visible on the secondary screen like before the remote desktop session.

Observed behavior
The mattermost window spawns off-screen.

Possible fixes
As depicted in a previous issue marked as solved, deleting
%USERPROFILE%\AppData\Roaming\Mattermost\bounds-info.json
after completely closing the client works.

@jasonblais
Copy link
Contributor

@jnugh looks like there are still some instances where the desktop app opens in an "invisible" screen as described above

@jnugh
Copy link
Contributor

jnugh commented Mar 22, 2017

the mattermost window is still running but it spawns to an off-screen location.

I'm not sure how Windows RD works - so I'm not sure if I got this right: When you clsoe the remote desktop session you do not log off form your user, right? So when you use your monitor you do not have to login again and all applications are still running?

The desktop app checks if it has been placed off screen during startup, so when you didn't restart the Desktop app it will not notice that it is placed in a dead area.
I was expecting that Windows moves applications that are running still to an active monitor when the viewport changes.

When you restart Mattermost after this happens (without removing bound-info.json, does it appear at a valid position?

@PotatoAdmin
Copy link
Author

PotatoAdmin commented Mar 24, 2017

For the remote session, it is like locking the computer. When using remote desktop it prompts you for the password and it's like you never left your computer. It also shows only one screen, squishing all your applications on a single screen.

In my case, I lock my workstation when leaving in the evening and sometimes have to remotely log in to access our systems. The next morning when I get back to work the session is locked. After inputting my password, mattermost's window has disappeared from its previous spot on my offscreen and is now somewhere to the far left, not visible to any screen.

The window does not "reset" to a valid position after restarting the app.

**After installing this week's windows updates, I am having trouble reproducing the problem convincingly. I will advise on the issue next week since I will have to work more often remotely. A colleague also had the same issue so I will check with him how things are going this week.

@PotatoAdmin
Copy link
Author

After some research and consultation with the colleague that had the same issue, we reached the conclusion that the windows updates, restart of the application AND deletion of the
%USERPROFILE%\AppData\Roaming\Mattermost\bounds-info.json
file fixed the trouble. Only restarting the application did not fix the problem, same with only deleting the file. It is recreated with bad values every time the application window shows up.

Before deletion, the file had some weird "X" value (-3280), thich is probably related to both of my screens resolutions (1920*2).

Thank you for your support, your software is great!

@jasonblais
Copy link
Contributor

@PotatoAdmin was deleting the %USERPROFILE%\AppData\Roaming\Mattermost\bounds-info.json file a permanent solution for you? Or has the issue reappeared?

I heard about another report where deleting the file resolved the issue temporarily but it surfaced again

@jasonblais jasonblais reopened this Apr 5, 2017
@PotatoAdmin
Copy link
Author

@jasonblais From my experience with the windows client, only deleting the file is not a permanent work-around. One has to restart the application completely (not just the window) by right-clicking on the tray icon and selecting "exit". Only then will the window start behaving normally. Before knowing which file to remove, we just restarted the computer and it did fix the issue.

@jasonblais
Copy link
Contributor

Thanks @PotatoAdmin, appreciate the prompt reply.

They did quit the app before deleting the .json file, but the issue reappeared for them.

Glad to hear it's still working for you, we'll have to investigate this more on our end

@PotatoAdmin
Copy link
Author

To be fair though, we had a wave of windows updates installation during the time we fixed the issue. Maybe there was an update that contributed to fixing the issue?

@jasonblais
Copy link
Contributor

Hm, good point @PotatoAdmin, I'll check if they've completed their windows updates. Thanks! 👍

@jasonblais
Copy link
Contributor

Looks like all their windows updates are complete.

He's on Windows 7 though, so it might be an issue specific to that OS version. I've reached out to a community member who might be able to try reproduce the issue

@jnugh
Copy link
Contributor

jnugh commented Apr 9, 2017

Again: What I did some time ago will not update windows position when a display is being removed as I thought all OS handle this event correctly by placing windows inside the new view bounds.
I might be wrong (for some versions of Windows at least) ;) I will work on a way to check window position after resolution changes.

I will simply add the check to display-metrics-changed. That should cover everything

@jasonblais jasonblais added this to the v3.7.0/3.8.0 milestone Apr 9, 2017
@PotatoAdmin
Copy link
Author

I have experienced this issue once again today. Here is the chain of events that lead to the window being spawned off-screen:
-I left work yesterday evening with my mattermost window on my left screen, which is considered my secondary screen. My computer was locked using the usual way, "Windows + L".
-Today at approx. 7AM I was prompted by a service call to do some manipulations on our infrastructure so I opened a Remote Desktop session to my workstation.
-My Mattermost window was not visible but it was showing up on the taskbar.
-Clicking on the taskbar icon only produced the usual animation but showed that the window was off-screen.

Right-clicking the taskbar item and selecting "Close the window" did not solve the issue. Completely closing the software and re-opening it did work (right-click the tray icon and selecting "exit"). The window spawned in the middle of the active screen, square-shaped in what I assume is the default shape and position.

I do not know if this information helps the cause any firther but I felt you guys would like to have a detailed walk-through of what happened to make the issue happen again.

@jasonblais
Copy link
Contributor

Thanks @PotatoAdmin! Really appreciate it

We have a pull request that attempts to fix the issue for Windows and Mac: #509

Wondering if you'd be interested downloading the test build to see if the issue reproduces for you anymore? https://circleci.com/gh/mattermost/desktop/940#artifacts

//cc @jnugh @yuya-oc

@yuya-oc
Copy link
Contributor

yuya-oc commented Apr 17, 2017

I have followed @PotatoAdmin walk-through on Windows 10. I could not restore the window on the RD console. It seems the problem happens when the window is minimized into the taskbar icon when starting RD session.

@PotatoAdmin Would you confirm whether this hypothesis is correct?

@yuya-oc
Copy link
Contributor

yuya-oc commented Apr 17, 2017

I tested other applications.

App Built with Electron Result
mspaint NO OK
cmd NO OK
iTunes NO OK
Chrome NO OK
Slack YES NG
Atom YES NG
Electron YES(itself) NG

As far as looking the results, it looks an upstream bug of Electron.

@PotatoAdmin
Copy link
Author

@yuya-oc I could not reliably reproduce the issue, though it seems to also be happening with other applications. I had a putty session spawn off-screen today and could not bring it back to the main screen­. Though this window was for sure minimized, more testing will be needed to make it a factor since I never really minimize my mattermost window.

It is probably a windows bug when disconnecting from the remote session since the remote desktop "squishes" all the available windows on one screen and then moves them back to their original position after ending the session. An application-side work-around is probably needed to fix it.

@jasonblais I will install the test version and see if the issue reappears. My next on-call shift starts next monday so I will have more testing mileage by April 27th.

@yuya-oc
Copy link
Contributor

yuya-oc commented Apr 27, 2017

Merged #509 would reset the window position if it spawns off-screen when restoring. I think this would make sense as a workaround for the problem. I'm wondering if you can test when v3.7-rc is released.

@yuya-oc yuya-oc reopened this Apr 27, 2017
@jasonblais
Copy link
Contributor

@PotatoAdmin Release candidates for 3.7 are available here, if you're interested to help test it: #516 (comment)

Really appreciate all your help troubleshooting the issue.

@PotatoAdmin
Copy link
Author

Yep, sorry for the delay. I would like to confirm this issue as closed. I have been using the new testing build for a week and a half now and the issue has not reappeared.

@jasonblais
Copy link
Contributor

jasonblais commented May 2, 2017

Awesome! That's great to hear.

Let us know if the issue resurfaces.

Again, many thanks for your help troubleshooting the issue!

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

Successfully merging a pull request may close this issue.

4 participants