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

wl_surface@45: error 2: Buffer size (820x611) is not divisible by scale (2) #3234

Closed
grappas opened this issue Mar 12, 2023 · 2 comments
Closed
Labels
bug Something isn't working

Comments

@grappas
Copy link

grappas commented Mar 12, 2023

What Operating System(s) are you seeing this problem on?

Linux Wayland

Which Wayland compositor or X11 Window manager(s) are you using?

Hyprland

WezTerm version

20230310-182648-fe6280f0

Did you try the latest nightly build to see if the issue is better (or worse!) than your current version?

Yes, and I updated the version box above to show the version of the nightly that I tried

Describe the bug

wezterm 20230310-182648-fe6280f0

To Reproduce

Everything is ok when I'm resizing window on 96 dpi but when I create new window next to existing one on 192 dpi all instances are crashing with error from title.

Configuration

local wezterm = require 'wezterm'
local act = wezterm.action
local mykeys = {
}

local My_font_size = 14.0
local Font_size = My_font_size

local clock = os.clock
function Sleep(n)
local t0 = clock()
while clock() - t0 <= n do end
end

function Recompute_font_size(window)
    local window_dims = window:get_dimensions()
    local overrides = window:get_config_overrides() or {}
    local Dpi = window_dims.dpi / 96
    local Scale_factor = 100 * Dpi
    if (window_dims.pixel_width / Scale_factor) > My_font_size
    then
        Font_size = My_font_size
    else
        Font_size = window_dims.pixel_width / Scale_factor
    end
    overrides.font_size = Font_size
    window:set_config_overrides(overrides)
end

wezterm.on('window-resized', function(window)
    Recompute_font_size(window)
end)

for i = 1, 8 do
    -- CTRL+ALT + number to activate that tab
    table.insert(mykeys, {
        key = tostring(i),
        mods = 'CTRL|ALT',
        action = act.ActivateTab(i - 1),
    })
    -- F1 through F8 to activate that tab
    table.insert(mykeys, {
        key = 'F' .. tostring(i),
        action = act.ActivateTab(i - 1),
    })
end

if wezterm.target_triple == 'x86_64-pc-windows-msvc' then
    default_prog = { 'powershell.exe' }
else
    default_prog = { 'zsh' }
end

if wezterm.target_triple == 'x86_64-pc-windows-msvc' then
    font = wezterm.font 'VictorMono NF'
else
    font = wezterm.font 'VictorMono Nerd Font'
end


-- if wezterm.target_triple == 'x86_64-pc-windows-msvc' then
--     enable_wayland = false
-- else
--     enable_wayland = true
-- end

return {
    font = font,
    font_size = Font_size,
    color_scheme = 'Gruvbox Dark',
    window_background_opacity = 0.9,
    default_prog = default_prog,
    enable_wayland = true,
    -- enable_wayland = enable_wayland,
    keys = {
        {
            key = 'F1',
            mods = 'CMD',
            action = wezterm.action.DisableDefaultAssignment,
        },
        {
            key = 'F2',
            mods = 'CMD',
            action = wezterm.action.DisableDefaultAssignment,
        },
        {
            key = 'F3',
            mods = 'CMD',
            action = wezterm.action.DisableDefaultAssignment,
        },
        {
            key = 'F4',
            mods = 'CMD',
            action = wezterm.action.DisableDefaultAssignment,
        },
        {
            key = 'F5',
            mods = 'CMD',
            action = wezterm.action.DisableDefaultAssignment,
        },
        {
            key = 'F6',
            mods = 'CMD',
            action = wezterm.action.DisableDefaultAssignment,
        },
        {
            key = 'F7',
            mods = 'CMD',
            action = wezterm.action.DisableDefaultAssignment,
        },
        {
            key = 'F8',
            mods = 'CMD',
            action = wezterm.action.DisableDefaultAssignment,
        },
        {
            key = 'F9',
            mods = 'CMD',
            action = wezterm.action.DisableDefaultAssignment,
        },
        {
            key = 'F10',
            mods = 'CMD',
            action = wezterm.action.DisableDefaultAssignment,
        },
        {
            key = 'F11',
            mods = 'CMD',
            action = wezterm.action.DisableDefaultAssignment,
        },
        {
            key = 'F12',
            mods = 'CMD',
            action = wezterm.action.DisableDefaultAssignment,
        },
    }
}

Expected Behavior

Not crashing (proper flooring of window size division).

Logs

It's crashing - have tail of $(WEZTERM_LOG=debug wezterm) instead (character limit).

20:01:28.357  DEBUG  wezterm_term::terminalstate            > Foreground(PaletteIndex(244))
20:01:28.357  DEBUG  wezterm_term::terminalstate::performer > perform PrintString("─╯")
20:01:28.357  DEBUG  wezterm_term::terminalstate::performer > perform CSI(Sgr(Foreground(Default)))
20:01:28.357  DEBUG  wezterm_term::terminalstate            > Foreground(Default)
20:01:28.357  DEBUG  wezterm_term::terminalstate::performer > perform CSI(Cursor(Left(40)))
20:01:28.357  DEBUG  wezterm_term::terminalstate::performer > perform CSI(Mode(SetDecPrivateMode(Code(ApplicationCursorKeys))))
20:01:28.357  DEBUG  wezterm_term::terminalstate::performer > perform Esc(Code(DecApplicationKeyPad))
20:01:28.357  DEBUG  wezterm_term::terminalstate::performer > DECKPAM on
20:01:28.357  DEBUG  wezterm_term::terminalstate::performer > perform CSI(Mode(ResetDecPrivateMode(Code(StartBlinkingCursor))))
20:01:28.357  DEBUG  wezterm_term::terminalstate::performer > perform CSI(Mode(SetDecPrivateMode(Code(ShowCursor))))
20:01:28.357  DEBUG  wezterm_term::terminalstate::performer > perform CSI(Mode(SetDecPrivateMode(Code(BracketedPaste))))
20:01:28.357  DEBUG  wezterm_gui::termwindow                > Notification(Any { .. })
20:01:28.357  DEBUG  wezterm_gui::termwindow                > Notification(Any { .. })
20:01:28.357  DEBUG  wezterm_gui::termwindow                > Notification(Any { .. })
wl_surface@32: error 2: Buffer size (820x611) is not divisible by scale (2)
20:01:28.357  DEBUG  wezterm_gui::frontend                  > workspace is default, fixup windows
20:01:28.358  DEBUG  wezterm_gui::frontend                  > workspace is default, fixup windows
20:01:28.360  ERROR  wezterm_gui                            > running message loop: error during event_q.dispatch protocol_error=Some(ProtocolError { code: 2, object_id: 32, object_interface: "wl_surface", message: "" }): Protocol error (os error 71); terminating

Anything else?

No response

@grappas grappas added the bug Something isn't working label Mar 12, 2023
@wez
Copy link
Owner

wez commented Mar 13, 2023

Duplicate of #2445

@github-actions
Copy link
Contributor

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants