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 opens on wrong (disconnected) monitor #697

Open
2 tasks done
patrikhuber opened this issue Dec 30, 2019 · 7 comments
Open
2 tasks done

Window opens on wrong (disconnected) monitor #697

patrikhuber opened this issue Dec 30, 2019 · 7 comments
Labels

Comments

@patrikhuber
Copy link

patrikhuber commented Dec 30, 2019

Bug report

  • I understand the difference between Streamlink and Streamlink Twitch GUI.
  • This is a bug report and I have read the contribution guidelines.

Environment details

Operating system and version:
Windows 10 Pro 1903

Streamlink Twitch GUI version:
v1.8.1

Description

I normally run a dual monitor setup (one on the laptop, the other one external). Usually the external one is set as my primary in Windows.

I am now only using the laptop, without the external monitor attached. Windows is set to "PC screen only" (Win+P), and Windows is aware that only one (the internal one) is there. I also rebooted Windows with no monitor attached.

When I open streamlink-twitch-gui, "nothing" appears. But if I hover over the task bar, I can see that it did indeed open and it looks like it's open on the (non-existent) external monitor (i.e. if I hover over the icon, the preview of the open GUI appears in the task bar).

Sometimes, with other apps, what one can do is click the icon (so that the app window is in focus), and then press Win+ArrowKeyRight (or Left), to move around the "invisible" window between screens and make it appear on the "main" screen. However this did not work here.

Expected / Actual behavior

If only one monitor is there, streamlink-twitch-gui should appear on the monitor, and not "hidden" on a non-existent monitor.

Reproduction steps

See above.

Log output

I was able to "fix" it and make it appear on the main screen with streamlink-twitch-gui.exe --reset-window. So, feel free to close this, but I thought you might be interested in the bug report.

Likely related: #604.

@bastimeyer
Copy link
Member

This is a bit surprising. Before Streamlink Twitch GUI's window becomes visible, it first performs an out-of-bounds detection, and it also does this each time the screen configuration changes while the app is running. This all relies on the screen interface which NW.js provides, but since it has to be tested with a stubbed interface, it's possible that something changed over the past NW.js release upgrades and broke the current implementation.

I'll take a look at it when I get the time. I'll also see if I can add some debug log messages to the initializer, so users can understand what's going on without having to use a development build.

v1.8.1

Btw, you're not using the latest version. The lastest one is currently v1.9.0.
https://github.com/streamlink/streamlink-twitch-gui/releases/latest

@bastimeyer bastimeyer added the bug label Dec 30, 2019
@patrikhuber
Copy link
Author

Hi Sebastian,

Cool, thanks for the info! Very interesting. Indeed I started streamlink-twitch-gui multiple times and also rebooted Windows multiple times (over several days) and it always appeared "hidden". So it does seem that there is a certain state upon initialisation where a check is missing. But it might be something that's impossible to reproduce... :).

Btw, you're not using the latest version. The lastest one is currently v1.9.0.

Yep I just updated streamlink and streamlink-twitch-gui, thanks. As I already used --reset-window, I can't try it with v1.9.0 unfortunately.

In any case feel free to just close this. In case it happens again, I'll dig up this issue (or someone else might find it if they encounter it).

Enjoy the rest of the holiday period and happy new year!

@JeffR1992
Copy link

JeffR1992 commented Apr 10, 2022

It seems this issue is still out there. If I open streamlink-twitch-gui and move the window to my external monitor, and then try and use it at a later time when my external monitor is disconnected, I'm unable to see the window and there doesn't seem to be a way to get it onto my "primary" laptop screen. An example of this happening was this weekend when I was travelling with only my laptop and had no external monitor. Since streamlink-twitch-gui was "stuck" in my non-existent external monitor, there was no way for me to move it to my laptop screen (unless I went to, say, a public library to quickly plug an external monitor into my laptop, and then move streamlink-twitch-gui over to my laptop screen and then disconnect the public monitor, but this is far from ideal).

I'm currently getting this issue with the latest Streamlink Twitch GUI build.

@imatschoolrn11
Copy link

You can fix this not a real fix by using an application that forces a screen application to open on a certain also try reconnecting a monitor and dragging it back it reopens back to where it last was.

@bastimeyer
Copy link
Member

The --reset-window parameter exists for this specific reason. This can be set as a launch parameter and it can also be passed to the already running instance, so that it'll reset its window position.
https://github.com/streamlink/streamlink-twitch-gui/wiki/Parameters#--reset-window

If no prior screen position was saved, which happens whenever the window gets moved or resized, then Streamlink Twitch GUI will always open in the center of the default screen. This is handled by NW.js.

As I already explained in my previous comment, when moving/resizing the application window or when starting the application, there's an out-of-bounds check being performed. It is possible though that something has changed or broke in NW.js, so the screen data which this mechanism relies on is broken.

AFAIK, Chromium has introduced a new screen API which could be used instead of the one NW.js provides.

@donnydark0
Copy link

I believe I have the same issue on MacOS. Usually I have to open it 2-3 times until the window appears.

@amyspark
Copy link

Can confirm it still happens on macOS 11.7.3. It's really easy to trigger, connect an external monitor, move Streamlink to it, close it in said desktop, then remove the monitor. Streamlink will stubbornly remain invisible (even after clearing all application state, preferences, etc.) until --reset-window is applied from the Terminal.

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

No branches or pull requests

6 participants