Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sampling of resolution is taking the wrong screen as baseline #940

Closed
whisperity opened this issue Dec 22, 2022 · 1 comment · Fixed by #1521
Closed

Sampling of resolution is taking the wrong screen as baseline #940

whisperity opened this issue Dec 22, 2022 · 1 comment · Fixed by #1521
Labels
bug Something isn't working

Comments

@whisperity
Copy link
Member

I have three screens. The ones on the side are 1024×768 and the one in the middle is 1920×1080. The primary screen (where the application launcher and the task bar is) is the middle screen (the one that is 1920×1080).

$ xrandr --listmonitors
Monitors: 3
 0: +*HDMI-1 1920/531x1080/299+1024+0  HDMI-1
 1: +DP-3-2-1 1024/271x768/203+2944+0  DP-3-2-1
 2: +DP-3-2-2 1024/271x768/203+0+0  DP-3-2-2

Let's suppose now I start Contour in this configuration. What is observed, is that the window, when compared against the entire viewport, is of a really weird and unusual shape:

Screenshot_20221222_180759

The relevant log entries:

[2022-12-22 18:08:13.356086] [gui.display] TerminalWindow.resizeEvent: size 200x100 (200x100)
[2022-12-22 18:08:13.365841] [gui.display] initializeGL: size=186x100, scale=1
[2022-12-22 18:08:13.365871] [gui.display] Assigning session to terminal widget: shell=/bin/zsh, terminalSize=80x24, fontSize=12pt, contentScale=1
[2022-12-22 18:08:13.397024] [gui.display] Loading vertex shader: :/contour/display/shaders/text.vert
[2022-12-22 18:08:13.399889] [gui.display] Loading fragment shader: :/contour/display/shaders/text.frag
[2022-12-22 18:08:13.400112] [gui.display] Loading vertex shader: :/contour/display/shaders/background_image.vert
[2022-12-22 18:08:13.400131] [gui.display] Loading fragment shader: :/contour/display/shaders/background_image.frag
[2022-12-22 18:08:13.400248] [gui.display] Loading vertex shader: :/contour/display/shaders/background.vert
[2022-12-22 18:08:13.400260] [gui.display] Loading fragment shader: :/contour/display/shaders/background.frag
[2022-12-22 18:08:13.400578] [gui.display] configureAtlas: 1024x2048 RGBA
[2022-12-22 18:08:13.472936] [gui.display] Blurring background image: /home/whisperity/Pictures/Wallpapers/world-of-warcraft-lexith-warcraft-elf-devushka-night-elf.jpg
[2022-12-22 18:08:13.477649] [gui.display] Blur: Loading shader source :/contour/display/shaders/simple.vert
[2022-12-22 18:08:13.477780] [gui.display] Blur: Loading shader source :/contour/display/shaders/blur_gaussian.frag
[2022-12-22 18:08:13.477995] [gui.display] Blur: Loading shader source :/contour/display/shaders/simple.vert
[2022-12-22 18:08:13.478011] [gui.display] Blur: Loading shader source :/contour/display/shaders/dual_kawase_up.frag
[2022-12-22 18:08:13.478119] [gui.display] Blur: Loading shader source :/contour/display/shaders/simple.vert
[2022-12-22 18:08:13.478133] [gui.display] Blur: Loading shader source :/contour/display/shaders/dual_kawase_down.frag
[2022-12-22 18:08:13.591736] [gui.display] Blur: Gaussian run performance: 0.04s CPU.
[2022-12-22 18:08:13.595770] [gui.display] Background image from disk: 3840x2160 RGBA
[2022-12-22 18:08:13.609789] [gui.display] [FYI] Build type          : RelWithDebInfo
[2022-12-22 18:08:13.609815] [gui.display] [FYI] Application PID     : 47631
[2022-12-22 18:08:13.609817] [gui.display] [FYI] OpenGL type         : OpenGL
[2022-12-22 18:08:13.609823] [gui.display] [FYI] OpenGL renderer     : Mesa Intel(R) Xe Graphics (TGL GT2)
[2022-12-22 18:08:13.609831] [gui.display] [FYI] Qt platform         : xcb
[2022-12-22 18:08:13.609839] [gui.display] [FYI] OpenGL version      : 4.6
[2022-12-22 18:08:13.609847] [gui.display] [FYI] Content scaling     : 1
[2022-12-22 18:08:13.609856] [gui.display] [FYI] GLSL version        : 4.60 (460, 450, 440, 430, 420, 410, 400, 330, 150, 140, 130, 120, 320 es, 310 es, 300 es, 100)
[2022-12-22 18:08:13.609865] [gui.display] [FYI] Refresh rate        : 60.00384024577573 Hz

[2022-12-22 18:08:13.609870] [gui.display] [FYI] Screen size : 1024x768

[2022-12-22 18:08:13.609873] [gui.display] [FYI] Logical DPI         : 96x96
[2022-12-22 18:08:13.609880] [gui.display] [FYI] Physical DPI        : 96x96
[2022-12-22 18:08:13.609884] [gui.display] [FYI] Device pixel ratio  : 1
[2022-12-22 18:08:13.609888] [gui.display] [FYI] Content scale       : 1
[2022-12-22 18:08:13.609893] [gui.display] [FYI] Font DPI            : 96x96 (96x96)
[2022-12-22 18:08:13.609897] [gui.display] [FYI] Font size           : 12pt (16 px)
[2022-12-22 18:08:13.609899] [gui.display] [FYI] Cell size           : 10x22 px
[2022-12-22 18:08:13.609902] [gui.display] [FYI] Page size           : 80x24
[2022-12-22 18:08:13.609905] [gui.display] [FYI] Font baseline       : 5 px
[2022-12-22 18:08:13.609907] [gui.display] [FYI] Underline position  : 3 px
[2022-12-22 18:08:13.609910] [gui.display] [FYI] Underline thickness : 1 px
[2022-12-22 18:08:13.684413] [gui.display] Blurring background image: /home/whisperity/Pictures/Wallpapers/world-of-warcraft-lexith-warcraft-elf-devushka-night-elf.jpg
[2022-12-22 18:08:13.689817] [gui.display] Blur: Loading shader source :/contour/display/shaders/simple.vert
[2022-12-22 18:08:13.689973] [gui.display] Blur: Loading shader source :/contour/display/shaders/blur_gaussian.frag
[2022-12-22 18:08:13.690171] [gui.display] Blur: Loading shader source :/contour/display/shaders/simple.vert
[2022-12-22 18:08:13.690193] [gui.display] Blur: Loading shader source :/contour/display/shaders/dual_kawase_up.frag
[2022-12-22 18:08:13.690305] [gui.display] Blur: Loading shader source :/contour/display/shaders/simple.vert
[2022-12-22 18:08:13.690323] [gui.display] Blur: Loading shader source :/contour/display/shaders/dual_kawase_down.frag
[2022-12-22 18:08:13.777005] [gui.display] Blur: Gaussian run performance: 0.275s CPU.
[2022-12-22 18:08:13.780373] [gui.display] Background image from disk: 3840x2160 RGBA
[2022-12-22 18:08:13.789122] [gui.display] TerminalWindow.resizeEvent: size 682x512 (682x512)
[2022-12-22 18:08:13.790841] [gui.display] Resizing view to 668x512 virtual (668x512 actual).
[2022-12-22 18:08:13.790849] [gui.display] Setting render target size to 668x512.
[2022-12-22 18:08:13.791254] [gui.display] GL configure atlas: 1024x2048 RGBA GL texture Id 4
[2022-12-22 18:08:13.802065] [gui.display] Resizing view to 668x512 virtual (668x512 actual).

[2022-12-22 18:08:13.817389] [gui.display] Screen changed.

So it seems it is sampling one of the other screens, not the screen it is starting on. And somehow it detect a screen change (???) but does not react to it in any way.

If I have all three screens 1920×1080 (that is the normal operation, just before I installed the relevant configuration files I was only able to get the smaller thing on the side screen, blame the hardware), even the keybind-opened Contour had a weird default shape.


Side note: It seems Konsole is also affected. If the side screens are small, Konsole starts with 25×4 character size...

@whisperity whisperity changed the title Sampling of resolution is taking the wrong screen as baselinehttps://github.com/contour-terminal/contour/pulse Sampling of resolution is taking the wrong screen as baseline Dec 22, 2022
@whisperity whisperity added the bug Something isn't working label Dec 22, 2022
@Yaraslaut
Copy link
Member

Some additional info,
Here is case with two monitors with 1920x1080 and 2560x1440

[2023-01-02 11:11:32.942797] [gui.display] TerminalWindow.resizeEvent: size 200x100 (200x100)
[2023-01-02 11:11:32.953711] [gui.display] initializeGL: size=186x100, scale=1
[2023-01-02 11:11:32.953758] [gui.display] Assigning session to terminal widget: shell=/bin/zsh, terminalSize=80x25, fontSize=12pt, contentScale=1
[2023-01-02 11:11:32.977562] [gui.display] Loading vertex shader: :/contour/display/shaders/text.vert
[2023-01-02 11:11:32.980907] [gui.display] Loading fragment shader: :/contour/display/shaders/text.frag
[2023-01-02 11:11:32.981234] [gui.display] Loading vertex shader: :/contour/display/shaders/background_image.vert
[2023-01-02 11:11:32.981259] [gui.display] Loading fragment shader: :/contour/display/shaders/background_image.frag
[2023-01-02 11:11:32.981435] [gui.display] Loading vertex shader: :/contour/display/shaders/background.vert
[2023-01-02 11:11:32.981448] [gui.display] Loading fragment shader: :/contour/display/shaders/background.frag
[2023-01-02 11:11:32.981787] [gui.display] configureAtlas: 1024x2048 RGBA
[2023-01-02 11:11:32.981875] [gui.display] [FYI] Build type          : RelWithDebInfo
[2023-01-02 11:11:32.981879] [gui.display] [FYI] Application PID     : 19854
[2023-01-02 11:11:32.981880] [gui.display] [FYI] OpenGL type         : OpenGL
[2023-01-02 11:11:32.981884] [gui.display] [FYI] OpenGL renderer     : Mesa Intel(R) Xe Graphics (TGL GT2)
[2023-01-02 11:11:32.981887] [gui.display] [FYI] Qt platform         : xcb
[2023-01-02 11:11:32.981893] [gui.display] [FYI] OpenGL version      : 4.6
[2023-01-02 11:11:32.981898] [gui.display] [FYI] Content scaling     : 1
[2023-01-02 11:11:32.981906] [gui.display] [FYI] GLSL version        : 4.60 (460, 450, 440, 430, 420, 410, 400, 330, 150, 140, 130, 120, 320 es, 310 es, 300 es, 100)
[2023-01-02 11:11:32.981916] [gui.display] [FYI] Refresh rate        : 144.00343526875926 Hz
[2023-01-02 11:11:32.981919] [gui.display] [FYI] Screen size         : 1920x1080
[2023-01-02 11:11:32.981922] [gui.display] [FYI] Logical DPI         : 96x96
[2023-01-02 11:11:32.981926] [gui.display] [FYI] Physical DPI        : 142x142
[2023-01-02 11:11:32.981928] [gui.display] [FYI] Device pixel ratio  : 1
[2023-01-02 11:11:32.981933] [gui.display] [FYI] Content scale       : 1
[2023-01-02 11:11:32.981937] [gui.display] [FYI] Font DPI            : 96x96 (96x96)
[2023-01-02 11:11:32.981941] [gui.display] [FYI] Font size           : 12pt (16 px)
[2023-01-02 11:11:32.981943] [gui.display] [FYI] Cell size           : 10x22 px
[2023-01-02 11:11:32.981949] [gui.display] [FYI] Page size           : 80x25
[2023-01-02 11:11:32.981952] [gui.display] [FYI] Font baseline       : 4 px
[2023-01-02 11:11:32.981954] [gui.display] [FYI] Underline position  : 2 px
[2023-01-02 11:11:32.981957] [gui.display] [FYI] Underline thickness : 1 px
[2023-01-02 11:11:32.984429] [gui.display] TerminalWindow.resizeEvent: size 814x550 (814x550)
[2023-01-02 11:11:32.989279] [gui.display] Resizing view to 800x550 virtual (800x550 actual).
[2023-01-02 11:11:32.989409] [gui.display] GL configure atlas: 1024x2048 RGBA GL texture Id 2
[2023-01-02 11:11:33.008486] [gui.display] Resizing view to 800x550 virtual (800x550 actual).
[2023-01-02 11:11:33.018788] [gui.display] Screen changed.

One monitor 2560x1440

[2023-01-02 11:12:21.803057] [gui.display] TerminalWindow.resizeEvent: size 200x100 (200x100)
[2023-01-02 11:12:21.813969] [gui.display] initializeGL: size=186x100, scale=1
[2023-01-02 11:12:21.814006] [gui.display] Assigning session to terminal widget: shell=/bin/zsh, terminalSize=80x25, fontSize=12pt, contentScale=1
[2023-01-02 11:12:21.839150] [gui.display] Loading vertex shader: :/contour/display/shaders/text.vert
[2023-01-02 11:12:21.843043] [gui.display] Loading fragment shader: :/contour/display/shaders/text.frag
[2023-01-02 11:12:21.843635] [gui.display] Loading vertex shader: :/contour/display/shaders/background_image.vert
[2023-01-02 11:12:21.843703] [gui.display] Loading fragment shader: :/contour/display/shaders/background_image.frag
[2023-01-02 11:12:21.843959] [gui.display] Loading vertex shader: :/contour/display/shaders/background.vert
[2023-01-02 11:12:21.843989] [gui.display] Loading fragment shader: :/contour/display/shaders/background.frag
[2023-01-02 11:12:21.844459] [gui.display] configureAtlas: 1024x2048 RGBA
[2023-01-02 11:12:21.844548] [gui.display] [FYI] Build type          : RelWithDebInfo
[2023-01-02 11:12:21.844554] [gui.display] [FYI] Application PID     : 20228
[2023-01-02 11:12:21.844557] [gui.display] [FYI] OpenGL type         : OpenGL
[2023-01-02 11:12:21.844561] [gui.display] [FYI] OpenGL renderer     : Mesa Intel(R) Xe Graphics (TGL GT2)
[2023-01-02 11:12:21.844567] [gui.display] [FYI] Qt platform         : xcb
[2023-01-02 11:12:21.844573] [gui.display] [FYI] OpenGL version      : 4.6
[2023-01-02 11:12:21.844580] [gui.display] [FYI] Content scaling     : 1
[2023-01-02 11:12:21.844586] [gui.display] [FYI] GLSL version        : 4.60 (460, 450, 440, 430, 420, 410, 400, 330, 150, 140, 130, 120, 320 es, 310 es, 300 es, 100)
[2023-01-02 11:12:21.844595] [gui.display] [FYI] Refresh rate        : 59.9505501052548 Hz
[2023-01-02 11:12:21.844598] [gui.display] [FYI] Screen size         : 2560x1440
[2023-01-02 11:12:21.844601] [gui.display] [FYI] Logical DPI         : 96x96
[2023-01-02 11:12:21.844604] [gui.display] [FYI] Physical DPI        : 109x109
[2023-01-02 11:12:21.844609] [gui.display] [FYI] Device pixel ratio  : 1
[2023-01-02 11:12:21.844613] [gui.display] [FYI] Content scale       : 1
[2023-01-02 11:12:21.844617] [gui.display] [FYI] Font DPI            : 96x96 (96x96)
[2023-01-02 11:12:21.844620] [gui.display] [FYI] Font size           : 12pt (16 px)
[2023-01-02 11:12:21.844622] [gui.display] [FYI] Cell size           : 10x22 px
[2023-01-02 11:12:21.844625] [gui.display] [FYI] Page size           : 80x25
[2023-01-02 11:12:21.844627] [gui.display] [FYI] Font baseline       : 4 px
[2023-01-02 11:12:21.844629] [gui.display] [FYI] Underline position  : 2 px
[2023-01-02 11:12:21.844632] [gui.display] [FYI] Underline thickness : 1 px
[2023-01-02 11:12:21.846324] [gui.display] TerminalWindow.resizeEvent: size 814x550 (814x550)
[2023-01-02 11:12:21.849807] [gui.display] Resizing view to 800x550 virtual (800x550 actual).
[2023-01-02 11:12:21.849868] [gui.display] GL configure atlas: 1024x2048 RGBA GL texture Id 2
[2023-01-02 11:12:21.866550] [gui.display] Resizing view to 800x550 virtual (800x550 actual).

Two monitors : 1024x768 and 2560x1440 (repro of the bug)

[2023-01-02 11:10:28.215414] [gui.display] TerminalWindow.resizeEvent: size 200x100 (200x100)
[2023-01-02 11:10:28.224909] [gui.display] initializeGL: size=186x100, scale=1
[2023-01-02 11:10:28.224940] [gui.display] Assigning session to terminal widget: shell=/bin/zsh, terminalSize=80x25, fontSize=12pt, contentScale=1
[2023-01-02 11:10:28.248043] [gui.display] Loading vertex shader: :/contour/display/shaders/text.vert
[2023-01-02 11:10:28.251546] [gui.display] Loading fragment shader: :/contour/display/shaders/text.frag
[2023-01-02 11:10:28.251879] [gui.display] Loading vertex shader: :/contour/display/shaders/background_image.vert
[2023-01-02 11:10:28.251914] [gui.display] Loading fragment shader: :/contour/display/shaders/background_image.frag
[2023-01-02 11:10:28.252134] [gui.display] Loading vertex shader: :/contour/display/shaders/background.vert
[2023-01-02 11:10:28.252154] [gui.display] Loading fragment shader: :/contour/display/shaders/background.frag
[2023-01-02 11:10:28.252679] [gui.display] configureAtlas: 1024x2048 RGBA
[2023-01-02 11:10:28.252776] [gui.display] [FYI] Build type          : RelWithDebInfo
[2023-01-02 11:10:28.252783] [gui.display] [FYI] Application PID     : 19373
[2023-01-02 11:10:28.252786] [gui.display] [FYI] OpenGL type         : OpenGL
[2023-01-02 11:10:28.252795] [gui.display] [FYI] OpenGL renderer     : Mesa Intel(R) Xe Graphics (TGL GT2)
[2023-01-02 11:10:28.252801] [gui.display] [FYI] Qt platform         : xcb
[2023-01-02 11:10:28.252808] [gui.display] [FYI] OpenGL version      : 4.6
[2023-01-02 11:10:28.252815] [gui.display] [FYI] Content scaling     : 1
[2023-01-02 11:10:28.252822] [gui.display] [FYI] GLSL version        : 4.60 (460, 450, 440, 430, 420, 410, 400, 330, 150, 140, 130, 120, 320 es, 310 es, 300 es, 100)
[2023-01-02 11:10:28.252831] [gui.display] [FYI] Refresh rate        : 84.99669007598435 Hz
[2023-01-02 11:10:28.252834] [gui.display] [FYI] Screen size         : 1024x768
[2023-01-02 11:10:28.252837] [gui.display] [FYI] Logical DPI         : 96x96
[2023-01-02 11:10:28.252841] [gui.display] [FYI] Physical DPI        : 76x101
[2023-01-02 11:10:28.252858] [gui.display] [FYI] Device pixel ratio  : 1
[2023-01-02 11:10:28.252862] [gui.display] [FYI] Content scale       : 1
[2023-01-02 11:10:28.252866] [gui.display] [FYI] Font DPI            : 96x96 (96x96)
[2023-01-02 11:10:28.252869] [gui.display] [FYI] Font size           : 12pt (16 px)
[2023-01-02 11:10:28.252872] [gui.display] [FYI] Cell size           : 10x22 px
[2023-01-02 11:10:28.252875] [gui.display] [FYI] Page size           : 80x25
[2023-01-02 11:10:28.252878] [gui.display] [FYI] Font baseline       : 4 px
[2023-01-02 11:10:28.252880] [gui.display] [FYI] Underline position  : 2 px
[2023-01-02 11:10:28.252883] [gui.display] [FYI] Underline thickness : 1 px
[2023-01-02 11:10:28.255412] [gui.display] TerminalWindow.resizeEvent: size 682x512 (682x512)
[2023-01-02 11:10:28.258515] [gui.display] Resizing view to 668x512 virtual (668x512 actual).
[2023-01-02 11:10:28.258526] [gui.display] Setting render target size to 668x512.
[2023-01-02 11:10:28.258625] [gui.display] GL configure atlas: 1024x2048 RGBA GL texture Id 2
[2023-01-02 11:10:28.274833] [gui.display] Resizing view to 668x512 virtual (668x512 actual).
[2023-01-02 11:10:28.288906] [gui.display] Screen changed.

It seams that the bug itself caused by resizeEvent, it tries to conserve ratio of the window

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants