Opened 9 years ago

Closed 5 years ago

Last modified 5 years ago

#3095 closed defect (fixed)

Multimonitor issues

Reported by: yrral86 Owned by:
Priority: Should Have Milestone: Alpha 19
Component: Core engine Keywords:
Cc: Patch:

Description

I have a two monitor setup on Linux with two different resolutions. If I start the game non-windowed, it stretches across both screens, and I can only see the top portion of the left hand side (smaller resolution monitor is to the left). If I start it in windowed mode, it opens on the large screen, expanded to that size, but the drawing area is the resolution of the smaller screen. There is a black border to the right and bottom. If I unmaximize and remaximize, the border goes away and it properly stretches the drawing area full screen (minus the taskbar, window decorations, etc.) Not a showstopper, but this could use some polish.

Change History (12)

comment:1 by Timothy Hamlett, 9 years ago

What version of linux? It sounds like a problem with your OS and driver, not the game.

comment:2 by yrral86, 9 years ago

Arch Linux, open source ATI, no problems with any steam game I've tried.

Linux larry-swarga 3.18.6-1-ARCH #1 SMP PREEMPT Sat Feb 7 08:44:05 CET 2015 x86_64 GNU/Linux
extra/glu 9.0.0-3 [installed]
extra/mesa 10.4.6-1 [installed]
extra/mesa-demos 8.2.0-4 [installed]
extra/mesa-libgl 10.4.6-1 [installed]
extra/mesa-vdpau 10.4.6-1 [installed]
extra/opencl-mesa 10.4.6-1 [installed]
multilib/lib32-glu 9.0.0-2 [installed]
multilib/lib32-mesa 10.4.6-1 [installed]
multilib/lib32-mesa-demos 8.2.0-2 [installed]
multilib/lib32-mesa-libgl 10.4.6-1 [installed]
multilib/lib32-mesa-vdpau 10.4.6-1 [installed]
extra/xf86-video-ati 1:7.5.0-2 (xorg-drivers xorg) [installed]

comment:3 by yrral86, 9 years ago

I'm going to try to see if I can find the window init code and take a look... any pointers would be appreciated.

comment:4 by yrral86, 9 years ago

I found a couple of old reports of at least the screen-splitting issue.

On Ubuntu 10.4: http://wildfiregames.com/forum/index.php?showtopic=13673

Also reported here with an nvidia card: http://ubuntuforums.org/showthread.php?t=1879385

comment:5 by historic_bruno, 9 years ago

Multimonitor problems should be reduced or eliminated with SDL2, but on Linux you would have to build the game yourself from SVN and enable SDL2 to test that (testing is appreciated!) Eventually, Linux packagers should use SDL2 when building the game, I don't know if any of them will for A18.

comment:6 by yrral86, 9 years ago

Compiling by passing --sdl2 to update-workspaces.sh did indeed address these two issues. Fullscreen only covers the main screen, and windowed mode opens smaller than the full screen (the same size it was rendering before). I can then maximize it just fine (by dragging the title bar to the top center of the screen since there is no maximize button). However, if I drag the title bar away from the top, which should restore the application to its original size, it jumps back to the original size, and then proceeds to slowly grow in both directions until I release the mouse. This is a regression from the SDL1 version.

comment:7 by yrral86, 9 years ago

Actually, it is not a regression. It also occurs on the distro packaged version (15849-release), I just hadn't tried unmaximizing.

Anyway, I have played a full round with SDL2 and it works great. I was seeing some glitching and the mouse cursor would stop changing on hovering over certain things with SDL1, but I didn't see any of that with SDL2.

comment:8 by yrral86, 9 years ago

I added some debugging statements and determined that the height increases by 38 each iteration and width increase by 12. I would speculate that this is the window border + title bar. SDL is being told to set the video mode to width x height which triggers a resize event. This again calls resize window, which returns if the size hasn't changed, but the size passed in by the event has increased by the window decorations, causing another increase and the cycle repeats.

I will look into how the new size is being extracted from the event and dig through the SDL docs to see if there is a way to get only the size of the window interior, excluding the decorations.

comment:9 by yrral86, 9 years ago

Definitely an SDL bug. I overloaded in_poll_event from input.cpp with this:

int in_poll_event(SDL_Event_* event, SDL_Window* w) {
  int x, y, ret;

  if (!priority_events.empty())
    {
      *event = priority_events.front();
      priority_events.pop_front();
      return 1;
    }

  SDL_GetWindowSize(w, &x, &y);
  debug_printf("before PollEvent w: %d h: %d\n", x, y);

  ret = SDL_PollEvent(&event->ev);

  SDL_GetWindowSize(w, &x, &y);
  debug_printf("after PollEvent w: %d h: %d\n", x, y);
  return ret;
}

And I caught PollEvent in the act of changing the window size:

before PollEvent w: 1024 h: 768
after PollEvent w: 1024 h: 768
before PollEvent w: 1024 h: 768
after PollEvent w: 1024 h: 768
before PollEvent w: 1024 h: 768
after PollEvent w: 1036 h: 806

comment:10 by Vladislav Belov, 5 years ago

Resolution: fixed
Status: newclosed

SDL2 is used by default since: r16586.

SDL1 was completely removed in: r17470.

SDL1 isn't supported and the original issue is fixed in SDL2. So the ticket should be closed.

comment:11 by elexis, 5 years ago

Milestone: BacklogAlpha 19

(No closed tickets on the backlog)

in reply to:  11 comment:12 by Vladislav Belov, 5 years ago

Replying to elexis:

(No closed tickets on the backlog)

Thanks! I wasn't sure about this, so I left it as is.

Note: See TracTickets for help on using tickets.