Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-52052

Drag-and-drop causes two roles to be assigned to one wl_surface (fatal protocol error)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 5.7.0 Beta
    • 5.7.0 Alpha
    • QPA: Wayland
    • None

    Description

      To reproduce:

      1. Start Weston >= 1.7
      2. Start the draggableicons in qtbase with -platform wayland
      3. Start dragging one of the icons

      Results in a protocol error (fatal error)

      /d/q/b/570-alpha env WAYLAND_DEBUG=1 env --unset QT_DEVICE_PIXEL_RATIO ./qtbase/examples/widgets/draganddrop/draggableicons/draggableicons  -platform wayland
      [3231767.577]  -> wl_display@1.get_registry(new id wl_registry@2)
      [3231767.623]  -> wl_display@1.sync(new id wl_callback@3)
      [3231767.750] wl_display@1.delete_id(3)
      [3231767.777] wl_registry@2.global(1, "wl_compositor", 4)
      [3231767.811]  -> wl_registry@2.bind(1, "wl_compositor", 3, new id [unknown]@4)
      [3231767.830] wl_registry@2.global(2, "wl_subcompositor", 1)
      [3231767.840]  -> wl_registry@2.bind(2, "wl_subcompositor", 1, new id [unknown]@5)
      [3231767.853] wl_registry@2.global(3, "wl_scaler", 2)
      [3231767.863] wl_registry@2.global(4, "presentation", 1)
      [3231767.874] wl_registry@2.global(5, "wl_data_device_manager", 3)
      [3231767.887]  -> wl_registry@2.bind(5, "wl_data_device_manager", 1, new id [unknown]@6)
      [3231767.901] wl_registry@2.global(6, "wl_shm", 1)
      [3231767.912]  -> wl_registry@2.bind(6, "wl_shm", 1, new id [unknown]@7)
      [3231767.925] wl_registry@2.global(7, "wl_drm", 2)
      [3231767.936] wl_registry@2.global(8, "wl_seat", 5)
      [3231767.948]  -> wl_registry@2.bind(8, "wl_seat", 3, new id [unknown]@8)
      [3231767.966]  -> wl_data_device_manager@6.get_data_device(new id wl_data_device@9, wl_seat@8)
      [3231767.978] wl_registry@2.global(9, "wl_output", 2)
      [3231767.994]  -> wl_registry@2.bind(9, "wl_output", 2, new id [unknown]@10)
      [3231768.016]  -> wl_display@1.sync(new id wl_callback@11)
      [3231768.024] wl_registry@2.global(10, "zwp_linux_dmabuf_v1", 1)
      [3231768.038] wl_registry@2.global(11, "zwp_input_panel_v1", 1)
      [3231768.066] wl_registry@2.global(12, "zwp_input_method_v1", 1)
      [3231768.080] wl_registry@2.global(13, "zwp_text_input_manager_v1", 1)
      [3231768.091] wl_registry@2.global(14, "wl_shell", 1)
      [3231768.102]  -> wl_registry@2.bind(14, "wl_shell", 1, new id [unknown]@12)
      [3231768.121] wl_registry@2.global(15, "xdg_shell", 1)
      [3231768.136] wl_registry@2.global(16, "weston_desktop_shell", 1)
      [3231768.151] wl_registry@2.global(17, "weston_screenshooter", 1)
      [3231768.164] wl_callback@3.done(81)
      [3231768.211] wl_display@1.delete_id(11)
      [3231768.219] wl_shm@7.format(0)
      [3231768.229] wl_shm@7.format(1)
      [3231768.235] wl_shm@7.format(909199186)
      [3231768.242] wl_seat@8.capabilities(3)
      [3231768.271]  -> wl_seat@8.get_keyboard(new id wl_keyboard@3)
      [3231768.281]  -> wl_seat@8.get_pointer(new id wl_pointer@13)
      [3231768.289]  -> wl_compositor@4.create_surface(new id wl_surface@14)
      [3231768.300] wl_seat@8.name("default")
      [3231768.308] wl_output@10.geometry(0, 0, 270, 169, 0, "weston-X11", "none", 0)
      [3231768.338] wl_output@10.scale(1)
      [3231768.345] wl_output@10.mode(3, 1024, 640, 60000)
      [3231768.359] wl_output@10.done()
      [3231768.377] wl_callback@11.done(81)
      [3231768.431]  -> wl_shm@7.create_pool(new id wl_shm_pool@11, fd 5, 4096)
      [3231768.630]  -> wl_shm_pool@11.resize(12288)
      [3231768.720]  -> wl_shm_pool@11.resize(28672)
      [3231769.768]  -> wl_shm_pool@11.resize(61440)
      [3231769.800]  -> wl_shm_pool@11.resize(126976)
      [3231769.840]  -> wl_shm_pool@11.resize(258048)
      [3231769.914]  -> wl_shm_pool@11.resize(520192)
      [3231771.023]  -> wl_shm_pool@11.resize(1044480)
      [3231773.978]  -> wl_shm_pool@11.resize(2093056)
      Using Wayland-EGL
      [3231796.012]  -> wl_display@1.get_registry(new id wl_registry@15)
      [3231796.059]  -> wl_display@1.sync(new id wl_callback@16)
      [3231796.346] wl_display@1.delete_id(16)
      [3231796.364] wl_registry@15.global(1, "wl_compositor", 4)
      [3231796.370] wl_registry@15.global(2, "wl_subcompositor", 1)
      [3231796.373] wl_registry@15.global(3, "wl_scaler", 2)
      [3231796.390] wl_registry@15.global(4, "presentation", 1)
      [3231796.398] wl_registry@15.global(5, "wl_data_device_manager", 3)
      [3231796.407] wl_registry@15.global(6, "wl_shm", 1)
      [3231796.414] wl_registry@15.global(7, "wl_drm", 2)
      [3231796.424]  -> wl_registry@15.bind(7, "wl_drm", 2, new id [unknown]@17)
      [3231796.440] wl_registry@15.global(8, "wl_seat", 5)
      [3231796.448] wl_registry@15.global(9, "wl_output", 2)
      [3231796.458] wl_registry@15.global(10, "zwp_linux_dmabuf_v1", 1)
      [3231796.469] wl_registry@15.global(11, "zwp_input_panel_v1", 1)
      [3231796.478] wl_registry@15.global(12, "zwp_input_method_v1", 1)
      [3231796.487] wl_registry@15.global(13, "zwp_text_input_manager_v1", 1)
      [3231796.498] wl_registry@15.global(14, "wl_shell", 1)
      [3231796.508] wl_registry@15.global(15, "xdg_shell", 1)
      [3231796.519] wl_registry@15.global(16, "weston_desktop_shell", 1)
      [3231796.528] wl_registry@15.global(17, "weston_screenshooter", 1)
      [3231796.538] wl_callback@16.done(81)
      [3231796.558]  -> wl_display@1.sync(new id wl_callback@16)
      [3231796.630] wl_display@1.delete_id(16)
      [3231796.637] wl_drm@17.device("/dev/dri/renderD128")
      [3231796.697] wl_drm@17.format(875713089)
      [3231796.703] wl_drm@17.format(875713112)
      [3231796.708] wl_drm@17.format(909199186)
      [3231796.713] wl_drm@17.format(961959257)
      [3231796.718] wl_drm@17.format(825316697)
      [3231796.723] wl_drm@17.format(842093913)
      [3231796.728] wl_drm@17.format(909202777)
      [3231796.733] wl_drm@17.format(875713881)
      [3231796.740] wl_drm@17.format(842094158)
      [3231796.746] wl_drm@17.format(909203022)
      [3231796.752] wl_drm@17.format(1448695129)
      [3231796.757] wl_drm@17.capabilities(1)
      [3231796.762] wl_callback@16.done(81)
      [3231796.769]  -> wl_display@1.sync(new id wl_callback@16)
      [3231796.812] wl_display@1.delete_id(16)
      [3231796.817] wl_callback@16.done(81)
      [3231804.230]  -> wl_compositor@4.create_surface(new id wl_surface@16)
      [3231804.264]  -> wl_shell@12.get_shell_surface(new id wl_shell_surface@18, wl_surface@16)
      [3231804.311]  -> wl_shell_surface@18.set_title("")
      [3231804.364]  -> wl_shell_surface@18.set_class("draggableicons")
      [3231804.374]  -> wl_shell_surface@18.set_toplevel()
      [3231804.392]  -> wl_surface@16.set_buffer_scale(1)
      [3231804.425]  -> wl_surface@16.set_buffer_transform(0)
      [3231804.429]  -> wl_surface@16.commit()
      [3231804.491]  -> wl_shell_surface@18.set_title("Draggable Icons")
      [3231804.521]  -> wl_shell_surface@18.set_title("Draggable Icons")
      [3231804.939]  -> wl_shm_pool@11.create_buffer(new id wl_buffer@19, 802816, 32, 32, 128, 0)
      [3231804.966]  -> wl_pointer@13.set_cursor(0, wl_surface@14, 5, 5)
      [3231804.972]  -> wl_surface@14.attach(wl_buffer@19, 0, 0)
      [3231804.982]  -> wl_surface@14.damage(0, 0, 32, 32)
      [3231804.989]  -> wl_surface@14.commit()
      [3231805.027]  -> wl_pointer@13.set_cursor(0, wl_surface@14, 5, 5)
      [3231805.034]  -> wl_surface@14.attach(wl_buffer@19, 0, 0)
      [3231805.037]  -> wl_surface@14.damage(0, 0, 32, 32)
      [3231805.041]  -> wl_surface@14.commit()
      [3231805.106] wl_keyboard@3.keymap(1, fd 5, 57037)
      [3231807.969]  -> wl_shm@7.create_pool(new id wl_shm_pool@20, fd 8, 442680)
      [3231807.981]  -> wl_shm_pool@20.create_buffer(new id wl_buffer@21, 0, 434, 255, 1736, 0)
      [3231818.645]  -> wl_surface@16.frame(new id wl_callback@22)
      [3231818.687]  -> wl_surface@16.attach(wl_buffer@21, 0, 0)
      [3231818.726]  -> wl_surface@16.frame(new id wl_callback@23)
      [3231818.747]  -> wl_surface@16.damage(0, 0, 428, 222)
      [3231818.760]  -> wl_surface@16.commit()
      [3231819.054] wl_surface@16.enter(wl_output@10)
      [3231819.070] wl_keyboard@3.modifiers(82, 0, 0, 16, 0)
      [3231819.115] wl_keyboard@3.enter(82, wl_surface@16, array)
      [3231819.139]  -> wl_display@1.sync(new id wl_callback@24)
      [3231819.150] wl_data_device@9.selection(nil)
      [3231819.235] wl_display@1.delete_id(24)
      [3231819.242] wl_callback@24.done(82)
      [3231828.914] wl_display@1.delete_id(22)
      [3231828.938] wl_display@1.delete_id(23)
      [3231828.945] wl_callback@22.done(93956321)
      [3231828.969] wl_callback@23.done(93956321)
      [3232684.359] wl_keyboard@3.modifiers(83, 8, 0, 16, 0)
      [3233548.291] wl_keyboard@3.modifiers(84, 0, 0, 16, 0)
      [3237124.772] wl_pointer@13.enter(90, wl_surface@16, 0.000000, 80.000000)
      [3237124.873]  -> wl_shm_pool@11.create_buffer(new id wl_buffer@23, 1323008, 32, 32, 128, 0)
      [3237124.895]  -> wl_pointer@13.set_cursor(90, wl_surface@14, 16, 15)
      [3237124.907]  -> wl_surface@14.attach(wl_buffer@23, 0, 0)
      [3237124.912]  -> wl_surface@14.damage(0, 0, 32, 32)
      [3237124.928]  -> wl_surface@14.commit()
      [3237124.952]  -> wl_pointer@13.set_cursor(90, wl_surface@14, 5, 5)
      [3237124.958]  -> wl_surface@14.attach(wl_buffer@19, 0, 0)
      [3237124.971]  -> wl_surface@14.damage(0, 0, 32, 32)
      [3237124.978]  -> wl_surface@14.commit()
      [3237124.992] wl_shell_surface@18.ping(91)
      [3237124.996]  -> wl_shell_surface@18.pong(91)
      [3237124.998] wl_pointer@13.motion(2657526913, 0.000000, 80.000000)
      [3237125.020]  -> wl_pointer@13.set_cursor(90, wl_surface@14, 16, 15)
      [3237125.038]  -> wl_surface@14.attach(wl_buffer@23, 0, 0)
      [3237125.054]  -> wl_surface@14.damage(0, 0, 32, 32)
      [3237125.062]  -> wl_surface@14.commit()
      [3237125.065] wl_pointer@13.motion(2657526913, 1.000000, 80.000000)
      [3237144.019] wl_pointer@13.motion(2657526932, 2.000000, 80.000000)
      [3237144.090] wl_pointer@13.motion(2657526932, 5.000000, 79.000000)
      [3237144.137]  -> wl_pointer@13.set_cursor(90, wl_surface@14, 5, 5)
      [3237144.145]  -> wl_surface@14.attach(wl_buffer@19, 0, 0)
      [3237144.152]  -> wl_surface@14.damage(0, 0, 32, 32)
      [3237144.159]  -> wl_surface@14.commit()
      [3237163.175] wl_pointer@13.motion(2657526952, 7.000000, 79.000000)
      [3237163.258] wl_pointer@13.motion(2657526952, 10.000000, 79.000000)
      [3237182.361] wl_pointer@13.motion(2657526971, 11.000000, 79.000000)
      [3237182.422] wl_pointer@13.motion(2657526971, 12.000000, 79.000000)
      [3237182.436] wl_pointer@13.motion(2657526971, 14.000000, 78.000000)
      [3237201.570] wl_pointer@13.motion(2657526990, 15.000000, 78.000000)
      [3237201.621] wl_pointer@13.motion(2657526990, 18.000000, 78.000000)
      [3237220.717] wl_pointer@13.motion(2657527009, 21.000000, 77.000000)
      [3237220.771] wl_pointer@13.motion(2657527009, 22.000000, 77.000000)
      [3237220.787] wl_pointer@13.motion(2657527009, 24.000000, 77.000000)
      [3237239.884] wl_pointer@13.motion(2657527028, 25.000000, 77.000000)
      [3237239.933] wl_pointer@13.motion(2657527028, 26.000000, 77.000000)
      [3237259.208] wl_pointer@13.motion(2657527047, 27.000000, 77.000000)
      [3237259.318] wl_pointer@13.motion(2657527048, 29.000000, 77.000000)
      [3237278.303] wl_pointer@13.motion(2657527067, 30.000000, 77.000000)
      [3237278.365] wl_pointer@13.motion(2657527067, 32.000000, 78.000000)
      [3237278.386] wl_pointer@13.motion(2657527067, 34.000000, 78.000000)
      [3237297.506] wl_pointer@13.motion(2657527086, 35.000000, 78.000000)
      [3237297.594] wl_pointer@13.motion(2657527086, 36.000000, 78.000000)
      [3237316.711] wl_pointer@13.motion(2657527105, 38.000000, 79.000000)
      [3237316.802] wl_pointer@13.motion(2657527105, 39.000000, 80.000000)
      [3237316.821] wl_pointer@13.motion(2657527105, 41.000000, 81.000000)
      [3237380.228] wl_pointer@13.motion(2657527169, 42.000000, 81.000000)
      [3237389.349] wl_pointer@13.motion(2657527178, 44.000000, 81.000000)
      [3237408.589] wl_pointer@13.motion(2657527197, 45.000000, 81.000000)
      [3237408.691] wl_pointer@13.motion(2657527197, 46.000000, 81.000000)
      [3237580.309] wl_data_device@9.selection(nil)
      [3237580.339] wl_pointer@13.button(92, 2657527369, 272, 1)
      [3237580.370]  -> wl_pointer@13.set_cursor(90, wl_surface@14, 5, 5)
      [3237580.385]  -> wl_surface@14.attach(wl_buffer@19, 0, 0)
      [3237580.393]  -> wl_surface@14.damage(0, 0, 32, 32)
      [3237580.405]  -> wl_surface@14.commit()
      [3237581.758]  -> wl_shm_pool@11.create_buffer(new id wl_buffer@22, 888832, 32, 32, 128, 0)
      [3237581.789]  -> wl_pointer@13.set_cursor(90, wl_surface@14, 12, 11)
      [3237581.798]  -> wl_surface@14.attach(wl_buffer@22, 0, 0)
      [3237581.809]  -> wl_surface@14.damage(0, 0, 32, 32)
      [3237581.821]  -> wl_surface@14.commit()
      [3237581.833]  -> wl_shm_pool@11.create_buffer(new id wl_buffer@24, 1642496, 32, 32, 128, 0)
      [3237581.848]  -> wl_pointer@13.set_cursor(90, wl_surface@14, 16, 16)
      [3237581.857]  -> wl_surface@14.attach(wl_buffer@24, 0, 0)
      [3237581.865]  -> wl_surface@14.damage(0, 0, 32, 32)
      [3237581.875]  -> wl_surface@14.commit()
      [3237581.894]  -> wl_compositor@4.create_surface(new id wl_surface@25)
      [3237581.913]  -> wl_shell@12.get_shell_surface(new id wl_shell_surface@26, wl_surface@25)
      [3237581.934]  -> wl_shell_surface@26.set_title("")
      [3237581.945]  -> wl_shell_surface@26.set_class("draggableicons")
      [3237581.951]  -> wl_surface@25.set_buffer_scale(1)
      [3237581.958]  -> wl_surface@25.set_buffer_transform(0)
      [3237581.962]  -> wl_surface@25.commit()
      [3237581.979]  -> wl_pointer@13.set_cursor(90, wl_surface@14, 16, 16)
      [3237581.999]  -> wl_surface@14.attach(wl_buffer@24, 0, 0)
      [3237582.017]  -> wl_surface@14.damage(0, 0, 32, 32)
      [3237582.027]  -> wl_surface@14.commit()
      [3237582.032]  -> wl_shell_surface@26.set_transient(wl_surface@16, 24, 51, 1)
      [3237582.052]  -> wl_data_device_manager@6.create_data_source(new id wl_data_source@27)
      [3237582.070]  -> wl_data_source@27.offer("application/x-dnditemdata")
      [3237582.092]  -> wl_data_device@9.start_drag(wl_data_source@27, wl_surface@16, wl_surface@25, 92)
      [3237582.271]  -> wl_surface@16.frame(new id wl_callback@28)
      [3237582.280]  -> wl_surface@16.attach(wl_buffer@21, 0, 0)
      [3237582.301]  -> wl_surface@16.frame(new id wl_callback@29)
      [3237582.306]  -> wl_surface@16.damage(24, 51, 75, 54)
      [3237582.317]  -> wl_surface@16.commit()
      [3237582.358]  -> wl_shm@7.create_pool(new id wl_shm_pool@30, fd 8, 16200)
      [3237582.365]  -> wl_shm_pool@30.create_buffer(new id wl_buffer@31, 0, 75, 54, 300, 0)
      [3237582.411]  -> wl_surface@25.frame(new id wl_callback@32)
      [3237582.419]  -> wl_surface@25.attach(wl_buffer@31, 0, 0)
      [3237582.427]  -> wl_surface@25.frame(new id wl_callback@33)
      [3237582.432]  -> wl_surface@25.damage(0, 0, 75, 54)
      [3237582.443]  -> wl_surface@25.commit()
      [3237582.459] wl_display@1.error(wl_data_device@9, 0, "Cannot assign role wl_data_device-icon to wl_surface@25, already has role wl_shell_surface
      ")
      wl_data_device@9: error 0: Cannot assign role wl_data_device-icon to wl_surface@25, already has role wl_shell_surface
      
      The Wayland connection experienced a fatal error (Protocol error)
      QMutex: destroying locked mutex
      

      Update [1]: Switched to a simpler example

      Update [2]: This regression was introduced by: https://codereview.qt-project.org/#/c/148861/

      Which disabled Qt::BypassWindowManagerHint for Wayland unless the environment variable QT_WAYLAND_USE_BYPASSWINDOWMANAGERHINT was set. The problem with this, however, is that qtwayland uses BypassWindowManagerHint internally in order to prevent a QWaylandWindow from creating a shell surface for the window.

      Attachments

        Activity

          People

            johanhelsing Johan Helsing
            johanhelsing Johan Helsing
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: