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

Changing [input] xkb_layout doesn't work and crash with added xkb_variant #456

Closed
Narrat opened this issue Mar 29, 2020 · 5 comments · Fixed by #602
Closed

Changing [input] xkb_layout doesn't work and crash with added xkb_variant #456

Narrat opened this issue Mar 29, 2020 · 5 comments · Fixed by #602
Milestone

Comments

@Narrat
Copy link

Narrat commented Mar 29, 2020

Hello and thanks for this project :)
But I have one problem. I cannot change the xkb_layout whatsoever.
Verified with localectl, that I have the settings I want to set:

$ localectl list-x11-keymap-layouts
(...)
de
(...)
$ localectl list-x11-keymap-variants
(...)
qwertz
(...)

After adding xkb_layout = de to the config I get this:

$ setxkbmap -print -verbose 10                            
Setting verbose level to 10
locale is C
Trying to load rules file ./rules/evdev...
Trying to load rules file /usr/share/X11/xkb/rules/evdev...
Success.
Applied rules from evdev:
rules:      evdev
model:      pc105
layout:     us
Trying to build keymap using the following components:
keycodes:   evdev+aliases(qwerty)
types:      complete
compat:     complete
symbols:    pc+us+inet(evdev)
geometry:   pc(pc105)
xkb_keymap {
	xkb_keycodes  { include "evdev+aliases(qwerty)"	};
	xkb_types     { include "complete"	};
	xkb_compat    { include "complete"	};
	xkb_symbols   { include "pc+us+inet(evdev)"	};
	xkb_geometry  { include "pc(pc105)"	};
};

Layout still being us.

And if I add xkb_variant to the config wayfire runs into a segfault:

$ wayfire                           
II 29-03-20 23:16:27.205 - [wayfire-0.4.0/src/main.cpp:260] Starting wayfire
II 29-03-20 23:16:27.263 - [render/egl.c:246] Using EGL 1.5
II 29-03-20 23:16:27.263 - [render/egl.c:247] Supported EGL extensions: EGL_ANDROID_blob_cache EGL_ANDROID_native_fence_sync EGL_CHROMIUM_sync_control EGL_EXT_buffer_age EGL_EXT_create_context_robustness EGL_EXT_image_dma_buf_import EGL_KHR_cl_event2 EGL_KHR_config_attribs EGL_KHR_create_context EGL_KHR_create_context_no_error EGL_KHR_fence_sync EGL_KHR_get_all_proc_addresses EGL_KHR_gl_colorspace EGL_KHR_gl_renderbuffer_image EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_3D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_image EGL_KHR_image_base EGL_KHR_image_pixmap EGL_KHR_no_config_context EGL_KHR_reusable_sync EGL_KHR_surfaceless_context EGL_EXT_pixel_format_float EGL_KHR_wait_sync EGL_MESA_configless_context EGL_MESA_drm_image EGL_MESA_image_dma_buf_export EGL_MESA_query_driver EGL_NOK_texture_from_pixmap EGL_WL_bind_wayland_display 
II 29-03-20 23:16:27.264 - [render/egl.c:248] EGL vendor: Mesa Project
II 29-03-20 23:16:27.268 - [render/gles2/renderer.c:561] Using OpenGL ES 3.2 Mesa 19.3.4
II 29-03-20 23:16:27.268 - [render/gles2/renderer.c:562] GL vendor: X.Org
II 29-03-20 23:16:27.268 - [render/gles2/renderer.c:563] GL renderer: AMD Radeon (TM) RX 480 Graphics (POLARIS10, DRM 3.36.0, 5.5.13-arch1-1, LLVM 9.0.1)
II 29-03-20 23:16:27.268 - [render/gles2/renderer.c:564] Supported GLES2 extensions: GL_EXT_blend_minmax GL_EXT_multi_draw_arrays GL_EXT_texture_filter_anisotropic GL_EXT_texture_compression_s3tc GL_EXT_texture_compression_dxt1 GL_EXT_texture_compression_rgtc GL_EXT_texture_format_BGRA8888 GL_OES_compressed_ETC1_RGB8_texture GL_OES_depth24 GL_OES_element_index_uint GL_OES_fbo_render_mipmap GL_OES_mapbuffer GL_OES_rgb8_rgba8 GL_OES_standard_derivatives GL_OES_stencil8 GL_OES_texture_3D GL_OES_texture_float GL_OES_texture_float_linear GL_OES_texture_half_float GL_OES_texture_half_float_linear GL_OES_texture_npot GL_OES_vertex_half_float GL_EXT_texture_sRGB_decode GL_OES_EGL_image GL_OES_depth_texture GL_AMD_performance_monitor GL_OES_packed_depth_stencil GL_EXT_texture_type_2_10_10_10_REV GL_NV_conditional_render GL_OES_get_program_binary GL_APPLE_texture_max_level GL_EXT_discard_framebuffer GL_EXT_read_format_bgra GL_EXT_frag_depth GL_NV_fbo_color_attachments GL_OES_EGL_image_external GL_OES_EGL_sync GL_OES_vertex_array_object GL_OES_viewport_array GL_ANGLE_texture_compression_dxt3 GL_ANGLE_texture_compression_dxt5 GL_EXT_occlusion_query_boolean GL_EXT_robustness GL_EXT_texture_rg GL_EXT_unpack_subimage GL_NV_draw_buffers GL_NV_read_buffer GL_NV_read_depth GL_NV_read_depth_stencil GL_NV_read_stencil GL_EXT_draw_buffers GL_EXT_map_buffer_range GL_KHR_debug GL_KHR_robustness GL_KHR_texture_compression_astc_ldr GL_OES_depth_texture_cube_map GL_OES_required_internalformat GL_OES_surfaceless_context GL_EXT_color_buffer_float GL_EXT_sRGB_write_control GL_EXT_separate_shader_objects GL_EXT_shader_implicit_conversions GL_EXT_shader_integer_mix GL_EXT_tessellation_point_size GL_EXT_tessellation_shader GL_ANDROID_extension_pack_es31a GL_EXT_base_instance GL_EXT_compressed_ETC1_RGB8_sub_texture GL_EXT_copy_image GL_EXT_draw_buffers_indexed GL_EXT_draw_elements_base_vertex GL_EXT_gpu_shader5 GL_EXT_polygon_offset_clamp GL_EXT_primitive_bounding_box GL_EXT_render_snorm GL_EXT_shader_io_blocks GL_EXT_texture_border_clamp GL_EXT_texture_buffer GL_EXT_texture_cube_map_array GL_EXT_texture_norm16 GL_EXT_texture_view GL_KHR_blend_equation_advanced GL_KHR_context_flush_control GL_KHR_robust_buffer_access_behavior GL_NV_image_formats GL_OES_copy_image GL_OES_draw_buffers_indexed GL_OES_draw_elements_base_vertex GL_OES_gpu_shader5 GL_OES_primitive_bounding_box GL_OES_sample_shading GL_OES_sample_variables GL_OES_shader_io_blocks GL_OES_shader_multisample_interpolation GL_OES_tessellation_point_size GL_OES_tessellation_shader GL_OES_texture_border_clamp GL_OES_texture_buffer GL_OES_texture_cube_map_array GL_OES_texture_stencil8 GL_OES_texture_storage_multisample_2d_array GL_OES_texture_view GL_EXT_blend_func_extended GL_EXT_buffer_storage GL_EXT_float_blend GL_EXT_geometry_point_size GL_EXT_geometry_shader GL_KHR_no_error GL_KHR_texture_compression_astc_sliced_3d GL_OES_EGL_image_external_essl3 GL_OES_geometry_point_size GL_OES_geometry_shader GL_OES_shader_image_atomic GL_EXT_clip_cull_distance GL_EXT_disjoint_timer_query GL_EXT_texture_compression_s3tc_srgb GL_EXT_window_rectangles GL_MESA_shader_integer_functions GL_EXT_clip_control GL_EXT_memory_object GL_EXT_memory_object_fd GL_EXT_semaphore GL_EXT_semaphore_fd GL_EXT_texture_compression_bptc GL_KHR_parallel_shader_compile GL_AMD_framebuffer_multisample_advanced GL_EXT_texture_sRGB_R8 GL_MESA_framebuffer_flip_y GL_EXT_depth_clamp GL_EXT_texture_query_lod 
II 29-03-20 23:16:27.274 - [wayfire-0.4.0/src/main.cpp:283] using config file: /home/omnius/.config/wayfire.ini
II 29-03-20 23:16:27.274 - [wf-config-0.4.0/src/file.cpp:424] Reading XML configuration options from directory /usr/share/wayfire/metadata
II 29-03-20 23:16:27.274 - [wf-config-0.4.0/src/file.cpp:436] Reading XML configuration options from file /usr/share/wayfire/metadata/alpha.xml
II 29-03-20 23:16:27.274 - [wf-config-0.4.0/src/file.cpp:436] Reading XML configuration options from file /usr/share/wayfire/metadata/animate.xml
II 29-03-20 23:16:27.274 - [wf-config-0.4.0/src/file.cpp:436] Reading XML configuration options from file /usr/share/wayfire/metadata/autostart.xml
EE 29-03-20 23:16:27.274 - [wf-config-0.4.0/src/xml.cpp:147] Could not parse /usr/share/wayfire/metadata/autostart.xml: option at line 10 has no default value specified.
II 29-03-20 23:16:27.274 - [wf-config-0.4.0/src/file.cpp:436] Reading XML configuration options from file /usr/share/wayfire/metadata/blur.xml
II 29-03-20 23:16:27.274 - [wf-config-0.4.0/src/file.cpp:436] Reading XML configuration options from file /usr/share/wayfire/metadata/command.xml
EE 29-03-20 23:16:27.275 - [wf-config-0.4.0/src/xml.cpp:147] Could not parse /usr/share/wayfire/metadata/command.xml: option at line 10 has no default value specified.
II 29-03-20 23:16:27.275 - [wf-config-0.4.0/src/file.cpp:436] Reading XML configuration options from file /usr/share/wayfire/metadata/core.xml
II 29-03-20 23:16:27.275 - [wf-config-0.4.0/src/file.cpp:436] Reading XML configuration options from file /usr/share/wayfire/metadata/cube.xml
II 29-03-20 23:16:27.275 - [wf-config-0.4.0/src/file.cpp:436] Reading XML configuration options from file /usr/share/wayfire/metadata/decoration.xml
II 29-03-20 23:16:27.275 - [wf-config-0.4.0/src/file.cpp:436] Reading XML configuration options from file /usr/share/wayfire/metadata/expo.xml
II 29-03-20 23:16:27.275 - [wf-config-0.4.0/src/file.cpp:436] Reading XML configuration options from file /usr/share/wayfire/metadata/fast-switcher.xml
II 29-03-20 23:16:27.275 - [wf-config-0.4.0/src/file.cpp:436] Reading XML configuration options from file /usr/share/wayfire/metadata/fisheye.xml
II 29-03-20 23:16:27.275 - [wf-config-0.4.0/src/file.cpp:436] Reading XML configuration options from file /usr/share/wayfire/metadata/grid.xml
II 29-03-20 23:16:27.275 - [wf-config-0.4.0/src/file.cpp:436] Reading XML configuration options from file /usr/share/wayfire/metadata/idle.xml
II 29-03-20 23:16:27.275 - [wf-config-0.4.0/src/file.cpp:436] Reading XML configuration options from file /usr/share/wayfire/metadata/input.xml
II 29-03-20 23:16:27.275 - [wf-config-0.4.0/src/file.cpp:436] Reading XML configuration options from file /usr/share/wayfire/metadata/invert.xml
II 29-03-20 23:16:27.275 - [wf-config-0.4.0/src/file.cpp:436] Reading XML configuration options from file /usr/share/wayfire/metadata/matcher.xml
II 29-03-20 23:16:27.276 - [wf-config-0.4.0/src/file.cpp:436] Reading XML configuration options from file /usr/share/wayfire/metadata/move.xml
II 29-03-20 23:16:27.276 - [wf-config-0.4.0/src/file.cpp:436] Reading XML configuration options from file /usr/share/wayfire/metadata/oswitch.xml
II 29-03-20 23:16:27.276 - [wf-config-0.4.0/src/file.cpp:436] Reading XML configuration options from file /usr/share/wayfire/metadata/place.xml
II 29-03-20 23:16:27.276 - [wf-config-0.4.0/src/file.cpp:436] Reading XML configuration options from file /usr/share/wayfire/metadata/resize.xml
II 29-03-20 23:16:27.276 - [wf-config-0.4.0/src/file.cpp:436] Reading XML configuration options from file /usr/share/wayfire/metadata/simple-tile.xml
II 29-03-20 23:16:27.276 - [wf-config-0.4.0/src/file.cpp:436] Reading XML configuration options from file /usr/share/wayfire/metadata/switcher.xml
II 29-03-20 23:16:27.276 - [wf-config-0.4.0/src/file.cpp:436] Reading XML configuration options from file /usr/share/wayfire/metadata/vswipe.xml
II 29-03-20 23:16:27.276 - [wf-config-0.4.0/src/file.cpp:436] Reading XML configuration options from file /usr/share/wayfire/metadata/vswitch.xml
II 29-03-20 23:16:27.276 - [wf-config-0.4.0/src/file.cpp:436] Reading XML configuration options from file /usr/share/wayfire/metadata/window-rules.xml
II 29-03-20 23:16:27.276 - [wf-config-0.4.0/src/file.cpp:436] Reading XML configuration options from file /usr/share/wayfire/metadata/wobbly.xml
II 29-03-20 23:16:27.276 - [wf-config-0.4.0/src/file.cpp:436] Reading XML configuration options from file /usr/share/wayfire/metadata/workarounds.xml
II 29-03-20 23:16:27.276 - [wf-config-0.4.0/src/file.cpp:436] Reading XML configuration options from file /usr/share/wayfire/metadata/wrot.xml
II 29-03-20 23:16:27.276 - [wf-config-0.4.0/src/file.cpp:436] Reading XML configuration options from file /usr/share/wayfire/metadata/zoom.xml
II 29-03-20 23:16:27.277 - [backend/noop/backend.c:51] Creating noop backend
II 29-03-20 23:16:27.277 - [backend/noop/backend.c:16] Starting noop backend
EE 29-03-20 23:16:27.277 - [xwayland/sockets.c:63] Failed to bind socket @/tmp/.X11-unix/X1: Address already in use
EE 29-03-20 23:16:27.277 - [xwayland/sockets.c:63] Failed to bind socket @/tmp/.X11-unix/X2: Address already in use
II 29-03-20 23:16:27.279 - [xwayland/xwayland.c:89] WAYLAND_SOCKET=15 Xwayland :3 -rootless -terminate -listen 13 -listen 14 -wm 17
II 29-03-20 23:16:27.288 - [wayfire-0.4.0/src/core/seat/input-manager.cpp:63] handle new input: X11 keyboard, default mapping: (null)
xkbcommon: ERROR: Couldn't process include statement for 'de(qwertz)'
xkbcommon: ERROR: Abandoning symbols file "(unnamed)"
xkbcommon: ERROR: Failed to compile xkb_symbols
xkbcommon: ERROR: Failed to compile keymap
EE 29-03-20 23:16:27.291 - [wayfire-0.4.0/src/main.cpp:204] Fatal error: Segmentation fault
EE 29-03-20 23:16:27.309 - #1  wf::print_trace() ??:?
glamor: No eglstream capable devices found
EE 29-03-20 23:16:27.327 - #2  __restore_rt sigaction.c:?
EE 29-03-20 23:16:27.341 - #3  xkb_keymap_ref ??:?
EE 29-03-20 23:16:27.355 - #4  wlr_keyboard_set_keymap ??:?
EE 29-03-20 23:16:27.372 - #5  wf_keyboard::reload_input_options() ??:?
EE 29-03-20 23:16:27.389 - #6  wf_keyboard::wf_keyboard(wlr_input_device*) ??:?
EE 29-03-20 23:16:27.406 - #7  input_manager::handle_new_input(wlr_input_device*) ??:?
EE 29-03-20 23:16:27.423 - #8  std::_Function_handler<void (void*), wf::output_layout_t::impl::impl(wlr_backend*)::{lambda(void*)#1}>::_M_invoke(std::_Any_data const&, void*&&) ??:?
EE 29-03-20 23:16:27.438 - #9  wlr_region_confine ??:?
EE 29-03-20 23:16:27.452 - #10 wlr_region_confine ??:?
EE 29-03-20 23:16:27.466 - #11 wlr_backend_is_x11 ??:?
EE 29-03-20 23:16:27.480 - #12 wlr_backend_is_multi ??:?
EE 29-03-20 23:16:27.497 - #13 main ??:?
EE 29-03-20 23:16:27.513 - #14 __libc_start_main ??:?
EE 29-03-20 23:16:27.530 - #15 _start ??:?

No difference if I try this on a VT or within X11.
But as the packages aren't build with debug, it is currently missing the rest of the trace. But maybe this already helps.

@ammen99
Copy link
Member

ammen99 commented Mar 29, 2020

Hi, setxkbmap does not work under Wayland. Unfortunately, this means you also can't check the keyboard layout in Wayfire, not until swaywm/wlr-protocols#31 gets implemented.

Anyway, your variant is incorrect which is why Wayfire crashes. We could probably handle this error though instead of crashing, but that won't fix your problem. The correct variant is just qwertz

Have you tried to actually set xkb_layout to de and type on the keyboard? I suspect it will work as you want it to (note, setxkbmap generally does not work on Wayland, so anything it reports is not trustworthy)

@Narrat
Copy link
Author

Narrat commented Mar 29, 2020

Hi, setxkbmap does not work under Wayland. Unfortunately, this means you also can't check the keyboard layout in Wayfire, not until swaywm/wlr-protocols#31 gets implemented.

Ah, shoot. Good to know.

Anyway, your variant is incorrect which is why Wayfire crashes. We could probably handle this error though instead of crashing, but that won't fix your problem. The correct variant is just qwertz

Maybe I'm missing something from your comment, but I just set xkb_variant = qwertz in the config?
And if I change it like this:

[input]
xkb_layout = de,us
xkb_variant = ,qwerty

it will fail with:

xkbcommon: ERROR: Couldn't process include statement for 'us(qwerty)'
xkbcommon: ERROR: Abandoning symbols file "(unnamed)"
xkbcommon: ERROR: Failed to compile xkb_symbols
xkbcommon: ERROR: Failed to compile keymap

Have you tried to actually set xkb_layout to de and type on the keyboard? I suspect it will work as you want it to (note, setxkbmap generally does not work on Wayland, so anything it reports is not trustworthy)

Now I'm unsure and need to recheck. IIRC I still had the english layout when typing, if I started wayfire from a VT. But I also had a missing [input] in some of these tests... Now testing it from within X11 just setting the xkb_layout to de works as expected.
Will report on that later.

@ammen99
Copy link
Member

ammen99 commented Mar 29, 2020

FWIW I just tried it, and the problem is reproducible. However, you don't need to set variant to ,querty, seems like , (probably empty as well) works fine. So try setting only xkb_layout

@Narrat
Copy link
Author

Narrat commented Mar 29, 2020

Yes, indeed. Just setting the layout is working fine :) So, when it didn't work, it was related to the missing [input] in my config.
Thank you for your help.
Should this issue be closed or do you want to keep it around because of the reproducible error with xkb_variant?

@ammen99
Copy link
Member

ammen99 commented Mar 30, 2020

Let's keep it open. Wayfire shouldn't crash even on bad config options.

@ammen99 ammen99 added this to the 0.5 milestone Jul 1, 2020
ammen99 added a commit that referenced this issue Jul 19, 2020
ammen99 added a commit that referenced this issue Jul 20, 2020
ammen99 added a commit that referenced this issue Jul 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants