1. 09 Jul, 2021 1 commit
  2. 01 Sep, 2020 4 commits
    • Roman Gilg's avatar
      xwayland: Replace need_rotate boolean with simple check on xdg-output · 727df0a7
      Roman Gilg authored and Olivier Fourdan's avatar Olivier Fourdan committed
      
      
      The need_rotate variable is only used once anymore and had semantics which lead
      to errors in the past. In particular when negated we are dealing with a double
      negation.
      
      The variable gets replaced with a simple check on the xdg-output directly.
      Signed-off-by: Roman Gilg's avatarRoman Gilg <subdiff@gmail.com>
      727df0a7
    • Roman Gilg's avatar
      Revert "xserver: Fix a typo" · da791ed9
      Roman Gilg authored and Olivier Fourdan's avatar Olivier Fourdan committed
      This reverts commit 427f8bc0.
      
      When receiving an output update for the mode size we need to rotate the stored
      width and height values if and only if we have an xdg-output for this output
      since in this case the stored values describe the output's size in logical
      space, i.e. rotated.
      
      The here reverted commit made a code change with which we would not rotate though
      when an xdg-output was available since in this case the need_rotate variable was
      set to False what caused in the check afterwards the first branch to execute.
      da791ed9
    • Roman Gilg's avatar
      xwayland: Switch width and height argument order · 92f4a9ad
      Roman Gilg authored and Olivier Fourdan's avatar Olivier Fourdan committed
      
      
      That is just a small style-change to the output_get_new_size function. The
      function before did take first the height and then the width argument, what
      is unusual since resolutions are normally named the other way around, for
      example 1920x1080. Also compare the update_screen_size function.
      
      Therefore change the order of arguments for output_get_new_size.
      Signed-off-by: Roman Gilg's avatarRoman Gilg <subdiff@gmail.com>
      92f4a9ad
    • Roman Gilg's avatar
      xwayland: simplify output_get_new_size function · 1805383d
      Roman Gilg authored and Olivier Fourdan's avatar Olivier Fourdan committed
      
      
      We can just read out the xdg_output field of the provided xwl_output to check
      if a rotation is necessary or not.
      
      This makes the function easier to understand. Additionally some documentation
      is added.
      Signed-off-by: Roman Gilg's avatarRoman Gilg <subdiff@gmail.com>
      1805383d
  3. 03 Jul, 2020 1 commit
    • Olivier Fourdan's avatar
      xwayland: Use a fixed DPI value for core protocol · b0413b6e
      Olivier Fourdan authored and Michel Dänzer's avatar Michel Dänzer committed
      
      
      The way Xwayland works (like all Wayland clients), it first queries the
      Wayland registry, set up all relevant protocols and then initializes its
      own structures.
      
      That means Xwayland will get the Wayland outputs from the Wayland
      compositor, compute the physical size of the combined outputs and set
      the corresponding Xwayland screen properties accordingly.
      
      Then it creates the X11 screen using fbScreenInit() but does so by using
      a default DPI value of 96. That value is used to set the physical size
      of the X11 screen, hence overriding the value computed from the actual
      physical size provided by the Wayland compositor.
      
      As a result, the DPI computed by tools such as xdpyinfo will always be
      96 regardless of the actual screen size and resolution.
      
      However, if the Wayland outputs get reconfigured, or new outputs added,
      or existing outputs removed, Xwayland will recompute and update the
      physical size of the screen, leading to an unexpected change of DPI.
      
      To avoid that discrepancy, use a fixed size DPI (defaults to 96, and can
      be set using the standard command lime option "-dpi") and compute a
      physical screen size to match that DPI setting.
      
      Note that only affects legacy core protocols, X11 clients can still get
      the actual physical output size as reported by the Wayland compositor
      using the RandR protocol, which also allows for the size to be 0 if the
      size is unknown or meaningless.
      Signed-off-by: Olivier Fourdan's avatarOlivier Fourdan <ofourdan@redhat.com>
      Reviewed-by: Simon Ser's avatarSimon Ser <contact@emersion.fr>
      Closes: xorg/xserver#731
      b0413b6e
  4. 23 Feb, 2020 2 commits
    • Hans de Goede's avatar
      xwayland: Remove unnecessary xwl_window_is_toplevel() check from... · d4faab87
      Hans de Goede authored
      
      xwayland: Remove unnecessary xwl_window_is_toplevel() check from xwl_output_set_window_randr_emu_props()
      
      Since the recent fix to call xwl_output_set_window_randr_emu_props() from
      ensure_surface_for_window(), it is now only called on a toplevel window,
      so the is-toplevel check is not necessary for the
      xwl_output_set_window_randr_emu_props() case.
      
      This commit moves the check to xwl_output_set_randr_emu_prop_callback()
      so that we only do it when we are walking over all Windows of a client
      to update the property on a change of the emulated resolution.
      Acked-by: Olivier Fourdan's avatarOlivier Fourdan <ofourdan@redhat.com>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      d4faab87
    • Hans de Goede's avatar
      xwayland: Fix emulated modes not being removed when screen rotation is used · 88342353
      Hans de Goede authored
      
      
      The code building the mode-list does the following to deal with screen
      rotation:
      
          if (need_rotate || xwl_output->rotation & (RR_Rotate_0 | RR_Rotate_180)) {
              mode_width = xwl_output->width;
              mode_height = xwl_output->height;
          } else {
              mode_width = xwl_output->height;
              mode_height = xwl_output->width;
          }
      
      This means we need to do something similar in xwl_output_set_emulated_mode()
      to determine if the mode being set is the actual (not-emulated) output mode
      and we this should remove any emulated modes set by the client.
      
      All callers of xwl_output_set_emulated_mode always pass a mode pointer
      to a member of xwl_output->randr_output->modes, so we do not need to
      duplicate this code, instead we can simply check that the passed in mode
      is modes[0] which always is the actual output mode.
      Acked-by: Olivier Fourdan's avatarOlivier Fourdan <ofourdan@redhat.com>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      88342353
  5. 20 Dec, 2019 5 commits
  6. 16 Oct, 2019 1 commit
  7. 12 Oct, 2019 5 commits
    • Hans de Goede's avatar
      xwayland: Set _XWAYLAND_RANDR_EMU_MONITOR_RECTS property for resolution emulation · 5315f988
      Hans de Goede authored
      
      
      Apps using randr to change the resolution when going fullscreen, in
      combination with _NET_WM_STATE_FULLSCREEN to tell the window-manager (WM)
      to make their window fullscreen, expect the WM to give the fullscreen window
      the size of the emulated resolution as would happen when run under Xorg (*).
      
      We need the WM to emulate this behavior for these apps to work correctly,
      with Xwaylands resolution change emulation. For the WM to emulate this,
      it needs to know about the emulated resolution for the Windows owning
      client for each monitor.
      
      This commit adds a _XWAYLAND_RANDR_EMU_MONITOR_RECTS property, which
      contains 4 Cardinals (32 bit integers) per monitor with resolution
      emulation info. Window-managers can use this to get the emulated
      resolution for the client and size the window correctly.
      
      *) Since under Xorg the resolution will actually be changed and after that
      going fullscreen through NET_WM_STATE_FULLSCREEN will size the window to
      be equal to the new resolution.
      Reviewed-by: Olivier Fourdan's avatarOlivier Fourdan <ofourdan@redhat.com>
      Acked-by: Michel Dänzer's avatarMichel Dänzer <mdaenzer@redhat.com>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      5315f988
    • Hans de Goede's avatar
      xwayland: Add support for randr-resolution change emulation using viewport · d99b9ff0
      Hans de Goede authored
      
      
      Add support for per client randr-resolution change emulation using viewport,
      for apps which want to change the resolution when going fullscreen.
      
      Partly based on earlier work on this by Robert Mader <robert.mader@posteo.de>
      
      Note SDL2 and SFML do not restore randr resolution when going from
      fullscreen -> windowed, I believe this is caused by us still reporting the
      desktop resolution when they query the resolution.  This is not a problem
      because when windowed the toplevel window size includes the window-decorations
      so it never matches the emulated resolution.
      
      One exception would be the window being resizable in Windowed mode and the
      user resizing the window so that including decorations it matches the
      emulated resolution *and* the window being at pos 0x0. But this is an
      extreme corner case. Still I will submit patches upstream to SDL2
      and SFML to always restore the desktop resolution under Xwayland,
      disabling resolution emulation all together when going windowed.
      Reviewed-by: Olivier Fourdan's avatarOlivier Fourdan <ofourdan@redhat.com>
      Acked-by: Michel Dänzer's avatarMichel Dänzer <mdaenzer@redhat.com>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      d99b9ff0
    • Hans de Goede's avatar
      xwayland: Add support for storing per client per output emulated resolution · aca0a588
      Hans de Goede authored
      
      
      Add support for storing per output randr/vidmode emulated resolution
      into the per client data.
      
      Since we do not have a free/delete callback for the client this uses
      a simple static array. The entries are tied to a specific output by the
      server_output_id, with a server_output_id of 0 indicating a free slot
      (0 is the "None" Wayland object id).
      
      Note that even if we were to store this in a linked list, we would still
      need the server_output_id as this is *per client* *per output*.
      
      This is a preparation patch for adding randr/vidmode resolution
      change emulation.
      Reviewed-by: Olivier Fourdan's avatarOlivier Fourdan <ofourdan@redhat.com>
      Acked-by: Michel Dänzer's avatarMichel Dänzer <mdaenzer@redhat.com>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      aca0a588
    • Robert Mader's avatar
      xwayland: Use RandR 1.2 interface (rev 2) · e89872f5
      Robert Mader authored
      
      
      This adds the RandR 1.2 interface to xwayland and allows modes
      advertised by the compositor to be set in an undistructive manner.
      
      With this patch, applications that try to set the resolution will usually
      succeed and work while other apps using the same xwayland
      instance are not affected at all.
      
      The RandR 1.2 interface will be needed to implement fake-mode-setting and
      already makes applications work much cleaner and predictive when a mode
      was set.
      
      [hdegoede@redhat.com: Make crtc_set only succeed if the mode matches
       the desktop resolution]
      Reviewed-by: Olivier Fourdan's avatarOlivier Fourdan <ofourdan@redhat.com>
      Acked-by: Michel Dänzer's avatarMichel Dänzer <mdaenzer@redhat.com>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      e89872f5
    • Hans de Goede's avatar
      xwayland: Add fake output modes to xrandr output mode lists · 0d656d79
      Hans de Goede authored
      
      
      This is a preparation patch for adding support for apps which want to
      change the resolution when they go fullscreen because they are hardcoded
      to render at a specific resolution, e.g. 640x480.
      
      Follow up patches will fake the mode-switch these apps want by using
      WPviewport to scale there pixmap to cover the entire output.
      Reviewed-by: Olivier Fourdan's avatarOlivier Fourdan <ofourdan@redhat.com>
      Acked-by: Michel Dänzer's avatarMichel Dänzer <mdaenzer@redhat.com>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      0d656d79
  8. 05 Sep, 2019 1 commit
  9. 16 Jul, 2019 1 commit
  10. 12 Jul, 2019 1 commit
  11. 10 Sep, 2018 1 commit
    • Lionel Landwerlin's avatar
      xwayland: fix access to invalid pointer · 53ce2ba0
      Lionel Landwerlin authored and Adam Jackson's avatar Adam Jackson committed
      
      
      xwl_output->randr_crtc is used in the update_screen_size() function :
      
      ==5331== Invalid read of size 4
      ==5331==    at 0x15263D: update_screen_size (xwayland-output.c:190)
      ==5331==    by 0x152C48: xwl_output_remove (xwayland-output.c:413)
      ==5331==    by 0x6570FCD: ffi_call_unix64 (in /usr/lib/x86_64-linux-gnu/libffi.so.6.0.4)
      ==5331==    by 0x657093E: ffi_call (in /usr/lib/x86_64-linux-gnu/libffi.so.6.0.4)
      ==5331==    by 0x4DDB183: ??? (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0)
      ==5331==    by 0x4DD79D8: ??? (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0)
      ==5331==    by 0x4DD8EA3: wl_display_dispatch_queue_pending (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0)
      ==5331==    by 0x14BCCA: xwl_read_events (xwayland.c:814)
      ==5331==    by 0x2AC0D0: ospoll_wait (ospoll.c:651)
      ==5331==    by 0x2A5322: WaitForSomething (WaitFor.c:208)
      ==5331==    by 0x27574B: Dispatch (dispatch.c:421)
      ==5331==    by 0x279945: dix_main (main.c:276)
      ==5331==  Address 0x1aacb5f4 is 36 bytes inside a block of size 154 free'd
      ==5331==    at 0x48369EB: free (vg_replace_malloc.c:530)
      ==5331==    by 0x1F8AE8: RROutputDestroyResource (rroutput.c:421)
      ==5331==    by 0x29A2AC: doFreeResource (resource.c:880)
      ==5331==    by 0x29AE5B: FreeResource (resource.c:910)
      ==5331==    by 0x152BE0: xwl_output_remove (xwayland-output.c:408)
      ==5331==    by 0x6570FCD: ffi_call_unix64 (in /usr/lib/x86_64-linux-gnu/libffi.so.6.0.4)
      ==5331==    by 0x657093E: ffi_call (in /usr/lib/x86_64-linux-gnu/libffi.so.6.0.4)
      ==5331==    by 0x4DDB183: ??? (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0)
      ==5331==    by 0x4DD79D8: ??? (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0)
      ==5331==    by 0x4DD8EA3: wl_display_dispatch_queue_pending (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0)
      ==5331==    by 0x14BCCA: xwl_read_events (xwayland.c:814)
      ==5331==    by 0x2AC0D0: ospoll_wait (ospoll.c:651)
      ==5331==  Block was alloc'd at
      ==5331==    at 0x48357BF: malloc (vg_replace_malloc.c:299)
      ==5331==    by 0x1F93E0: RROutputCreate (rroutput.c:83)
      ==5331==    by 0x152A75: xwl_output_create (xwayland-output.c:361)
      ==5331==    by 0x14BE59: registry_global (xwayland.c:764)
      ==5331==    by 0x6570FCD: ffi_call_unix64 (in /usr/lib/x86_64-linux-gnu/libffi.so.6.0.4)
      ==5331==    by 0x657093E: ffi_call (in /usr/lib/x86_64-linux-gnu/libffi.so.6.0.4)
      ==5331==    by 0x4DDB183: ??? (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0)
      ==5331==    by 0x4DD79D8: ??? (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0)
      ==5331==    by 0x4DD8EA3: wl_display_dispatch_queue_pending (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0)
      ==5331==    by 0x14BCCA: xwl_read_events (xwayland.c:814)
      ==5331==    by 0x2AC0D0: ospoll_wait (ospoll.c:651)
      ==5331==    by 0x2A5322: WaitForSomething (WaitFor.c:208)
      Signed-off-by: Lionel Landwerlin's avatarLionel Landwerlin <lionel.g.landwerlin@intel.com>
      Reviewed-by: Daniel Stone's avatarDaniel Stone <daniels@collabora.com>
      53ce2ba0
  12. 25 Jul, 2018 1 commit
  13. 21 Jun, 2018 1 commit
  14. 20 Feb, 2018 1 commit
    • Jason Ekstrand's avatar
      xwayland: Fix backwards need_rotate logic (v2) · a0545326
      Jason Ekstrand authored and Adam Jackson's avatar Adam Jackson committed
      
      
      When xdg_output support was added to Xwayland, need_rotate parameter was
      added to output_get_new_size where true gave you the old pre-xdg_output
      behavior and false gave the new behavior.  Unfortunately, the two places
      where this is called, need_rotate was set backwards.  This caused input
      get clampped to the wrong dimensions.  Also, the logic for deciding
      whether or not to flip was wrong because, if need_rotate was false, it
      would always flip which is not what you want.
      
      v2 (Daniel Stone):
       - Fix output_get_new_size so that it doesn't flip the dimensions when
         need_rotate is false.
      Signed-off-by: Jason Ekstrand's avatarJason Ekstrand <jason@jlekstrand.net>
      Reviewed-by: Daniel Stone's avatarDaniel Stone <daniels@collabora.com>
      Reviewed-by: Olivier Fourdan's avatarOlivier Fourdan <ofourdan@redhat.com>
      a0545326
  15. 24 Jan, 2018 1 commit
    • Olivier Fourdan's avatar
      xwayland: Add optional xdg-output support · da8de2a7
      Olivier Fourdan authored and Adam Jackson's avatar Adam Jackson committed
      
      
      The xdg-output protocol aims at describing outputs in way which is
      more in line with the concept of an output on desktop oriented systems.
      
      For now it just features the position and logical size which describe
      the output position and size in the global compositor space.
      
      This is however much useful for Xwayland to advertise the output size
      and position to X11 clients which need this to configure their surfaces
      in the global compositor space as the compositor may apply a different
      scale from what is advertised by the output scaling property (to achieve
      fractional scaling, for example).
      
      This was added in wayland-protocols 1.10.
      Reviewed-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
      Signed-off-by: Olivier Fourdan's avatarOlivier Fourdan <ofourdan@redhat.com>
      da8de2a7
  16. 07 Jun, 2017 1 commit
  17. 18 Apr, 2017 1 commit
  18. 08 Feb, 2017 2 commits
    • Olivier Fourdan's avatar
      xwayland: Apply output rotation for screen size · 058809c4
      Olivier Fourdan authored and Adam Jackson's avatar Adam Jackson committed
      Previously, we would swap the width/height of the Xwayland output based
      on the output rotation, so that the overall screen size would match the
      actual rotation of each output.
      
      Problem is the RandR's ConstrainCursorHarder() handler will also apply
      the output rotation, meaning that when the output is rotated, the
      pointer will be constrained within the wrong dimension.
      
      Moreover, XRandR assumes the original output width/height are unchanged
      when the output is rotated, so by changing the Xwayland output width and
      height based on rotation, Xwayland causes XRandr to report the wrong
      output sizes (an output of size 1024x768 rotated left or right should
      remain 1024x768, not 768x1024).
      
      So to avoid this issue and keep things consistent between Wayland and
      Xwayland outputs, leave the actual width/height unchanged but apply the
      rotation when computing the screen size. This fixes both the output size
      being wrong in "xrandr -q" and the pointer being constrained in the
      wrong dimension with rotated with weston.
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99663
      
      Signed-off-by: Olivier Fourdan's avatarOlivier Fourdan <ofourdan@redhat.com>
      Reviewed-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
      058809c4
    • Olivier Fourdan's avatar
      xwayland: CRTC should support all rotations · afeace27
      Olivier Fourdan authored and Adam Jackson's avatar Adam Jackson committed
      If the Wayland compositor sets a rotation on the output, Xwayland
      translates the transformation as an xrandr rotation for the given
      output.
      
      However, if the rotation is not supported by the CRTC, this is not
      a valid setup and xrandr queries will fail.
      
      Pretend we support all rotations and reflections so that the
      configuration remains a valid xrandr setup.
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99663
      
      Signed-off-by: Olivier Fourdan's avatarOlivier Fourdan <ofourdan@redhat.com>
      Reviewed-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
      afeace27
  19. 07 Feb, 2017 1 commit
  20. 25 Nov, 2016 1 commit
  21. 15 Aug, 2016 1 commit
    • Olivier Fourdan's avatar
      xwayland: Avoid double free of RRCrtc and RROutput · 4cbf1fb1
      Olivier Fourdan authored and Adam Jackson's avatar Adam Jackson committed
      
      
      At shutdown, the Xserver will free all its resources which includes the
      RRCrtc and RROutput created.
      
      Xwayland would do the same in its xwl_output_destroy() called from
      xwl_close_screen(), leading to a double free of existing RRCrtc
      RROutput:
      
       Invalid read of size 4
          at 0x4CDA10: RRCrtcDestroy (rrcrtc.c:689)
          by 0x426E75: xwl_output_destroy (xwayland-output.c:301)
          by 0x424144: xwl_close_screen (xwayland.c:117)
          by 0x460E17: CursorCloseScreen (cursor.c:187)
          by 0x4EB5A3: AnimCurCloseScreen (animcur.c:106)
          by 0x4EF431: present_close_screen (present_screen.c:64)
          by 0x556D40: dix_main (main.c:354)
          by 0x6F0D290: (below main) (in /usr/lib/libc-2.24.so)
        Address 0xbb1fc30 is 0 bytes inside a block of size 728 free'd
          at 0x4C2BDB0: free (in
      /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
          by 0x4CCE5F: RRCrtcDestroyResource (rrcrtc.c:719)
          by 0x577541: doFreeResource (resource.c:895)
          by 0x5787B5: FreeClientResources (resource.c:1161)
          by 0x578862: FreeAllResources (resource.c:1176)
          by 0x556C54: dix_main (main.c:323)
          by 0x6F0D290: (below main) (in /usr/lib/libc-2.24.so)
        Block was alloc'd at
          at 0x4C2CA6A: calloc (in
      /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
          by 0x4CC6DB: RRCrtcCreate (rrcrtc.c:76)
          by 0x426D1C: xwl_output_create (xwayland-output.c:264)
          by 0x4232EC: registry_global (xwayland.c:431)
          by 0x76CB1C7: ffi_call_unix64 (in /usr/lib/libffi.so.6.0.4)
          by 0x76CAC29: ffi_call (in /usr/lib/libffi.so.6.0.4)
          by 0x556CEFD: wl_closure_invoke (connection.c:935)
          by 0x5569CBF: dispatch_event.isra.4 (wayland-client.c:1310)
          by 0x556AF13: dispatch_queue (wayland-client.c:1456)
          by 0x556AF13: wl_display_dispatch_queue_pending
      (wayland-client.c:1698)
          by 0x556B33A: wl_display_roundtrip_queue (wayland-client.c:1121)
          by 0x42371C: xwl_screen_init (xwayland.c:631)
          by 0x552F60: AddScreen (dispatch.c:3864)
      
      And:
      
       Invalid read of size 4
          at 0x522890: RROutputDestroy (rroutput.c:348)
          by 0x42684E: xwl_output_destroy (xwayland-output.c:302)
          by 0x423CF4: xwl_close_screen (xwayland.c:118)
          by 0x4B6377: CursorCloseScreen (cursor.c:187)
          by 0x539503: AnimCurCloseScreen (animcur.c:106)
          by 0x53D081: present_close_screen (present_screen.c:64)
          by 0x43DBF0: dix_main (main.c:354)
          by 0x7068730: (below main) (libc-start.c:289)
        Address 0xc403190 is 0 bytes inside a block of size 154 free'd
          at 0x4C2CD5A: free (vg_replace_malloc.c:530)
          by 0x521DF3: RROutputDestroyResource (rroutput.c:389)
          by 0x45DA61: doFreeResource (resource.c:895)
          by 0x45ECFD: FreeClientResources (resource.c:1161)
          by 0x45EDC2: FreeAllResources (resource.c:1176)
          by 0x43DB04: dix_main (main.c:323)
          by 0x7068730: (below main) (libc-start.c:289)
        Block was alloc'd at
          at 0x4C2BBAD: malloc (vg_replace_malloc.c:299)
          by 0x52206B: RROutputCreate (rroutput.c:84)
          by 0x426763: xwl_output_create (xwayland-output.c:270)
          by 0x422EDC: registry_global (xwayland.c:432)
          by 0x740FC57: ffi_call_unix64 (unix64.S:76)
          by 0x740F6B9: ffi_call (ffi64.c:525)
          by 0x5495A9D: wl_closure_invoke (connection.c:949)
          by 0x549283F: dispatch_event.isra.4 (wayland-client.c:1274)
          by 0x5493A13: dispatch_queue (wayland-client.c:1420)
          by 0x5493A13: wl_display_dispatch_queue_pending
      (wayland-client.c:1662)
          by 0x5493D2E: wl_display_roundtrip_queue (wayland-client.c:1085)
          by 0x4232EC: xwl_screen_init (xwayland.c:632)
          by 0x439F50: AddScreen (dispatch.c:3864)
      
      Split xwl_output_destroy() into xwl_output_destroy() which frees the
      wl_output and the xwl_output structure, and xwl_output_remove() which
      does the RRCrtcDestroy() and RROutputDestroy() and call the latter only
      when an output is effectively removed.
      
      An additional benefit, on top of avoiding a double free, is to avoid
      updating the screen size at shutdown.
      Signed-off-by: Olivier Fourdan's avatarOlivier Fourdan <ofourdan@redhat.com>
      Reviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
      4cbf1fb1
  22. 15 Jul, 2016 1 commit
  23. 20 Jun, 2016 1 commit
  24. 01 Mar, 2016 1 commit
    • Olivier Fourdan's avatar
      xwayland: fix a crash on output removal · 2116f03b
      Olivier Fourdan authored and Adam Jackson's avatar Adam Jackson committed
      
      
      On output removal, the CRTC that was added in xwl_output_create()
      is not removed in xwl_output_destroy() and would cause a segmentation
      fault later on in ProcRRGetMonitors():
      
        (EE) Segmentation fault at address 0x100000001
        (EE)
        (EE) 10: ? (?+0x29) [0x29]
        (EE) 9: /usr/bin/Xwayland (_start+0x29) [0x423299]
        (EE) 8: /lib64/libc.so.6 (__libc_start_main+0xf0) [0x7fdd80e7f580]
        (EE) 7: /usr/bin/Xwayland (dix_main+0x3b3) [0x544ef3]
        (EE) 6: /usr/bin/Xwayland (Dispatch+0x31e) [0x54109e]
        (EE) 5: /usr/bin/Xwayland (ProcRRGetMonitors+0x9b) [0x4ca18b]
        (EE) 4: /usr/bin/Xwayland (RRMonitorMakeList+0x269) [0x4c9ba9]
        (EE) 3: /usr/bin/Xwayland (RRMonitorSetFromServer+0x118) [0x4c9198]
        (EE) 2: /usr/bin/Xwayland (MakeAtom+0x30) [0x530710]
        (EE) 1: /lib64/libc.so.6 (__restore_rt+0x0) [0x7fdd80e93b1f]
        (EE) 0: /usr/bin/Xwayland (OsSigHandler+0x29) [0x5792d9]
      
      Remove the output CRTC in xwl_output_destroy() to avoid the crash.
      Signed-off-by: Olivier Fourdan's avatarOlivier Fourdan <ofourdan@redhat.com>
      Reviewed-by: Daniel Stone's avatarDaniel Stone <daniels@collabora.com>
      2116f03b
  25. 22 Feb, 2016 1 commit
    • Daniel Stone's avatar
      dix: Add hybrid full-size/empty-clip mode to SetRootClip · e957a2e5
      Daniel Stone authored and Adam Jackson's avatar Adam Jackson committed
      216bdbc7
      
       removed the SetRootClip call in the XWayland output-hotplug
      handler when running rootless (e.g. as a part of Weston/Mutter), since
      the root window has no storage, so generating exposures will result in
      writes to invalid memory.
      
      Unfortunately, preventing the segfault also breaks sprite confinement.
      SetRootClip updates winSize and borderSize for the root window, which
      when combined with RRScreenSizeChanged calling ScreenRestructured,
      generates a new sprite-confinment area to update it to the whole screen.
      
      Removing this call results in the window geometry being reported
      correctly, but winSize/borderSize never changing from their values at
      startup, i.e. out of sync with the root window geometry / screen
      information in the connection info / XRandR.
      
      This patch introduces a hybrid mode, where we update winSize and
      borderSize for the root window, enabling sprite confinement to work
      correctly, but keep the clip emptied so exposures are never generated.
      Signed-off-by: Daniel Stone's avatarDaniel Stone <daniels@collabora.com>
      Tested-by: Olivier Fourdan's avatarOlivier Fourdan <ofourdan@redhat.com>
      Reviewed-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
      e957a2e5
  26. 01 Dec, 2015 1 commit
  27. 30 Nov, 2015 1 commit