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

[Wayland] Menus do not work from keyboard on some apps #1625

Closed
AlanGriffiths opened this issue Jul 23, 2020 · 3 comments · Fixed by #1646
Closed

[Wayland] Menus do not work from keyboard on some apps #1625

AlanGriffiths opened this issue Jul 23, 2020 · 3 comments · Fixed by #1646
Assignees

Comments

@AlanGriffiths
Copy link
Contributor

Two examples: Firefox and Thunderbird

This is likely a focus assignment issue (and I see the "not explicitly given focus" warning while this is happening).

@wmww
Copy link
Contributor

wmww commented Jul 23, 2020

Likely a duplicate of #827

@AlanGriffiths
Copy link
Contributor Author

Here's a log of events when pulling up a thunderbird menu:

[3511394.204] wl_compositor@4.create_surface(new id wl_surface@70)
[3511394.317] xdg_wm_base@13.create_positioner(new id xdg_positioner@77)
[3511394.338] xdg_positioner@77.set_size(213, 408)
[3511394.352] xdg_positioner@77.set_anchor_rect(0, 63, 213, 408)
[3511394.375] xdg_positioner@77.set_offset(0, 0)
[3511394.389] xdg_positioner@77.set_anchor(5)
[3511394.398] xdg_positioner@77.set_gravity(8)
[3511394.409] xdg_positioner@77.set_constraint_adjustment(63)
[3511394.422] xdg_wm_base@13.get_xdg_surface(new id xdg_surface@65, wl_surface@70)
[3511394.446] xdg_surface@65.get_popup(new id xdg_popup@79, xdg_surface@32, xdg_positioner@77)
[3511394.526] xdg_positioner@77.destroy()
[3511394.558]  -> wl_display@1.delete_id(77)
[3511394.567] wl_surface@70.commit()
[2020-07-30 14:40:37.803429] <information> miral::Window Management: place_new_window app_info={application=, windows={Inbox - alan.griffiths@canonical.com - Mozilla Thunderbird}}, requested_specification={name=, type=freestyle, top_left=(0, 63), size=(213, 408), output_id=0, state=restored, aux_rect=((0, 63), (213, 408)), placement_hints=12, window_placement_gravity=5, aux_rect_placement_gravity=5, aux_rect_placement_offset=(0, 0), parent=Inbox - alan.griffiths@canonical.com - Mozilla Thunderbird, exclusive_rect=0} -> {name=, type=freestyle, top_left=(0, 63), size=(213, 408), output_id=0, state=restored, aux_rect=((0, 63), (213, 408)), placement_hints=12, window_placement_gravity=5, aux_rect_placement_gravity=5, aux_rect_placement_offset=(0, 0), parent=Inbox - alan.griffiths@canonical.com - Mozilla Thunderbird, exclusive_rect=0}
[2020-07-30 14:40:37.803717] <information> miral::Window Management: advise_adding_to_workspace workspace=0x55ee25650440, windows={}
[2020-07-30 14:40:37.803739] <information> miral::Window Management: info_for -> 
[2020-07-30 14:40:37.803775] <information> miral::Window Management: advise_new_window window_info={name=, type=freestyle, state=restored, top_left=(0, 63), size=(213, 408), parent=Inbox - alan.griffiths@canonical.com - Mozilla Thunderbird, children={}, exclusive_rect=0, preferred_orientation=0xf, confine_pointer=0, output_id=0}
[2020-07-30 14:40:37.803791] <information> miral::Window Management: info_for -> Inbox - alan.griffiths@canonical.com - Mozilla Thunderbird
[3511395.114]  -> xdg_popup@79.configure(0, 63, 213, 408)
[3511395.143]  -> xdg_surface@65.configure(101)
[2020-07-30 14:40:37.803867] <information> miral::Window Management: ====
[3511395.238]  -> wl_surface@70.enter(wl_output@6)
[3511395.256] wl_surface@70.frame(new id wl_callback@62)
[3511395.305] wl_surface@31.damage(0, 0, 1280, 893)
[3511395.330] wl_surface@31.frame(new id wl_callback@76)
[3511395.344] wl_surface@31.set_buffer_scale(1)
[3511395.353] wl_surface@31.attach(wl_buffer@55, 0, 0)
[3511395.395] wl_surface@31.commit()
[3511395.494] xdg_surface@65.ack_configure(101)
[3511395.881]  -> wl_buffer@49.release()
[3511396.225] wl_shm@14.create_pool(new id wl_shm_pool@77, fd 42, 347616)
[3511396.318] wl_shm_pool@77.create_buffer(new id wl_buffer@78, 0, 213, 408, 852, 0)
[3511396.360] wl_surface@70.attach(wl_buffer@78, 0, 0)
[3511396.400] wl_surface@70.set_buffer_scale(1)
[3511396.423] wl_surface@70.damage(0, 0, 213, 408)
[3511396.445] xdg_surface@65.set_window_geometry(0, 0, 213, 408)
[3511396.471] wl_surface@70.frame(new id wl_callback@52)
[3511396.494] wl_surface@70.commit()
[2020-07-30 14:40:37.805401] <information> miral::Window Management: handle_window_ready window_info={name=, type=freestyle, state=restored, top_left=(0, 63), size=(213, 408), parent=Inbox - alan.griffiths@canonical.com - Mozilla Thunderbird, children={}, exclusive_rect=0, preferred_orientation=0xf, confine_pointer=0, output_id=0}
[3511396.908]  -> wl_keyboard@3.leave(102, wl_surface@24)
[3511396.995]  -> wl_keyboard@3.enter(103, wl_surface@70, array)
[3511397.018]  -> wl_keyboard@46.leave(104, wl_surface@24)
[3511397.051]  -> wl_keyboard@46.enter(105, wl_surface@70, array)
[2020-07-30 14:40:37.805814] <information> miral::Window Management: advise_focus_lost window_info={name=Inbox - alan.griffiths@canonical.com - Mozilla Thunderbird, type=freestyle, state=maximized, top_left=(0, 0), size=(1280, 930), restore_rect=((0, 0), (1280, 930)), children={}, min_width=470, min_height=212, exclusive_rect=0, preferred_orientation=0xf, confine_pointer=0, output_id=0}
[2020-07-30 14:40:37.805843] <information> miral::Window Management: advise_focus_gained window_info={name=, type=freestyle, state=restored, top_left=(0, 63), size=(213, 408), parent=Inbox - alan.griffiths@canonical.com - Mozilla Thunderbird, children={}, exclusive_rect=0, preferred_orientation=0xf, confine_pointer=0, output_id=0}
[2020-07-30 14:40:37.805856] <information> miral::Window Management: raise_tree root=
[2020-07-30 14:40:37.805876] <information> miral::Window Management: advise_raise window_info={Inbox - alan.griffiths@canonical.com - Mozilla Thunderbird, }
[2020-07-30 14:40:37.805909] <information> miral::Window Management: advise_raise window_info={}
[2020-07-30 14:40:37.805932] <information> miral::Window Management: select_active_window hint= -> 
[2020-07-30 14:40:37.805942] <information> miral::Window Management: ====
[2020-07-30 14:40:37.806047] <information> miral::Window Management: handle_modify_window window_info={name=, type=freestyle, state=restored, top_left=(0, 63), size=(213, 408), parent=Inbox - alan.griffiths@canonical.com - Mozilla Thunderbird, children={}, exclusive_rect=0, preferred_orientation=0xf, confine_pointer=0, output_id=0}, modifications={}
[2020-07-30 14:40:37.806075] <information> miral::Window Management: modify_window window_info={name=, type=freestyle, state=restored, top_left=(0, 63), size=(213, 408), parent=Inbox - alan.griffiths@canonical.com - Mozilla Thunderbird, children={}, exclusive_rect=0, preferred_orientation=0xf, confine_pointer=0, output_id=0}, modifications={}
[2020-07-30 14:40:37.806095] <information> miral::Window Management: ====
[3511397.439]  -> wl_callback@76.done(0)
[3511397.452]  -> wl_display@1.delete_id(76)
[3511400.702] xdg_popup@79.destroy()

@AlanGriffiths AlanGriffiths self-assigned this Jul 30, 2020
@AlanGriffiths
Copy link
Contributor Author

So, my reading of this is that the menu does not issue a grab, but Mir simply sees it as a freestyle window and gives it focus anyway.

I suspect a popup ought to be either a mir_window_type_gloss (without a grab) or a mir_window_type_menu (with a grab). (And that we probably need to update the window types for the Wayland era.)

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