One Hour One Life Forums

a multiplayer game of parenting and civilization building

You are not logged in.

#1 2018-03-01 23:01:32

bobpaul
Member
Registered: 2018-03-01
Posts: 4

Linux Dual Monitor

The Linux version seems to ignore dual monitor hints provided by nVidia's TwinView. I'll test on a system using an Intel driver later to see if it's better with OSS drivers.

The game opens stretched across both screens, and if the monitors have different resolution, then click accuracy is off (seems like the game fills based on the height of the taller screen but the input is tracked based on the height of the lower screen).

Only work around I've found is to disable one of the screens before launching. Normally I'd expect full screen apps to launch only on the display marked "Primary".

Offline

#2 2018-03-02 00:30:57

jasonrohrer
Administrator
Registered: 2017-02-13
Posts: 4,805

Re: Linux Dual Monitor

Sorry for the trouble... I don't have a dual-head setup to test on here, so it's really something I've never looked into.

Have you tried building from source?

Can you test something for me in the source version?

Find minorGems/graphics/openGL/ScreenGL_SDL.cpp

Line 661 is currently:

flags = SDL_OPENGL;

Change it to:

flags = SDL_OPENGL | SDL_NOFRAME;


Recompile, and then launch the game in windowed mode to see what happens.  You might also want to adjust screenWidth and screenHeight to match your target monitor, and turn useLargestWindow off (all in the settings folder).

Offline

#3 2018-03-02 22:44:02

bobpaul
Member
Registered: 2018-03-01
Posts: 4

Re: Linux Dual Monitor

jasonrohrer wrote:

You might also want to adjust screenWidth and screenHeight to match your target monitor, and turn useLargestWindow off (all in the settings folder).

Here's how my screens show in randr:

$ xrandr
Screen 0: minimum 8 x 8, current 2880 x 1200, maximum 8192 x 8192
DVI-I-0 connected 1280x1024+1600+0 (normal left inverted right x axis y axis) 376mm x 301mm
   1280x1024     60.02*+  75.02  
   1152x864      75.00  
   1024x768      75.03    60.00  
   800x600       75.00    60.32  
   640x480       75.00    59.94  
DVI-I-1 connected primary 1600x1200+0+0 (normal left inverted right x axis y axis) 367mm x 275mm
   1600x1200     60.00*+
   1280x1024     75.02    60.02  
   1152x864      75.00  
   1024x768      75.03    60.00  
   800x600       75.00    60.32  
   640x480       75.00    59.94 

I've applied the patch you suggested and built from source.

After I launch the game like this then screenWidth.ini and screenHeight.ini show 1280 and 720 respectively. Should these change on their own to match my system, are are these just the default values?

I have useLargestWindow set to 0

the log shows this:

L4 | Fri Mar  2 15:15:25 2018 (16 ms) | general | New game starting up
L4 | Fri Mar  2 15:15:25 2018 (53 ms) | general | Target game image size:  1280x720

L4 | Fri Mar  2 15:15:25 2018 (71 ms) | general | Screen dimensions for fullscreen mode:  1280x720

L4 | Fri Mar  2 15:15:25 2018 (81 ms) | general | The following frame rates are considered possible:
L4 | Fri Mar  2 15:15:25 2018 (81 ms) | general | 30 fps
L4 | Fri Mar  2 15:15:25 2018 (81 ms) | general | 60 fps
L4 | Fri Mar  2 15:15:25 2018 (81 ms) | general | 120 fps
L4 | Fri Mar  2 15:15:25 2018 (81 ms) | general | 144 fps
L4 | Fri Mar  2 15:15:25 2018 (114 ms) | general | Current screen configuration is 2880x1200 with aspect ratio 2.40
L4 | Fri Mar  2 15:15:25 2018 (114 ms) | general | Sticking with user's current screen resolution
L4 | Fri Mar  2 15:15:25 2018 (114 ms) | general | Checking if requested video mode (2880x1200) is available
L4 | Fri Mar  2 15:15:25 2018 (114 ms) | general | Available video modes:
L5 | Fri Mar  2 15:15:25 2018 (114 ms) | general |    2880 x 1200

L4 | Fri Mar  2 15:15:25 2018 (114 ms) | general |    ^^^^ this mode matches current aspect ratio
L4 | Fri Mar  2 15:15:25 2018 (114 ms) | general |    ^^^^ this mode matches requested mode
L5 | Fri Mar  2 15:15:25 2018 (114 ms) | general |    1280 x 1024

L5 | Fri Mar  2 15:15:25 2018 (114 ms) | general |    1280 x 800

L5 | Fri Mar  2 15:15:25 2018 (114 ms) | general |    1280 x 720

L5 | Fri Mar  2 15:15:25 2018 (114 ms) | general |    1152 x 864

L5 | Fri Mar  2 15:15:25 2018 (114 ms) | general |    1024 x 768

L5 | Fri Mar  2 15:15:25 2018 (114 ms) | general |    800 x 600

L5 | Fri Mar  2 15:15:25 2018 (114 ms) | general |    640 x 480

When I change screenWidth.ini and screenHeight.ini to 1600x1280 and launch the game, then the log shows:

L4 | Fri Mar  2 15:26:01 2018 (394 ms) | general | New game starting up
L4 | Fri Mar  2 15:26:01 2018 (399 ms) | general | Target game image size:  1280x720

L4 | Fri Mar  2 15:26:01 2018 (399 ms) | general | Screen dimensions for fullscreen mode:  1600x1280

L4 | Fri Mar  2 15:26:01 2018 (400 ms) | general | The following frame rates are considered possible:
L4 | Fri Mar  2 15:26:01 2018 (400 ms) | general | 30 fps
L4 | Fri Mar  2 15:26:01 2018 (400 ms) | general | 60 fps
L4 | Fri Mar  2 15:26:01 2018 (400 ms) | general | 120 fps
L4 | Fri Mar  2 15:26:01 2018 (400 ms) | general | 144 fps
L4 | Fri Mar  2 15:26:01 2018 (417 ms) | general | Current screen configuration is 2880x1200 with aspect ratio 2.40
L4 | Fri Mar  2 15:26:01 2018 (417 ms) | general | Sticking with user's current screen resolution
L4 | Fri Mar  2 15:26:01 2018 (417 ms) | general | Checking if requested video mode (2880x1200) is available
L4 | Fri Mar  2 15:26:01 2018 (417 ms) | general | Available video modes:
L5 | Fri Mar  2 15:26:01 2018 (417 ms) | general |    2880 x 1200

L4 | Fri Mar  2 15:26:01 2018 (417 ms) | general |    ^^^^ this mode matches current aspect ratio
L4 | Fri Mar  2 15:26:01 2018 (417 ms) | general |    ^^^^ this mode matches requested mode

If I disable fullscreen and launch, it shows this in the logs

L4 | Fri Mar  2 15:26:01 2018 (394 ms) | general | New game starting up                             
L4 | Fri Mar  2 15:26:01 2018 (399 ms) | general | Target game image size:  1280x720 
L4 | Fri Mar  2 15:26:01 2018 (399 ms) | general | Screen dimensions for fullscreen mode:  1600x1280
                                                                                                    
L4 | Fri Mar  2 15:26:01 2018 (400 ms) | general | The following frame rates are considered possible:
L4 | Fri Mar  2 15:26:01 2018 (400 ms) | general | 30 fps                                           
L4 | Fri Mar  2 15:26:01 2018 (400 ms) | general | 60 fps                                           
L4 | Fri Mar  2 15:26:01 2018 (400 ms) | general | 120 fps                                          
L4 | Fri Mar  2 15:26:01 2018 (400 ms) | general | 144 fps                                          
L4 | Fri Mar  2 15:26:01 2018 (417 ms) | general | Current screen configuration is 2880x1200 with aspect ratio 2.40
L4 | Fri Mar  2 15:26:01 2018 (417 ms) | general | Sticking with user's current screen resolution   
L4 | Fri Mar  2 15:26:01 2018 (417 ms) | general | Checking if requested video mode (2880x1200) is available
L4 | Fri Mar  2 15:26:01 2018 (417 ms) | general | Available video modes:                           
L5 | Fri Mar  2 15:26:01 2018 (417 ms) | general |    2880 x 1200                                   
                                                                                                    
L4 | Fri Mar  2 15:26:01 2018 (417 ms) | general |    ^^^^ this mode matches current aspect ratio   
L4 | Fri Mar  2 15:26:01 2018 (417 ms) | general |    ^^^^ this mode matches requested mode 

and it actually launches with 1500x1200 geometry, instead of the 1600x1200 requested in the screen*.ini files.

$ xwininfo

xwininfo: Please select the window about which you
          would like information by clicking the
          mouse in that window.

xwininfo: Window id: 0x4c0000e "OneLife"

  Absolute upper-left X:  0
  Absolute upper-left Y:  31
  Relative upper-left X:  0
  Relative upper-left Y:  0
  Width: 1500
  Height: 1200
  Depth: 24
  Visual: 0x22
  Visual Class: DirectColor
  Border width: 0
  Class: InputOutput
  Colormap: 0x4c0000c (installed)
  Bit Gravity State: ForgetGravity
  Window Gravity State: NorthWestGravity
  Backing Store State: NotUseful
  Save Under State: no
  Map State: IsViewable
  Override Redirect State: no
  Corners:  +0+31  -1380+31  -1380--31  +0--31
  -geometry 1500x1200+0+31

----------------

Launching the Binary game
with the screen*.ini files configured for 1600x1200 and useLargestWindow 0 gives:

L4 | Fri Mar  2 16:28:50 2018 (263 ms) | general | New game starting up
L4 | Fri Mar  2 16:28:50 2018 (263 ms) | general | Target game image size:  1280x720

L4 | Fri Mar  2 16:28:50 2018 (263 ms) | general | Screen dimensions for fullscreen mode:  640x480

L4 | Fri Mar  2 16:28:50 2018 (263 ms) | general | The following frame rates are considered possible:
L4 | Fri Mar  2 16:28:50 2018 (263 ms) | general | 60 fps
L4 | Fri Mar  2 16:28:50 2018 (263 ms) | general | 120 fps
L4 | Fri Mar  2 16:28:50 2018 (263 ms) | general | 144 fps
L4 | Fri Mar  2 16:28:50 2018 (263 ms) | general | Current screen configuration is 2880x1200 with aspect ratio 2.40
L4 | Fri Mar  2 16:28:50 2018 (263 ms) | general | Sticking with user's current screen resolution
L4 | Fri Mar  2 16:28:50 2018 (263 ms) | general | Checking if requested video mode (2880x1200) is available
L4 | Fri Mar  2 16:28:50 2018 (263 ms) | general | Available video modes:
L5 | Fri Mar  2 16:28:50 2018 (263 ms) | general |    2880 x 1200

L4 | Fri Mar  2 16:28:50 2018 (263 ms) | general |    ^^^^ this mode matches current aspect ratio
L4 | Fri Mar  2 16:28:50 2018 (263 ms) | general |    ^^^^ this mode matches requested mode

In the binary game it seems impossible to disable full screen.

Let me know what you'd like me to try next.

Offline

#4 2018-03-05 23:16:20

jasonrohrer
Administrator
Registered: 2017-02-13
Posts: 4,805

Re: Linux Dual Monitor

So... did the NOFRAME patch change the "stretched across both monitors" issue?

I was trying to see if a "fullscreen window" would help you.  In order to try this, you need to turn fullscreen off (0) in fullscreen.ini

UseLargestWindow only affects windowed mode.  Fullscreen mode is controlled by fullscreen.ini

Offline

#5 2018-03-06 21:46:17

bobpaul
Member
Registered: 2018-03-01
Posts: 4

Re: Linux Dual Monitor

With and without the patch it always picks 2880 x 1200 (stretch across both screens) when in fullscreen mode.

Offline

#6 2018-03-07 23:38:53

jasonrohrer
Administrator
Registered: 2017-02-13
Posts: 4,805

Re: Linux Dual Monitor

Hmm....  that's too bad!

Well, I will work on this some for the next update and we'll see if it helps you.

Offline

#7 2018-03-08 06:54:08

ElPasmo
Member
Registered: 2018-03-05
Posts: 4

Re: Linux Dual Monitor

Thanks a lot jason! I'm having this problem too. Currently using debian with i3.

Offline

Board footer

Powered by FluxBB