ValveSoftware / Dota-2

Tracker for issues specific to Linux and Mac in the Reborn client. If you have a general issue or non-system-specific feature request please go to dev.dota2.com
472 stars 38 forks source link

Issue when moving window to other monitor #286

Open budimanjojo opened 9 years ago

budimanjojo commented 9 years ago

I think this is somehow related to issue #198. As the issue with chatwheel is now fixed (which I thought should also fixed this bug), but not. To reproduce:

  1. Use Cinnamon window manager (I think other WM is also the same)
  2. Under Keyboard - Keyboard Shortcuts - Windows -Inter-monitor - Move window to left/right monitor, bind something (defaulted to Super-Shift-Left/Right).
  3. Open Dota 2 Reborn, go play a bot game (it only happens in-game), move your window using the binded shorcut above.
  4. Now realize the mouse cursor will go to the left side if your window is on the right and right side if the window is on the left monitor. Pressing the chatwheel after this triggers the already fixed issue #198.
  5. It only happens on fullscreen window (desktop friendly and monitor sized borderless).

I also tested Dota 2 Stable and there's no such issue, only happens on Reborn.

gdrewb-valve commented 9 years ago

If you switch to windowed mode and move the window from screen to screen with the mouse does the problem still occur? I just tried that on Windows and it worked fine but it could be the wrong repro or the problem could be Linux-specific.

The game isn't good about being moved between windows while running (you won't get the correct resolution list, for example) so it's also possible it's something that isn't hooked up yet.

budimanjojo commented 9 years ago

The problem doesn't occur on windowed mode and borderless full resolution mode. No, two of my monitors are the same monitors, so it couldn't be resolution issue. On Jul 30, 2015 4:06 AM, "Drew Bliss" notifications@github.com wrote:

If you switch to windowed mode and move the window from screen to screen with the mouse does the problem still occur? I just tried that on Windows and it worked fine but it could be the wrong repro or the problem could be Linux-specific.

The game isn't good about being moved between windows while running (you won't get the correct resolution list, for example) so it's also possible it's something that isn't hooked up yet.

— Reply to this email directly or view it on GitHub https://github.com/ValveSoftware/Dota-2-Reborn/issues/286#issuecomment-126095625 .

gdrewb-valve commented 9 years ago

I meant if you start fullscreen, switch to windowed, drag the window to a different monitor and then switch back to fullscreen.

budimanjojo commented 9 years ago

Tried that, the mouse cursor is good after doing that, but the chatwheel still broken after that.

gdrewb-valve commented 9 years ago

I'm not able to repro the chatwheel problem on my Linux multimon box. We'll have to see if we can recreate the right configuration.

Tele42 commented 9 years ago

Odd gremlins like this tend to appear more often when the primary monitor is on the right and the secondary is on the left. @budimanjojo, what is your monitor layout? I'm guessing the game is launching on the left-most screen and you're moving it to the primary screen (right).

gdrewb-valve commented 9 years ago

I tried it with the secondary both to the left of the primary and to the right and it worked OK. My test may still not be representative as my monitors have different resolutions, but it does seem like it isn't a simple problem.

budimanjojo commented 9 years ago

@Tele42 The game is launching on the right monitor by default. My primary screen is on the right.

@gdrewb-valve Now it's getting weirder, to be more specific, look at the video below. The cursor is moving like crazy and sometimes the chatwheel is broken but sometimes not. After it is broken all I can do is either close the entire Dota 2 or changing to small resolution windowed mode. But sometimes small resolution borderless fixed the problem. Really weird. Sorry for the low quality video, my upload speed is too slow. https://www.dropbox.com/s/49nrno3pp7di5la/Dota.flv?dl=0

gdrewb-valve commented 9 years ago

Thanks for the extra info, that is quite strange. If we can repro we should be able to isolate the issue but this isn't a high priority, unfortunately.

budimanjojo commented 9 years ago

Ok, I won't be moving my screen around while playing too. Just hoping for a bug free stable release later, take your time guys :)

budimanjojo commented 9 years ago

Guys, another update. Now I can workaround the bug by doing a "Show Desktop". So basically all I do is doing a show desktop shortcut (Super+D) in my Desktop Environment configuration. Uploaded the video below to show: https://www.dropbox.com/s/rpq994mu5txnwci/Dota%202.mp4?dl=0 @gdrewb-valve I think the chatwheel problem is not that fully fixed, because it is so weird that now my if I start Reborn from the secondary monitor (which is on the left side), it keeps going to the right (before the fix it was the primary monitor which has the issue). Maybe there are some codes you guys didn't change on the chatwheel?

Edit: it works only using "Show Desktop", Alt+tabbing out and in fixed the screen cursor problem but didn't fix the chatwheel going left/right problem.

gdrewb-valve commented 9 years ago

Something's definitely getting confused and throwing things off but we won't know what it is until we can exactly match your config.

MaikuMori commented 9 years ago

This is the closest issue that describes my problem. It's also related to #13 and #198.

When I move game window from non-primary to primary screen in most cases the chat wheel bug happens, but in some cases it works correctly.

Also when I move the reborn window using gnome overview in almost all cases it doesn't move the window in the gnome overview, but when I go back to reborn window it actually has moved to the main screen. If I minimize (alt+tab) the reborn window and then go back to it, it will jump back to the secondary monitor.

Seems like SDL is not correctly dealing with full-screen windows being moved. It should let WM move the windows and adjust correctly.

My screen setup: | Primary | | Secondary | both same size/resolution.

Did all the previous actions with full-screen mode enabled.

Another thing I noticed is that borderless window mode doesn't take into account that gnome has a global top bar on the primary screen. So if you chose same resolution for borderless window as your display resolution you can't put dota on the main screen. Gnome just doesn't allow it. If you chose smaller resolution, move to primary, change back to max resolution, it will jump back to secondary screen (this will mess up chat wheel and it will point to top when pressed, most likely due to it having stale screen data and not account for top bar height in the stale data).

In Dota 2 (not reborn) using borderless window with max resolution on primary screen with top bar causes the game to be shifted below topbar and bottom part of game window to clip/be hidden.

Actually now that I wrote all this I think I know what causes the #13 in full screen mode and borderless mode. I think it tries to take up full display resolution worth of space and gnome/wm is kicking it to the other window because on primary window there is not enough space due to the topbar. In theory it should have enough space since it's fullscreen, but maybe it tries to set window size before entering fullscreen mode.

Hope this helps, happy to help with whatever you need to debug this.

gdrewb-valve commented 9 years ago

If you use a windowed mode Reborn creates a window the size you ask for, so if your particularly environment doesn't allow such a window it's expected there will be problems.

budimanjojo commented 9 years ago

This is still happening after the 1/9 update

gdrewb-valve commented 9 years ago

Reborn isn't very good about adapting to moving between monitors so there will definitely be rough edges. Eventually that'll get fixed but probably not in the near term. It's best for now to use -sdl_displayindex to have Reborn start on the monitor you want (and that might require choosing windowed / fullscreen / resolution in a way that allows the game window to fit on your monitor).

budimanjojo commented 9 years ago

Okay, I was just reminding people that this is still happening. I've got no problem because I don't move it around as it launches on my primary monitor without any tinkering. Thanks gdrewb, just focus on other more important fixes :)

gdrewb-valve commented 9 years ago

Yes, and thanks for the feedback. I just wanted to clarify for other people reading that this isn't expected to be fixed right now.