sebhildebrandt / systeminformation

System Information Library for Node.JS
MIT License
2.7k stars 306 forks source link

si.graphics() > Show same data PositionX and PositionY with 2 screens #866

Open giegiey opened 10 months ago

giegiey commented 10 months ago

Describe the bug I have Ubuntu PC that connected with 2 monitors and I need to get these position and resolution information for both monitors but it seem have issue on si.graphics() to get a correct output of positionX and positionY and the output for both monitors is 0. It works fine on Windows 10.

Thanks.

To Reproduce Steps to reproduce the behavior:

si.graphics()

Current Output

Screen: 0 Width: 1920
Screen: 0 Height: 1080
Screen: 0 Pos X: 0
Screen: 0 Pos Y: 0
Screen: 0 Info: {"vendor":"","model":"43PUT6002/98","deviceName":"","main":true,"builtin":false,"connection":"VGA-1","sizeX":953,"sizeY":543,"pixelDepth":24,"resolutionX":1920,"resolutionY":1080,"currentResX":1920,"currentResY":1080,
"positionX":0,"positionY":0,"currentRefreshRate":59}
Screen: 1 Width: 1920
Screen: 1 Height: 1080
Screen: 1 Pos X: 0
Screen: 1 Pos Y: 0
Screen: 1 Info: {"vendor":"","model":"43PUT6002/98","main":false,"builtin":false,"connection":"HDMI-2","sizeX":953,"sizeY":543,"pixelDepth":24,"resolutionX":1920,"resolutionY":1080,"currentResX":1920,"currentResY":1080,
"positionX":0,"positionY":0,"currentRefreshRate":60}
Total Width: 1920
Total Height: 2160

Expected behavior

player@player-desktop:~/player$ xrandr
Screen 0: minimum 320 x 200, current 3840 x 1080, maximum 16384 x 16384
VGA-1 connected primary 1920x1080+1920+0 (normal left inverted right x axis y axis) 953mm x 543mm
   1920x1080     59.96*+
   1600x900      60.00  
   1280x1024     60.02  
   1280x960      60.00  
   1360x768      60.02  
   1280x720      60.00  
   1024x768      60.00  
   800x600       60.32  
   640x480       59.94  
   720x400       70.08  
HDMI-1 disconnected (normal left inverted right x axis y axis)
DP-1 disconnected (normal left inverted right x axis y axis)
HDMI-2 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 698mm x 393mm
   1920x1080     60.00*   50.00    59.94    30.00    25.00    24.00    29.97    23.98  
   1920x1080i    60.00    50.00    59.94  
   1600x900      60.00  
   1280x1024     60.02  
   1280x720      60.00    50.00    59.94  
   1024x768      60.00  
   800x600       60.32  
   720x576       50.00  
   720x576i      50.00  
   720x480       60.00    59.94  
   720x480i      60.00    59.94  
   640x480       60.00    59.94 

Environment (please complete the following information):

To get all needed environment information, please run the following command:

  npx systeminformation info

Operating System: Platform : linux Distro : Ubuntu Release : 22.04.3 LTS Codename : Jammy Jellyfish Kernel : 6.2.0-36-generic Arch : x64 Hostname : player-desktop Codepage : UTF-8 Build :

System: Manufacturer : Model : Version : Virtual :

CPU: Manufacturer : Intel Brand : Celeron® J1900 Family : 6 Model : 55 Stepping : 8 Speed : 1.99 Cores : 4 PhysicalCores : 4 PerformanceCores : 4 EfficiencyCores : Processors : 1 Socket :

Additional context Add any other context about the problem here.

sebhildebrandt commented 10 months ago

@giegiey ... thank you for providing detailed information. I see the point and I will provide a fix for it the next few days.