alacritty: `startup_mode: Maximized` stopped working recent GNOME Wayland

This stopped working after upgrading from Fedora 35 to 36. From the log it seems that Alacritty starts in 800x600, switch size to 2560x1408 (which is about the size of my screen) but then goes back to 800x600.

The Alacritty version in Fedora 36 is 0.10.1 whereas in 35 it was 0.9.0. But I tried to run Alacritty from source using the v0.9.0 tag, and I see the same issue, i.e. even 0.9.0 doesn’t start maximized on Fedora 36 either. So maybe something else changed in Fedora 36 that interfers with Alacritty? Anything I can do to investigate further?

System

OS: Linux (Fedora 36) Version: 0.10.1 Linux/BSD: Grome on Wayland

Logs

Font/Terminal size: alacritty -vv

[0.000007730s] [INFO ] [alacritty] Welcome to Alacritty
[0.000120725s] [INFO ] [alacritty] Version 0.10.1
[0.000163071s] [INFO ] [alacritty] Running on Wayland
[0.001266332s] [INFO ] [alacritty] Configuration files loaded from:
                                     "/home/perso/.config/alacritty/alacritty.yml"
[0.020854944s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Regular, load_flags: TARGET_LIGHT, render_mode: "Normal", lcd_filter: 1 }
[0.029044235s] [DEBUG] [alacritty] Estimated DPR: 1
[0.029061996s] [DEBUG] [alacritty] Estimated window size: None
[0.029077550s] [DEBUG] [alacritty] Estimated cell size: 7 x 18
[0.078014143s] [INFO ] [alacritty] Device pixel ratio: 1
[0.089214196s] [INFO ] [alacritty] Initializing glyph cache...
[0.090528233s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Regular, load_flags: TARGET_LIGHT, render_mode: "Normal", lcd_filter: 1 }
[0.092259742s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Bold, load_flags: TARGET_LIGHT, render_mode: "Normal", lcd_filter: 1 }
[0.094021178s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Italic, load_flags: TARGET_LIGHT, render_mode: "Normal", lcd_filter: 1 }
[0.095948744s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Bold Italic, load_flags: TARGET_LIGHT, render_mode: "Normal", lcd_filter: 1 }
[0.129382298s] [INFO ] [alacritty] ... finished initializing glyph cache in 0.040139218s
[0.129417483s] [INFO ] [alacritty] Cell size: 7 x 18
[0.129423263s] [INFO ] [alacritty] Padding: 1 x 3
[0.129427064s] [INFO ] [alacritty] Width: 800, Height: 600
[0.129817390s] [INFO ] [alacritty] PTY dimensions: 33 x 114
[0.132035798s] [INFO ] [alacritty] Initialisation complete
[0.132228100s] [DEBUG] [alacritty_terminal] New num_cols is 365 and num_lines is 78
[0.135490062s] [INFO ] [alacritty] Padding: 2 x 2
[0.135513191s] [INFO ] [alacritty] Width: 2560, Height: 1408
[0.151158877s] [DEBUG] [alacritty_terminal] New num_cols is 114 and num_lines is 33
[0.152942982s] [INFO ] [alacritty] Padding: 1 x 3
[0.152999777s] [INFO ] [alacritty] Width: 800, Height: 600

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 9
  • Comments: 19 (6 by maintainers)

Commits related to this issue

Most upvoted comments

I have same problem on Ubuntu 22.04.2 LTS

Temporal fix: nano ~/.local/share/applications/Alacritty.desktop

- Exec=alacritty
+ Exec=env WAYLAND_DISPLAY=1 alacritty

image

Created log file at "/tmp/Alacritty-6983.log"
[0.000009080s] [INFO ] [alacritty] Welcome to Alacritty
[0.000131232s] [INFO ] [alacritty] Version 0.11.0
[0.000150997s] [INFO ] [alacritty] Running on Wayland
[0.000857929s] [INFO ] [alacritty] Configuration files loaded from:
                                     "/home/.../.config/alacritty/alacritty.yml"
[0.001488734s] [DEBUG] [alacritty] Loading "monospace" font
[0.021488165s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Book, load_flags: TARGET_LIGHT, render_mode: "Normal", lcd_filter: 1 }
[0.026938987s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Bold, load_flags: TARGET_LIGHT, render_mode: "Normal", lcd_filter: 1 }
[0.032314381s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Book, load_flags: NO_BITMAP | TARGET_LIGHT, render_mode: "Normal", lcd_filter: 1 }
[0.037402169s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Bold, load_flags: NO_BITMAP | TARGET_LIGHT, render_mode: "Normal", lcd_filter: 1 }
[0.039530019s] [DEBUG] [alacritty] Estimated scaling factor: 1
[0.039543708s] [DEBUG] [alacritty] Estimated window size: None
[0.039549924s] [DEBUG] [alacritty] Estimated cell size: 10 x 19
[0.041058003s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Book, load_flags: TARGET_LIGHT, render_mode: "Normal", lcd_filter: 1 }
[0.091720561s] [INFO ] [alacritty] Running on RENOIR (renoir, LLVM 15.0.6, DRM 3.47, 5.19.0-32-generic)
[0.091763374s] [INFO ] [alacritty] Using OpenGL 3.3 renderer
[0.096491759s] [INFO ] [alacritty] Display scale factor: 1
[0.096553917s] [DEBUG] [alacritty] Filling glyph cache with common glyphs
[0.106001329s] [INFO ] [alacritty] Cell size: 10 x 19
[0.106045888s] [INFO ] [alacritty] Padding: 0 x 0
[0.106051685s] [INFO ] [alacritty] Width: 800, Height: 600
[0.106630109s] [INFO ] [alacritty] PTY dimensions: 31 x 80
[0.108857413s] [INFO ] [alacritty] Initialisation complete
[0.109387018s] [DEBUG] [alacritty_terminal] New num_cols is 192 and num_lines is 50
[0.110646464s] [INFO ] [alacritty] Padding: 0 x 0
[0.110689486s] [INFO ] [alacritty] Width: 1920, Height: 956
[0.136064450s] [DEBUG] [alacritty_terminal] New num_cols is 192 and num_lines is 31
[0.136188907s] [INFO ] [alacritty] Padding: 0 x 0
[0.136198964s] [INFO ] [alacritty] Width: 1920, Height: 600
[0.629914892s] [DEBUG] [alacritty_terminal] [unhandled osc_dispatch]: [['1'],['~'],] at line 963
[0.658908465s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Medium, load_flags: TARGET_LIGHT, render_mode: "Normal", lcd_filter: 1 }
[4.209896239s] [INFO ] [alacritty] Goodbye
Deleted log file at "/tmp/Alacritty-6983.log"

@kchibisov For the record, this issue has been reported upstream too. https://bugs.kde.org/show_bug.cgi?id=457867

After my quick debugging, I see an issue on client side. In particular, it appears like alacritty calls xdg_surface.set_window_geometry without attached buffer before receiving the first configure event. This is a no-no thing, most compositors silently handle that, but there’s a proposal to make it a protocol error because it makes no sense to call set_window_geometry without a buffer.

I believe that this maximization issue is going to be resolved if alacritty starts updating the window geometry when there’s a buffer. For example, this is alacritty’s wayland debug log when running with kwin_wayland

[1256207.528]  -> wl_compositor@4.create_surface(new id wl_surface@3)
[1256207.531]  -> wl_seat@7.get_pointer(new id wl_pointer@16)
[1256207.537]  -> zwp_relative_pointer_manager_v1@9.get_relative_pointer(new id zwp_relative_pointer_v1@17, wl_pointer@16)
[1256207.543]  -> wl_seat@7.get_keyboard(new id wl_keyboard@18)
[1256209.675]  -> wl_seat@7.get_touch(new id wl_touch@19)
[1256209.681]  -> zwp_text_input_manager_v3@15.get_text_input(new id zwp_text_input_v3@20, wl_seat@7)
[1256220.973]  -> wl_compositor@4.create_surface(new id wl_surface@21)
[1256220.989]  -> wl_registry@2.bind(5, "xdg_wm_base", 2, new id [unknown]@22)
[1256221.001]  -> wl_shm@6.create_pool(new id wl_shm_pool@23, fd 26, 4096)
[1256221.014]  -> xdg_wm_base@22.get_xdg_surface(new id xdg_surface@24, wl_surface@21)
[1256221.021]  -> xdg_surface@24.get_toplevel(new id xdg_toplevel@25)
[1256221.025]  -> wl_surface@21.commit()

[1256221.028]  -> xdg_toplevel@25.set_min_size(2, 1)
[1256221.031]  -> xdg_surface@24.set_window_geometry(0, 0, 800, 600)
[1256221.034]  -> wl_compositor@4.create_surface(new id wl_surface@26)
[1256221.037]  -> wl_seat@7.get_pointer(new id wl_pointer@27)
[1256221.041]  -> zxdg_decoration_manager_v1@5.get_toplevel_decoration(new id zxdg_toplevel_decoration_v1@28, xdg_toplevel@25)
[1256221.046]  -> zxdg_toplevel_decoration_v1@28.unset_mode()
[1256221.048]  -> wl_surface@21.commit()

 ^^^ xdg_surface.set_window_geometry() without buffer, not okay

[1256221.050]  -> xdg_toplevel@25.set_min_size(2, 1)
[1256221.052]  -> xdg_toplevel@25.set_max_size(0, 0)
[1256221.055]  -> xdg_toplevel@25.set_app_id("Alacritty")
[1256221.057]  -> xdg_toplevel@25.set_min_size(2, 1)
[1256221.059]  -> xdg_toplevel@25.set_max_size(0, 0)
[1256221.061]  -> xdg_toplevel@25.set_title("Alacritty")
[1256221.065]  -> wl_display@1.sync(new id wl_callback@29)
[1256223.590] xdg_toplevel@25.configure(1920, 1007, array[20])
[1256223.594] xdg_surface@24.configure(27681)
[1256223.597]  -> xdg_surface@24.ack_configure(27681)
[1256227.068]  -> wl_display@1.get_registry(new id wl_registry@29)
[1256227.077]  -> wl_display@1.sync(new id wl_callback@30)
[1256229.716]  -> zwp_linux_dmabuf_v1@33.get_default_feedback(new id zwp_linux_dmabuf_feedback_v1@32)
[1256229.720]  -> wl_display@1.sync(new id wl_callback@34)
[1256230.351]  -> zwp_linux_dmabuf_feedback_v1@32.destroy()
[1256247.323]  -> zwp_linux_dmabuf_v1@33.get_surface_feedback(new id zwp_linux_dmabuf_feedback_v1@34, wl_surface@21)
[1256247.333]  -> wl_display@1.sync(new id wl_callback@35)
[1256272.259]  -> xdg_surface@24.set_window_geometry(0, 0, 1920, 1007)
[1256272.290]  -> wl_display@1.get_registry(new id wl_registry@35)
[1256272.304]  -> wl_display@1.sync(new id wl_callback@32)
[1256272.637]  -> wl_display@1.sync(new id wl_callback@32)
[1256272.768]  -> wl_data_device_manager@37.get_data_device(new id wl_data_device@38, wl_seat@36)
[1256272.782]  -> zwp_primary_selection_device_manager_v1@32.get_device(new id zwp_primary_selection_device_v1@39, wl_seat@36)
[1256275.242]  -> wl_surface@21.frame(new id wl_callback@42)
[1256275.277]  -> zwp_linux_dmabuf_v1@33.create_params(new id zwp_linux_buffer_params_v1@43)
[1256275.302]  -> zwp_linux_buffer_params_v1@43.add(fd 37, 0, 0, 3584, 33554432, 9878274)
[1256275.309]  -> zwp_linux_buffer_params_v1@43.add(fd 38, 1, 2293760, 1024, 33554432, 9878274)
[1256275.312]  -> zwp_linux_buffer_params_v1@43.create_immed(new id wl_buffer@44, 800, 600, 875713089, 0)
[1256275.315]  -> zwp_linux_buffer_params_v1@43.destroy()
[1256275.317]  -> wl_surface@21.attach(wl_buffer@44, 0, 0)
[1256275.319]  -> wl_surface@21.damage(0, 0, 2147483647, 2147483647)
[1256283.711]  -> wl_surface@21.commit()
[1256283.726]  -> wl_display@1.sync(new id wl_callback@45)
[1256286.028] wl_surface@21.enter(wl_output@12)
[1256286.036]  -> wl_surface@21.set_buffer_scale(2)
[1256286.040] xdg_wm_base@22.ping(27682)
[1256286.044]  -> xdg_wm_base@22.pong(27682)
[1256286.068] xdg_toplevel@25.configure(800, 600, array[24])
[1256286.074] xdg_surface@24.configure(27688)
[1256286.077]  -> xdg_surface@24.ack_configure(27688)
[1256286.094]  -> xdg_surface@24.set_window_geometry(0, 0, 800, 600)

That xdg_surface@24.set_window_geometry(0, 0, 800, 600) right after creating xdg_toplevel confuses async geometry code in kwin, ideally we should post a protocol error in that case.

Note that the behavior may differ across compositors because every compositor handles async geometry updates differently, but alacritty should not touch the window geometry until it attaches a buffer.

This is most likely a bug in whatever toolkit alacritty uses under the hood.

I just tried @StackOverflowExcept1on’s workaround, and it seems to fix the Maximized issue for me tada

That’s because you’re not running on wayland anymore, so it’s not a workaround.

I just tried @StackOverflowExcept1on’s workaround, and it seems to fix the Maximized issue for me 🎉

I mean I understand the issue, I’m just saying that it can’t be solved directly in alacritty right now, it’ll require changing like 2-3 libraries down the road for that. Think of it like I need to change Qt(just example) to fix that in alacritty.

And some other problem that this “Qt” library is in the middle of updating their “libwayland” wrapper and in beta for “Qt-6” for like 6 month already.

That Qt reference is an example, but you should get an understanding of why this can’t be easily solved right now and takes some amount of time…

I could try to take a look once I have time, but it seems more like gnome broke something…