electron icon indicating copy to clipboard operation
electron copied to clipboard

[Bug]: Set resolution is smaller by 1px on Linux

Open zrudzionis opened this issue 1 year ago • 4 comments

Preflight Checklist

Electron Version

27.0.1

What operating system are you using?

Ubuntu on Lenovo ThinkPad L490

Operating System Version

Ubuntu 20.04.6 LTS 64bit

What arch are you using?

x64

Last Known Working Electron version

No response

Expected Behavior

When display is 1920x1080 resolution should be set correctly to 1920x1080 if this sequence of actions is used:

  const mainWindow = new BrowserWindow({
    fullscreen: true,
    frame: false,
    show: false,
    webPreferences: {
      preload: path.join(__dirname, 'preload.js')
    }
  })

  mainWindow.setBounds({ x: 0, y: 0, width: 1920, height: 1080 })

  mainWindow.loadFile('index.html')

  mainWindow.show()

Actual Behavior

There is around 20% change that resolution will be set to 1919x1079.

Testcase Gist URL

https://github.com/zrudzionis/electron-quick-start

Additional Information

To reproduce this follow the steps:

  1. Clone repo: https://github.com/zrudzionis/electron-quick-start.
  2. Use node 18 with nvm use 18.
  3. Install dependencies yarn install
  4. Start electron with yarn start multiple times until resolution will be 1919x1079. You will have around 20% chance of reproducing this issue.

Reproducing video: https://github.com/electron/electron/assets/3447630/68c13696-6194-484c-8bd2-ad15e25a3e1f

My specs: specs

My screen information:

  xrandr --prop
Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 16384 x 16384
eDP-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 309mm x 174mm
	EDID: 
		00ffffffffffff0026cf7d0500000000
		001b0104951f11780a76909455549027
		21505400000001010101010101010101
		010101010101383680a0703820401830
		3c0035ae100000190000000000000000
		00000000000000000000000000fe0049
		6e666f566973696f6e0a2020000000fe
		00523134304e574635205236200a0010
	scaling mode: Full aspect 
		supported: Full, Center, Full aspect
	Colorspace: Default 
		supported: Default, RGB_Wide_Gamut_Fixed_Point, RGB_Wide_Gamut_Floating_Point, opRGB, DCI-P3_RGB_D65, BT2020_RGB, BT601_YCC, BT709_YCC, XVYCC_601, XVYCC_709, SYCC_601, opYCC_601, BT2020_CYCC, BT2020_YCC
	max bpc: 12 
		range: (6, 12)
	Broadcast RGB: Automatic 
		supported: Automatic, Full, Limited 16:235
	panel orientation: Normal 
		supported: Normal, Upside Down, Left Side Up, Right Side Up
	link-status: Good 
		supported: Good, Bad
	CONNECTOR_ID: 95 
		supported: 95
	non-desktop: 0 
		range: (0, 1)
   1920x1080     60.01*+  60.01    59.97    59.96    59.93  
   1680x1050     59.95    59.88  
   1600x1024     60.17  
   1400x1050     59.98  
   1600x900      59.99    59.94    59.95    59.82  
   1280x1024     60.02  
   1440x900      59.89  
   1400x900      59.96    59.88  
   1280x960      60.00  
   1440x810      60.00    59.97  
   1368x768      59.88    59.85  
   1360x768      59.80    59.96  
   1280x800      59.99    59.97    59.81    59.91  
   1152x864      60.00  
   1280x720      60.00    59.99    59.86    59.74  
   1024x768      60.04    60.00  
   960x720       60.00  
   928x696       60.05  
   896x672       60.01  
   1024x576      59.95    59.96    59.90    59.82  
   960x600       59.93    60.00  
   960x540       59.96    59.99    59.63    59.82  
   800x600       60.00    60.32    56.25  
   840x525       60.01    59.88  
   864x486       59.92    59.57  
   800x512       60.17  
   700x525       59.98  
   800x450       59.95    59.82  
   640x512       60.02  
   720x450       59.89  
   700x450       59.96    59.88  
   640x480       60.00    59.94  
   720x405       59.51    58.99  
   684x384       59.88    59.85  
   680x384       59.80    59.96  
   640x400       59.88    59.98  
   576x432       60.06  
   640x360       59.86    59.83    59.84    59.32  
   512x384       60.00  
   512x288       60.00    59.92  
   480x270       59.63    59.82  
   400x300       60.32    56.34  
   432x243       59.92    59.57  
   320x240       60.05  
   360x202       59.51    59.13  
   320x180       59.84    59.32  
DP-1 disconnected (normal left inverted right x axis y axis)
	HDCP Content Type: HDCP Type0 
		supported: HDCP Type0, HDCP Type1
	Content Protection: Undesired 
		supported: Undesired, Desired, Enabled
	Colorspace: Default 
		supported: Default, RGB_Wide_Gamut_Fixed_Point, RGB_Wide_Gamut_Floating_Point, opRGB, DCI-P3_RGB_D65, BT2020_RGB, BT601_YCC, BT709_YCC, XVYCC_601, XVYCC_709, SYCC_601, opYCC_601, BT2020_CYCC, BT2020_YCC
	max bpc: 12 
		range: (6, 12)
	Broadcast RGB: Automatic 
		supported: Automatic, Full, Limited 16:235
	audio: auto 
		supported: force-dvi, off, auto, on
	subconnector: Unknown 
		supported: Unknown, VGA, DVI-D, HDMI, DP, Wireless, Native
	link-status: Good 
		supported: Good, Bad
	CONNECTOR_ID: 103 
		supported: 103
	non-desktop: 0 
		range: (0, 1)
HDMI-1 disconnected (normal left inverted right x axis y axis)
	HDCP Content Type: HDCP Type0 
		supported: HDCP Type0, HDCP Type1
	Content Protection: Undesired 
		supported: Undesired, Desired, Enabled
	max bpc: 12 
		range: (8, 12)
	content type: No Data 
		supported: No Data, Graphics, Photo, Cinema, Game
	Colorspace: Default 
		supported: Default, SMPTE_170M_YCC, BT709_YCC, XVYCC_601, XVYCC_709, SYCC_601, opYCC_601, opRGB, BT2020_CYCC, BT2020_RGB, BT2020_YCC, DCI-P3_RGB_D65, DCI-P3_RGB_Theater
	aspect ratio: Automatic 
		supported: Automatic, 4:3, 16:9
	Broadcast RGB: Automatic 
		supported: Automatic, Full, Limited 16:235
	audio: auto 
		supported: force-dvi, off, auto, on
	link-status: Good 
		supported: Good, Bad
	CONNECTOR_ID: 113 
		supported: 113
	non-desktop: 0 
		range: (0, 1)
DP-2 disconnected (normal left inverted right x axis y axis)
	HDCP Content Type: HDCP Type0 
		supported: HDCP Type0, HDCP Type1
	Content Protection: Undesired 
		supported: Undesired, Desired, Enabled
	Colorspace: Default 
		supported: Default, RGB_Wide_Gamut_Fixed_Point, RGB_Wide_Gamut_Floating_Point, opRGB, DCI-P3_RGB_D65, BT2020_RGB, BT601_YCC, BT709_YCC, XVYCC_601, XVYCC_709, SYCC_601, opYCC_601, BT2020_CYCC, BT2020_YCC
	max bpc: 12 
		range: (6, 12)
	Broadcast RGB: Automatic 
		supported: Automatic, Full, Limited 16:235
	audio: auto 
		supported: force-dvi, off, auto, on
	subconnector: Unknown 
		supported: Unknown, VGA, DVI-D, HDMI, DP, Wireless, Native
	link-status: Good 
		supported: Good, Bad
	CONNECTOR_ID: 119 
		supported: 119
	non-desktop: 0 
		range: (0, 1)
HDMI-2 disconnected (normal left inverted right x axis y axis)
	HDCP Content Type: HDCP Type0 
		supported: HDCP Type0, HDCP Type1
	Content Protection: Undesired 
		supported: Undesired, Desired, Enabled
	max bpc: 12 
		range: (8, 12)
	content type: No Data 
		supported: No Data, Graphics, Photo, Cinema, Game
	Colorspace: Default 
		supported: Default, SMPTE_170M_YCC, BT709_YCC, XVYCC_601, XVYCC_709, SYCC_601, opYCC_601, opRGB, BT2020_CYCC, BT2020_RGB, BT2020_YCC, DCI-P3_RGB_D65, DCI-P3_RGB_Theater
	aspect ratio: Automatic 
		supported: Automatic, 4:3, 16:9
	Broadcast RGB: Automatic 
		supported: Automatic, Full, Limited 16:235
	audio: auto 
		supported: force-dvi, off, auto, on
	link-status: Good 
		supported: Good, Bad
	CONNECTOR_ID: 125 
		supported: 125
	non-desktop: 0 
		range: (0, 1)

zrudzionis avatar Oct 20 '23 20:10 zrudzionis

bump!!

wugaosheng123 avatar Nov 01 '23 08:11 wugaosheng123

"Also affected"!

mrudzevicius avatar Nov 07 '23 12:11 mrudzevicius

I've also just come across this! Any updates Electron team?

lucaspiller avatar Dec 04 '23 09:12 lucaspiller

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!

This issue has been closed due to inactivity, and will not be monitored. If this is a bug and you can reproduce this issue on a supported version of Electron please open a new issue and include instructions for reproducing the issue.

sometimes windows also has this problem

klren0312 avatar Apr 16 '24 10:04 klren0312