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

Investigate feedback from lxqt #3761

Closed
AlanGriffiths opened this issue Feb 17, 2025 · 12 comments
Closed

Investigate feedback from lxqt #3761

AlanGriffiths opened this issue Feb 17, 2025 · 12 comments
Labels
triaged Triage into JIRA to plan it in

Comments

@AlanGriffiths
Copy link
Collaborator

Thanks, I gave it a try but I see the same issues I saw with the package gently provided by @sfalken:

  • Misalignment of menus in bottom/right panel
  • No window borders
  • No cursor shape change on resizable edges, it's very hard to resize windows.
  • Crash on start of any DND movement in pcmanfm-qt
  • Panel crashes when trying to DND an app icon to quicklaunch from fancy menu.
    For some reason in the "Configuration Center" LXQt settings are show twice, also under "Other settings".

I continue to consider miriway early alpha and frankly I can't understand why it is chosen, especially when there are 3 mature alternatives for stacking compositors.

lxqt/lxqt-wayland-session#40 (comment)

@AlanGriffiths AlanGriffiths added the triaged Triage into JIRA to plan it in label Feb 17, 2025
@AlanGriffiths
Copy link
Collaborator Author

Preliminary note

Installing the Fedora image and logging into an lxqt/Miriway session it is apparent the Miriway configuration is broken.

  1. There's no support for X11 apps (even though Xwayland is installed)
  2. There's a lxqt-miriway-wrapper script that bypasses miriway and launches miriway-shell directly.
    2.1. This wrapper uses the command-line to supply configuration, not the .config file
    2.2. This wrapper sets MIRIWAY_CONFIG_DIR to "lxqt", but the only config is the default /etc/xdg/xdg-miriway/miriway-shell.config (which means Miriway never finds any configuration file)

On the points above...

  • Misalignment of menus in bottom/right panel
    • What I see is _sub_menus misplaced (e.g. in the network indicator menu "VPN Connections" the "Add a VPN connection..." appears at bottom of screen. (Not traced the cause)
  • No window borders
    • (not yet reproduced)
  • No cursor shape change on resizable edges, it's very hard to resize windows.
    • I do see cursor shapes on edges
  • Crash on start of any DND movement in pcmanfm-qt
    • Reproduced
  • Panel crashes when trying to DND an app icon to quicklaunch from fancy menu.
    • Reproduced

Something is wrong with Mir's DnD code: whatever lxqt is doing (whether right or wrong) we shouldn't crash the server.

@AlanGriffiths
Copy link
Collaborator Author

Ah! The config file actually being found is the user's: ~/.config/lxqt/miriway-shell.config. (Not sure where that's created, but OK)

Also, having logged out and back in a few times I now see Xwayland running and DISPLAY is "=:1" - which I didn't see originally

@AlanGriffiths
Copy link
Collaborator Author

Trying to replicate on Ubuntu 24.10 (for ease of debugging)...

The "bottom right" panel icons are not shown in my lxqt setup. (Obviously, I'm missing a bunch of lxqt setup)

When trying to DnD in the file explorer, the drag icon is attached to the cursor and never removed.

@AlanGriffiths
Copy link
Collaborator Author

AlanGriffiths commented Feb 18, 2025

WAYLAND_DEBUGing the "misplaced" menus, the anchor rect seems suspect:

[  65316.781] {Default Queue}  -> xdg_wm_base#3.get_xdg_surface(new id xdg_surface#53, wl_surface#51)
[  65316.804] {Default Queue}  -> xdg_wm_base#3.create_positioner(new id xdg_positioner#54)
[  65316.823] {Default Queue}  -> xdg_positioner#54.set_anchor_rect(-200, 294, 1, 1)
[  65316.836] {Default Queue}  -> xdg_positioner#54.set_anchor(5)
[  65316.847] {Default Queue}  -> xdg_positioner#54.set_gravity(8)
[  65316.857] {Default Queue}  -> xdg_positioner#54.set_size(202, 30)
[  65316.868] {Default Queue}  -> xdg_positioner#54.set_constraint_adjustment(3)

The anchor rect "may not extend outside ... the parent", so set_anchor_rect(-200, 294, 1, 1) looks wrong. Need to check if the window geometry really extends to -200...

And the answer seems to be "no":

alan@fedora:~$ grep wl_surface#51 lxqt-session.log 
[  65314.948] {Default Queue}  -> wl_compositor#4.create_surface(new id wl_surface#51)
[  65316.706] {Default Queue}  -> wl_surface#51.set_opaque_region(wl_region#41)
[  65316.745] {Default Queue}  -> wp_fractional_scale_manager_v1#16.get_fractional_scale(new id wp_fractional_scale_v1#52, wl_surface#51)
[  65316.781] {Default Queue}  -> xdg_wm_base#3.get_xdg_surface(new id xdg_surface#53, wl_surface#51)
[  65316.931] {Default Queue}  -> wp_viewporter#18.get_viewport(new id wp_viewport#56, wl_surface#51)
[  65316.985] {Default Queue}  -> wl_surface#51.set_buffer_transform(0)
[  65317.002] {Default Queue}  -> wl_surface#51.commit()
[  65318.344] {Default Queue} wl_surface#51.enter(wl_output#19)
[  65318.966]  -> wl_surface#51.frame(new id wl_callback#41)
[  65318.992] {Default Queue}  -> wl_surface#51.attach(wl_buffer#54, 0, 0)
[  65319.007] {Default Queue}  -> wl_surface#51.damage_buffer(0, 0, 202, 30)
[  65319.019] {Default Queue}  -> wl_surface#51.commit()
[  65319.173] {Default Queue}  -> wl_surface#51.commit()
[  65334.097]  -> wl_surface#51.frame(new id wl_callback#59)
[  65334.146] {Default Queue}  -> wl_surface#51.attach(wl_buffer#58, 0, 0)
[  65334.163] {Default Queue}  -> wl_surface#51.damage_buffer(0, 0, 202, 30)
[  65334.175] {Default Queue}  -> wl_surface#51.commit()
[  72907.822] {Default Queue}  -> wl_surface#51.destroy()
alan@fedora:~$ grep xdg_surface#53 lxqt-session.log 
[  65316.781] {Default Queue}  -> xdg_wm_base#3.get_xdg_surface(new id xdg_surface#53, wl_surface#51)
[  65316.880] {Default Queue}  -> xdg_surface#53.get_popup(new id xdg_popup#55, xdg_surface#49, xdg_positioner#54)
[  65318.163] {Default Queue} xdg_surface#53.configure(91)
[  65318.213] {Default Queue}  -> xdg_surface#53.ack_configure(91)
[  65318.257] {Default Queue} xdg_surface#53.configure(92)
[  65318.326] {Default Queue}  -> xdg_surface#53.set_window_geometry(0, 0, 202, 30)
[  65319.100] {Default Queue}  -> xdg_surface#53.set_window_geometry(0, 0, 202, 30)
[  65319.116] {Default Queue}  -> xdg_surface#53.ack_configure(92)
[  65319.129] {Default Queue}  -> xdg_surface#53.set_window_geometry(0, 0, 202, 30)
[  72907.771] {Default Queue}  -> xdg_surface#53.destroy()

@AlanGriffiths
Copy link
Collaborator Author

AlanGriffiths commented Feb 20, 2025

Crash on start of any DND movement in pcmanfm-qt

Here's the backtrace:

#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
#1  0x00007ffff7792343 in __pthread_kill_internal (threadid=<optimized out>, signo=6) at pthread_kill.c:89
#2  0x00007ffff7738cbe in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#3  0x00007ffff77206d6 in __GI_abort () at abort.c:73
#4  0x00007ffff7a0b0c2 in std::__glibcxx_assert_fail (file=<optimized out>, line=<optimized out>, function=<optimized out>, condition=<optimized out>)
    at ../../../../../libstdc++-v3/src/c++11/assert_fail.cc:41
#5  0x00007ffff7047b74 in std::optional<mir::geometry::generic::Size<int> >::operator-> (this=0x7fff81ffb6a8) at /usr/include/c++/15/optional:1172
#6  0x00007ffff7044276 in mir::frontend::WlDataDevice::DragIconSurface::DragIconSurface (this=0x7fff74027710, icon=0x7fff7428e250, drag_icon_controller=...)
    at /home/alan/mir/src/server/frontend_wayland/wl_data_device.cpp:377
#7  0x00007ffff7049040 in std::_Construct<mir::frontend::WlDataDevice::DragIconSurface, mir::frontend::WlSurface* const&, std::shared_ptr<mir::frontend::DragIconController> const&> (
    __p=0x7fff74027710) at /usr/include/c++/15/bits/stl_construct.h:133
#8  0x00007ffff7048b51 in std::_Optional_payload_base<mir::frontend::WlDataDevice::DragIconSurface>::_M_construct<mir::frontend::WlSurface* const&, std::shared_ptr<mir::frontend::DragIconController> const&> (this=0x7fff74027710) at /usr/include/c++/15/optional:298
#9  0x00007ffff70481f1 in std::_Optional_base<mir::frontend::WlDataDevice::DragIconSurface, false, false>::_M_construct<mir::frontend::WlSurface* const&, std::shared_ptr<mir::frontend::DragIconController> const&> (this=0x7fff74027710) at /usr/include/c++/15/optional:550
#10 0x00007ffff7047641 in std::optional<mir::frontend::WlDataDevice::DragIconSurface>::emplace<mir::frontend::WlSurface* const&, std::shared_ptr<mir::frontend::DragIconController> const&> (
    this=0x7fff74027710) at /usr/include/c++/15/optional:1120
#11 0x00007ffff704342a in mir::frontend::WlDataDevice::start_drag (this=0x7fff74027630, source=..., origin=0x7fff7429b3d0, icon=..., serial=87)
    at /home/alan/mir/src/server/frontend_wayland/wl_data_device.cpp:209
#12 0x00007ffff6a09b94 in mir::wayland::DataDevice::Thunks::start_drag_thunk (client=0x7fff74005bd0, resource=0x7fff74029fd0, source=0x7fff7426d8d0, origin=0x7fff7429b3d0, 
    icon=0x7fff7426cfd0, serial=87) at /home/alan/mir/build/src/wayland/wayland_wrapper.cpp:1136
#13 0x00007ffff7c8c056 in ffi_call_unix64 () at ../src/x86/unix64.S:104
#14 0x00007ffff7c87d08 in ffi_call_int (cif=cif@entry=0x7fff81ffbc70, 
    fn=fn@entry=0x7ffff6a09ac0 <mir::wayland::DataDevice::Thunks::start_drag_thunk(wl_client*, wl_resource*, wl_resource*, wl_resource*, wl_resource*, unsigned int)>, 
    rvalue=<optimized out>, rvalue@entry=0x0, avalue=avalue@entry=0x7fff81ffbd40, closure=closure@entry=0x0) at ../src/x86/ffi64.c:673
#15 0x00007ffff7c8a70e in ffi_call (cif=cif@entry=0x7fff81ffbc70, 
    fn=0x7ffff6a09ac0 <mir::wayland::DataDevice::Thunks::start_drag_thunk(wl_client*, wl_resource*, wl_resource*, wl_resource*, wl_resource*, unsigned int)>, rvalue=rvalue@entry=0x0, 
    avalue=avalue@entry=0x7fff81ffbd40) at ../src/x86/ffi64.c:710
#16 0x00007ffff697fe87 in wl_closure_invoke (closure=closure@entry=0x7fff74196f10, target=<optimized out>, target@entry=0x7fff74029fd0, opcode=opcode@entry=0, data=<optimized out>, 
    data@entry=0x7fff74005bd0, flags=2) at ../src/connection.c:1228
#17 0x00007ffff6984a5b in wl_client_connection_data (fd=<optimized out>, mask=<optimized out>, data=<optimized out>) at ../src/wayland-server.c:444
#18 0x00007ffff6982ee2 in wl_event_loop_dispatch (loop=0x58e0c0, timeout=<optimized out>, timeout@entry=-1) at ../src/event-loop.c:1105
#19 0x00007ffff6984ec5 in wl_display_run (display=0x521f80) at ../src/wayland-server.c:1530
#20 0x00007ffff70287a8 in operator() (__closure=0xc07548, d=0x521f80) at /home/alan/mir/src/server/frontend_wayland/wayland_connector.cpp:423
#21 0x00007ffff702a97c in std::__invoke_impl<void, mir::frontend::WaylandConnector::start()::<lambda(wl_display*)>, wl_display*>(std::__invoke_other, struct {...} &&) (__f=...)
    at /usr/include/c++/15/bits/invoke.h:63
#22 0x00007ffff702a929 in std::__invoke<mir::frontend::WaylandConnector::start()::<lambda(wl_display*)>, wl_display*>(struct {...} &&) (__fn=...) at /usr/include/c++/15/bits/invoke.h:98
#23 0x00007ffff702a8ab in std::thread::_Invoker<std::tuple<mir::frontend::WaylandConnector::start()::<lambda(wl_display*)>, wl_display*> >::_M_invoke<0, 1>(std::_Index_tuple<0, 1>) (
    this=0xc07548) at /usr/include/c++/15/bits/std_thread.h:303
#24 0x00007ffff702a864 in std::thread::_Invoker<std::tuple<mir::frontend::WaylandConnector::start()::<lambda(wl_display*)>, wl_display*> >::operator()(void) (this=0xc07548)
    at /usr/include/c++/15/bits/std_thread.h:310
#25 0x00007ffff702a848 in std::thread::_State_impl<std::thread::_Invoker<std::tuple<mir::frontend::WaylandConnector::start()::<lambda(wl_display*)>, wl_display*> > >::_M_run(void) (
    this=0xc07540) at /usr/include/c++/15/bits/std_thread.h:255
#26 0x00007ffff7a4eec4 in std::execute_native_thread_routine (__p=0xc07540) at ../../../../../libstdc++-v3/src/c++11/thread.cc:104
#27 0x00007ffff7790324 in start_thread (arg=<optimized out>) at pthread_create.c:448
#28 0x00007ffff7813cfc in __GI___clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78

And that is because: the WlSurface for the icon has a std__nullopt value in buffer_size_ when we dereference it. Oops!

This is in the data_device.start_drag() implementation, where I would expect there to be a buffer available, but need to check the spec.

@Conan-Kudo
Copy link
Contributor

There's a lxqt-miriway-wrapper script that bypasses miriway and launches miriway-shell directly.

I have to do this because the wrapper doesn't do exactly what I need it to do for LXQt.

Ah! The config file actually being found is the user's: ~/.config/lxqt/miriway-shell.config. (Not sure where that's created, but OK)

It is created in the patch discussed in the pull request referenced in this issue.

Also, having logged out and back in a few times I now see Xwayland running and DISPLAY is "=:1" - which I didn't see originally

I'm not sure why it wouldn't show up ever, since we configure it in the wrapper script.

@AlanGriffiths
Copy link
Collaborator Author

AlanGriffiths commented Feb 20, 2025

@Conan-Kudo:

tldr;

You may want to grab the following PRs and environment variables

PR Comment
#3766 Mir bug
#3770 Mir bug
#3764 Mitigation needing export MIR_ANCHOR_RECTANGLE_UNCONSTRAINED=1
Miriway/Miriway#150 Mitigation needing MIRIWAY_DECORATIONS=prefer-ssd

More details

Misalignment of menus in bottom/right panel

  • In essence this is some part of the lxqt stack setting an invalid anchor rectangle, not sure where to file a bug about this
  • But, it looks like it works better with Workaround for LXQt panel #3764 and MIR_ANCHOR_RECTANGLE_UNCONSTRAINED set in the environment

If you know where to file the bug...

No window borders

No cursor shape change on resizable edges, it's very hard to resize windows.

  • afaics there are decorations and they do work
  • The same Qt CSD issue?

Crash on start of any DND movement in pcmanfm-qt

Panel crashes when trying to DND an app icon to quicklaunch from fancy menu.

@AlanGriffiths
Copy link
Collaborator Author

Panel crashes when trying to DND an app icon to quicklaunch from fancy menu.

This would appear to be Mir reporting an error:

[2355654.444] {Display Queue} wl_display#1.error(wl_data_device#8, 0, "Origin surface does have input focus")
wl_data_device#8: error 0: Origin surface does have input focus

The full wl_data* story...

[3550784.616] {Default Queue} wl_registry#2.global(6, "wl_data_device_manager", 3)
[3550784.625] {Default Queue}  -> wl_registry#2.bind(6, "wl_data_device_manager", 3, new id [unknown]#7)
[3550784.636] {Default Queue}  -> wl_data_device_manager#7.get_data_device(new id wl_data_device#8, wl_seat#6)
[3550937.151] {Default Queue} wl_registry#2.global(6, "wl_data_device_manager", 3)
[3550937.165] {Default Queue}  -> wl_registry#2.bind(6, "wl_data_device_manager", 3, new id [unknown]#7)
[3550937.180] {Default Queue}  -> wl_data_device_manager#7.get_data_device(new id wl_data_device#8, wl_seat#6)
[3550959.463] {Default Queue} wl_registry#2.global(6, "wl_data_device_manager", 3)
[3550959.476] {Default Queue}  -> wl_registry#2.bind(6, "wl_data_device_manager", 3, new id [unknown]#7)
[3550959.492] {Default Queue}  -> wl_data_device_manager#7.get_data_device(new id wl_data_device#8, wl_seat#6)
[3550969.880] {Default Queue} wl_registry#2.global(6, "wl_data_device_manager", 3)
[3550969.896] {Default Queue}  -> wl_registry#2.bind(6, "wl_data_device_manager", 3, new id [unknown]#7)
[3550969.912] {Default Queue}  -> wl_data_device_manager#7.get_data_device(new id wl_data_device#8, wl_seat#6)
[3551032.348] {Default Queue} wl_registry#2.global(6, "wl_data_device_manager", 3)
[3551032.361] {Default Queue}  -> wl_registry#2.bind(6, "wl_data_device_manager", 3, new id [unknown]#7)
[3551032.376] {Default Queue}  -> wl_data_device_manager#7.get_data_device(new id wl_data_device#8, wl_seat#6)
[3551050.424] {Default Queue} wl_registry#2.global(6, "wl_data_device_manager", 3)
[3551050.432] {Default Queue}  -> wl_registry#2.bind(6, "wl_data_device_manager", 3, new id [unknown]#6)
[3551066.392] {Default Queue} wl_registry#2.global(6, "wl_data_device_manager", 3)
[3551066.406] {Default Queue}  -> wl_registry#2.bind(6, "wl_data_device_manager", 3, new id [unknown]#7)
[3551066.421] {Default Queue}  -> wl_data_device_manager#7.get_data_device(new id wl_data_device#8, wl_seat#6)
[3551084.625] {Default Queue}  -> wl_data_device_manager#6.get_data_device(new id wl_data_device#18, wl_seat#15)
[3551298.658] {Default Queue} wl_registry#2.global(6, "wl_data_device_manager", 3)
[3551298.666] {Default Queue}  -> wl_registry#2.bind(6, "wl_data_device_manager", 3, new id [unknown]#6)
[3551335.874] {Default Queue}  -> wl_data_device_manager#6.get_data_device(new id wl_data_device#18, wl_seat#15)
[3552045.935] {Default Queue} wl_registry#2.global(6, "wl_data_device_manager", 3)
[3552045.949] {Default Queue}  -> wl_registry#2.bind(6, "wl_data_device_manager", 3, new id [unknown]#7)
[3552045.964] {Default Queue}  -> wl_data_device_manager#7.get_data_device(new id wl_data_device#8, wl_seat#6)
[2355653.315] {Default Queue}  -> wl_data_device_manager#7.create_data_source(new id wl_data_source#56)
[2355653.337] {Default Queue}  -> wl_data_source#56.offer("text/uri-list")
[2355653.352] {Default Queue}  -> wl_data_source#56.offer("application/x-lxqtfavoritesdragrow")
[2355653.367] {Default Queue}  -> wl_data_source#56.set_actions(3)
[2355653.390] {Default Queue}  -> wl_data_device#8.start_drag(wl_data_source#56, wl_surface#42, wl_surface#50, 38)
[2355654.444] {Display Queue} wl_display#1.error(wl_data_device#8, 0, "Origin surface does have input focus")
wl_data_device#8: error 0: Origin surface does have input focus
[2355709.684] {Default Queue} wl_registry#2.global(6, "wl_data_device_manager", 3)
[2355709.691] {Default Queue}  -> wl_registry#2.bind(6, "wl_data_device_manager", 3, new id [unknown]#7)
[2355709.699] {Default Queue}  -> wl_data_device_manager#7.get_data_device(new id wl_data_device#8, wl_seat#6)
[ 242302.585] {Default Queue}  -> wl_data_device_manager#7.create_data_source(new id wl_data_source#57)
[ 242302.627] {Default Queue}  -> wl_data_source#57.offer("text/uri-list")
[ 242302.639] {Default Queue}  -> wl_data_source#57.offer("application/x-lxqtfavoritesdragrow")                              
[ 242302.647] {Default Queue}  -> wl_data_source#57.set_actions(3)                                                           
[ 242302.661] {Default Queue}  -> wl_data_device#8.start_drag(wl_data_source#57, wl_surface#44, wl_surface#55, 124)          
[ 242303.927] {Display Queue} wl_display#1.error(wl_data_device#8, 0, "Origin surface does have input focus")                
wl_data_device#8: error 0: Origin surface does have input focus                                                              
[ 242359.432] {Default Queue} wl_registry#2.global(6, "wl_data_device_manager", 3)                                           
[ 242359.442] {Default Queue}  -> wl_registry#2.bind(6, "wl_data_device_manager", 3, new id [unknown]#7)                     
[ 242359.451] {Default Queue}  -> wl_data_device_manager#7.get_data_device(new id wl_data_device#8, wl_seat#6)    

@AlanGriffiths
Copy link
Collaborator Author

This would appear to be Mir reporting an error:

And that's because the "origin" surface isn't the same surface that has input focus. (I need to check what the protocol actually requires here, not sure the check is correct.)

@AlanGriffiths
Copy link
Collaborator Author

I need to check what the protocol actually requires here, not sure the check is correct.

And the spec:

	The origin surface is the surface where the drag originates and
	the client must have an active implicit grab that matches the
	serial.

I.e. Mir is wrong. There's no requirement about which of the client's surfaces has focus

@Saviq
Copy link
Collaborator

Saviq commented Feb 21, 2025

Mir is wrong.

Yeah, I'd expect any pointer down + move to initiate a successful drag, regardless of focus.

@AlanGriffiths
Copy link
Collaborator Author

We're done here: Mir and Miriway fixes have landed. qt-layer-shell bug reported

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triaged Triage into JIRA to plan it in
Projects
None yet
Development

No branches or pull requests

3 participants