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

Menu location is offset depending on xdg_output.logical_layout in sway

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 5.15.0
    • Fix Version/s: None
    • Component/s: GUI: Menus, QPA: Wayland
    • Labels:
    • Environment:
      archlinux, with sway as a wayland compositor.
    • Platform/s:
      Linux/Wayland

      Description

      When I use a qt application and try to open a menu, the position of the menu is offset by an amount equal to the offset of the display output the parent window is on. Specifically, the position returned by the `logical_position` of the `zxdg_output_v1`.

       

      Experimenting with this it seems that values passed to `set_anchor_rect` for the popup positioner are always the max of the logical_position and the value it actually should be. So if the logical_position is less than 20 for the file menu in wireshark, it is set to 20, but if it is higher than that, the y value is set to the y value of the logical_position.

       

      Here's some sample output from testing with wireshark (see the attached screenshot).

       

      [3142540.511] wl_output@16.geometry(0, 0, 480, 270, 2, "Samsung Electric Company", "S22C300", 0)
      [3142540.544] wl_output@16.mode(1, 1920, 1080, 60000)
      [3142540.563] wl_output@16.scale(1)
      [3142540.570] wl_output@16.done()
      [3142540.585] zxdg_output_v1@17.name("HDMI-A-1")
      [3142540.593] zxdg_output_v1@17.description("Samsung Electric Company S22C300 0x00007F35 (HDMI-A-1)")
      [3142540.601] zxdg_output_v1@17.logical_position(0, 100)
      [3142540.612] zxdg_output_v1@17.logical_size(1920, 1080)
      [3142540.623] wl_output@16.done()
      

       

      and

       
      [3146385.715] -> wl_compositor@5.create_surface(new id wl_surface@46)
      [3146387.652] -> xdg_wm_base@24.get_xdg_surface(new id xdg_surface@36, wl_surface@46)
      [3146387.702] -> xdg_wm_base@24.create_positioner(new id xdg_positioner@35)
      [3146387.732] -> xdg_positioner@35.set_anchor_rect(6, 100, 1, 1)
      [3146387.788] -> xdg_positioner@35.set_anchor(5)
      [3146387.810] -> xdg_positioner@35.set_gravity(8)
      [3146387.832] -> xdg_positioner@35.set_size(341, 378)
      [3146387.867] -> xdg_surface@36.get_popup(new id xdg_popup@39, xdg_surface@26, xdg_positioner@35)
      [3146387.918] -> xdg_positioner@35.destroy()
      [3146387.938] -> xdg_popup@39.grab(wl_seat@12, 6060)
      

       

       

      See Also https://github.com/swaywm/sway/issues/5212#issuecomment-649367587

        Attachments

        1. KdeContextMenu1.png
          669 kB
          Jens N
        2. KdeContextMenu2.png
          733 kB
          Jens N
        3. shot-0.png
          61 kB
          Thayne McCombs

          Issue Links

          For Gerrit Dashboard: QTBUG-85297
          # Subject Branch Project Status CR V

            Activity

              People

              Assignee:
              liaqi Liang Qi
              Reporter:
              thayne Thayne McCombs
              Votes:
              18 Vote for this issue
              Watchers:
              31 Start watching this issue

                Dates

                Created:
                Updated:

                  Gerrit Reviews

                  There is 1 open Gerrit change