streamlink-twitch-gui icon indicating copy to clipboard operation
streamlink-twitch-gui copied to clipboard

Window opens on wrong (disconnected) monitor

Open patrikhuber opened this issue 5 years ago • 7 comments

Bug report

  • [x] I understand the difference between Streamlink and Streamlink Twitch GUI.
  • [x] 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: https://github.com/streamlink/streamlink-twitch-gui/issues/604.

patrikhuber avatar Dec 30 '19 13:12 patrikhuber

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 avatar Dec 30 '19 14:12 bastimeyer

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!

patrikhuber avatar Dec 30 '19 15:12 patrikhuber

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.

JeffR1992 avatar Apr 10 '22 01:04 JeffR1992

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.

imatschoolrn11 avatar Apr 21 '22 19:04 imatschoolrn11

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.

bastimeyer avatar Apr 21 '22 19:04 bastimeyer

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

donnydark0 avatar Nov 01 '22 17:11 donnydark0

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.

amyspark avatar Feb 12 '23 18:02 amyspark