1. 23 Feb, 2020 9 commits
    • Hans de Goede's avatar
      xwayland: Call xwl_window_check_resolution_change_emulation() on newly created O-R windows · 4cfc2677
      Hans de Goede authored
      Some clients, which use vidmode to change the resolution when going fullscreen,
      create an override-redirect window and never trigger the screen->ResizeWindow
      callback we rely on to do the xwl_window_check_resolution_change_emulation().
      This causes us to not apply a viewport to them, causing the fullscreen window
      to not fill the entire monitor.
      This commit adds a call to xwl_window_check_resolution_change_emulation()
      at the end of ensure_surface_for_window() to fix this. Note that
      ensure_surface_for_window() exits early without creating an xwl_window
      for new windows which will not be backed by a wayland surface and which
      thus will not have an xwl_window.
      This fixes ClanLib-0.6.x and alleggl-4.4.x using apps not properly
      Acked-by: default avatarOlivier Fourdan <ofourdan@redhat.com>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
    • 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
          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: default avatarOlivier Fourdan <ofourdan@redhat.com>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
    • Hans de Goede's avatar
      xwayland: Also hook screen's MoveWindow method · 10df0437
      Hans de Goede authored
      Not only hook the ResizeWindow method of the screen (which really is
      MoveAndResize) but also hook the MoveWindow method for checking if we
      need to setup a viewport for resolution change emulation.
      Our resolution change emulation check if the windows origin matches
      the monitors origin and the windows origin can also be changed by just
      a move without being resized.
      Also checking on a move becomes esp. important when we move to checking
      on changes to the top-level non-window-manager client (X11)Window instead
      of on changes to the xwl_window later on in this patch series.
      Acked-by: default avatarOlivier Fourdan <ofourdan@redhat.com>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
    • Hans de Goede's avatar
      xwayland: Also check resolution-change-emulation when the xwl_window itself moves · 4fc10746
      Hans de Goede authored
      The recent change to use the top-level non-window-manager Window drawable
      coordinates from xwl_window_check_resolution_change_emulation() in
      combination with only calling it on a resize when the top-level window
      is moved breaks things with mutter/gnome-shell.
      When fullscreening a X11 window, mutter moves its window-decoration Window
      wrapping the top-level Window to the monitor's origin coordinates (e.g. 0x0)
      last. This updates the top-level's drawable coordinates, but as the
      actual MoveWindow is called on the wrapper Window and not on the toplevel
      we do not call xwl_window_check_resolution_change_emulation() and we never
      enable the viewport.
      This commit fixes this by also calling
      xwl_window_check_resolution_change_emulation() if the Window being moved
      is an xwl_window itself.
      Acked-by: default avatarOlivier Fourdan <ofourdan@redhat.com>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
    • Roman Gilg's avatar
      xwayland: Check emulation on client toplevel resize · 6d98f840
      Roman Gilg authored
      When a reparented window is resized directly check the emulation instead of
      doing this only when the window manager parent window is resized, what might
      never happen.
      For that to work we need to make sure that we compare the current size of the
      client toplevel when looking for an emulated mode.
      Changes by Hans de Goede:
      - Remove xwl_window x, y, width and height members as those are no longer used.
      - Add check for xwl_window_from_window() returning NULL.
      Signed-off-by: Roman Gilg's avatarRoman Gilg <subdiff@gmail.com>
      Acked-by: default avatarOlivier Fourdan <ofourdan@redhat.com>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
    • Roman Gilg's avatar
      xwayland: Make window_get_none_wm_owner return a Window instead of a Client · 060f1006
      Roman Gilg authored
      Make window_get_none_wm_owner return the first non-wm-window instead of the
      owner (client) of the first non-wm-window and rename it to
      window_get_client_toplevel to match its new behavior.
      This is a preparation patch for switching to using the drawable coordinates
      in xwl_window_should_enable_viewport()
      Changes by Hans de Goede:
      - Split this change out into a separate patch for easier reviewing
      - Rename window_get_none_wm_owner to window_get_client_toplevel to match
        its new behavior
      Signed-off-by: Roman Gilg's avatarRoman Gilg <subdiff@gmail.com>
      Acked-by: default avatarOlivier Fourdan <ofourdan@redhat.com>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
    • Roman Gilg's avatar
      xwayland: Recurse on finding the none-wm owner · a69f7fbb
      Roman Gilg authored
      An X11 window manager might add a chain of parent windows when reparenting to a
      decoration window.
      That is for example the case for KWin, which reparents client windows to one
      decoration and another wrapper parent window.
      Account for that by a recursion into the tree. For now assume as before that
      all X11 window managers reparent with one child only for these parent windows.
      Changes by Hans de Goede:
      - Move the xwl_window_is_toplevel() from a later patch in this series here
        as it really belongs together with these changes
      - Drop no longer necessary xwl_window argument from window_get_none_wm_owner
      Signed-off-by: Roman Gilg's avatarRoman Gilg <subdiff@gmail.com>
      Reviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
      Acked-by: default avatarOlivier Fourdan <ofourdan@redhat.com>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
    • Roman Gilg's avatar
      xwayland: Reuse viewport instead of recreating · 948e0287
      Roman Gilg authored
      When a viewport is already created we can reuse this object instead of
      destroying it and getting a new one for updating the source rectangle and
      destination size.
      Signed-off-by: Roman Gilg's avatarRoman Gilg <subdiff@gmail.com>
      Reviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
      Acked-by: default avatarOlivier Fourdan <ofourdan@redhat.com>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
    • Hans de Goede's avatar
      xwayland: Cache client-id for the window-manager client · ded89300
      Hans de Goede authored
      Instead of iterating over all clients which are listening for events on the
      root window and checking if the client we are dealing with is the one
      listening for SubstructureRedirectMask | ResizeRedirectMask events and thus
      is the window-manager, cache the client-id of the window-manager in
      xwl_screen and use that when checking if a client is the window-manager.
      Note that we cache and compare the client-id rather then the ClienPtr,
      this saves reading the ClientPtr from the global clients array when doing
      the comparison.
      Suggested-by: default avatarOlivier Fourdan <ofourdan@redhat.com>
      Acked-by: default avatarOlivier Fourdan <ofourdan@redhat.com>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
  2. 18 Feb, 2020 5 commits
  3. 14 Feb, 2020 1 commit
  4. 12 Feb, 2020 2 commits
    • Adam Jackson's avatar
      meson: Add support for libunwind · ee9f6e20
      Adam Jackson authored
    • Zoltán Böszörményi's avatar
      Fix modesetting device matching through kmsdev device path · 42aaf372
      Zoltán Böszörményi authored
      xf86platformProbeDev didn't check the device path, fix it.
      This is a problem when trying to set up a non-PCI device via
      explicit xorg.conf.d configuration.
      An USB DisplayLink device, being non-PCI was always set up
      as a GPU device assigned to screen 0 instead of a regular
      framebuffer, potentially having its own dedicated screen,
      despite such configuration as below. Only the relevant parts
      of the configuration are quoted, it's part of a larger context
      with an Intel chip that has 3 outputs:
      * DP1 connected to an LCD panel,
      * VGA1 connected to an external monitor,
      * HDMI1 unconnected and having no user visible connector
      Section "ServerFlags"
              Option          "AutoBindGPU" "false"
      Section "Device"
              Identifier      "Intel2"
              Driver          "intel"
              BusID           "PCI:0:2:0"
              Screen          2
              Option          "Monitor-HDMI1" "HDMI1"
              Option          "ZaphodHeads" "HDMI1"
      Section "Device"
              Identifier      "UDL"
              Driver          "modesetting"
              Option          "kmsdev" "/dev/dri/card0"
              #BusID          "usb:0:1.2:1.0"
              Option          "Monitor-DVI-I-1" "DVI-I-1"
              Option          "ShadowFB" "on"
              Option          "DoubleShadow" "on"
      Section "Screen"
              Identifier      "SCREEN2"
              Option          "AutoServerLayout" "on"
              Device          "UDL"
              GPUDevice       "Intel2"
              Monitor         "Monitor-DVI-I-1"
              SubSection      "Display"
                      Modes   "1024x768"
                      Depth   24
      Section "ServerLayout"
              Identifier      "LAYOUT"
              Option          "AutoServerLayout" "on"
              Screen          0 "SCREEN"
              Screen          1 "SCREEN1" RightOf "SCREEN"
              Screen          2 "SCREEN2" RightOf "SCREEN1"
      On the particular machine I was trying to set up an UDL device,
      I found the following structure was being used to match
      the device to a platform device while I was debugging the issue:
      xf86_platform_devices[0] == Intel, /dev/dri/card1, primary platform device
      xf86_platform_devices[1] == UDL, /dev/dri/card0
      devList[0] == "Intel0", ZaphodHeads: DP1
      devList[1] == "Intel1", ZaphodHeads: VGA1
      devList[2] == "UDL"
      devList[3] == "Intel2", ZaphodHeads: HDMI1 (intended GPU device to UDL)
      When xf86platformProbeDev() matched the UDL device, the BusID
      check failed in both cases of:
      * BusID "usb:0:1.2:1.0" was specified
      * Option "kmsdev" "/dev/dri/card0" was specified
      As a result, xf86platformProbeDev() went on to call probeSingleDevice()
      with xf86_platform_devices[0] and devList[2], resulting in the
      UDL device being set up as a GPU device assigned to the first screen
      instead of as a framebuffer on the third screen as the configuration
      Checking Option "kmsdev" in code code may be a layering violation.
      But the modesetting driver is actually part of the Xorg sources
      instead of being an external driver, so he "kmsdev" path knowledge
      may be used here.
      Signed-off-by: default avatarBöszörményi Zoltán <zboszor@pr.hu>
  5. 11 Feb, 2020 6 commits
  6. 10 Feb, 2020 2 commits
    • Michel Dänzer's avatar
      modesetting: Fix build with glamor disabled · 0cb9fa79
      Michel Dänzer authored
      Fixes: cb1b1e18
       "modesetting: Indirect the glamor API through
      Reviewed-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
    • Pekka Paalanen's avatar
      randr: auto-bind of GPU is a config change · bfb36a58
      Pekka Paalanen authored
      When a GPU is auto-bound adding more outputs to a screen, that needs to count
      as a configuration change on that screen so that a WM listening for
      RRScreenChangeNotify gets notified and handles it as a hotplug. This is
      particularly for cases where the outputs are already connected. Otherwise
      nothing might happen.
      Issue #909 describes a real world case where plugging in a DisplayLink dock
      with a monitor already connected is sometimes left inactive by GNOME. That
      issue is a race, and requires adding a sleep(5); as the first thing in
      NewGPUDeviceRequest() to reproduce reliably. With the sleep, the monitor in the
      dock will never activate automatically. Add this fix over the sleep, and the
      issue is gone.
      This fix was originally developed on a branch replicating Ubuntu 19.04 patch
      set based on xserver 1.20.4. Testing on master branch was impossible due to
      Closes: xorg/xserver#909
      Signed-off-by: Pekka Paalanen's avatarPekka Paalanen <pekka.paalanen@collabora.com>
      Reviewed-by: Michel Dänzer's avatarMichel Dänzer <mdaenzer@redhat.com>
  7. 09 Feb, 2020 1 commit
  8. 05 Feb, 2020 1 commit
  9. 31 Jan, 2020 1 commit
    • Michel Dänzer's avatar
      xwayland/glamor-gbm: Add xwl_glamor_gbm_post_damage hook · 9e85aa9c
      Michel Dänzer authored
      It flushes any pending drawing to the kernel, to make sure it'll be
      visible to the Wayland server.
      Without this, it was possible for the Wayland server to process surface
      commits before Xwayland got around to flushing the corresponding
      drawing, which could result in stale or even completely random window
      contents being visible.
      * Make EGL backend post_damage hook mandatory, don't check for NULL in
        xwl_glamor_post_damage. (Olivier Fourdan)
      Closes: xorg/xserver#951
      Reviewed-by: default avatarOlivier Fourdan <ofourdan@redhat.com>
  10. 30 Jan, 2020 1 commit
  11. 29 Jan, 2020 1 commit
  12. 28 Jan, 2020 5 commits
    • Michel Dänzer's avatar
      gitlab-ci: Enable -Werror in the meson build job · b6a5389e
      Michel Dänzer authored
      There are no warnings left, so let's prevent new ones from creeping
      back in.
    • Michel Dänzer's avatar
      tests/misc: Drop redundant screenInfo declaration · 794fd7e5
      Michel Dänzer authored
      GCC warned about it:
      ../test/misc.c:36:19: warning: redundant redeclaration of ‘screenInfo’ [-Wredundant-decls]
         36 | extern ScreenInfo screenInfo;
            |                   ^~~~~~~~~~
      In file included from ../test/misc.c:30:
      ../include/scrnintstr.h:688:29: note: previous declaration of ‘screenInfo’ was here
        688 | extern _X_EXPORT ScreenInfo screenInfo;
            |                             ^~~~~~~~~~
    • Michel Dänzer's avatar
      Xephyr: Cast "red" to char* for xcb_aux_parse_color · 42876044
      Michel Dänzer authored
      xcb_aux_parse_color takes a non-const pointer, even though it doesn't
      modify the string or take ownership of its memory.
      Avoids the following warning from GCC:
      ../hw/kdrive/ephyr/hostx.c: In function ‘hostx_init’:
      ../hw/kdrive/ephyr/hostx.c:683:30: warning: passing argument 1 of ‘xcb_aux_parse_color’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
        683 |     if (!xcb_aux_parse_color("red", &red, &green, &blue)) {
            |                              ^~~~~
      In file included from ../hw/kdrive/ephyr/hostx.c:50:
      /usr/include/xcb/xcb_aux.h:194:27: note: expected ‘char *’ but argument is of type ‘const char *’
        194 | xcb_aux_parse_color(char *color_name,
            |                     ~~~~~~^~~~~~~~~~
    • Michel Dänzer's avatar
      loader: strdup const string assigned to local variable name · 65387391
      Michel Dänzer authored
      There's a free(name) at the end of the function.
      GCC warned about this:
      ../hw/xfree86/loader/loadmod.c: In function ‘LoadModule’:
      ../hw/xfree86/loader/loadmod.c:702:18: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
        702 |         m = name = "int10";
            |                  ^
    • Adam Jackson's avatar
      Revert "dri2: Don't make reference to noClientException" · e1fa3beb
      Adam Jackson authored
      It's true that the value would always be -1, if it's not zero, but it's
      usually zero is the problem. As a result we return failure from
      otherwise successful indirect GLX paths, which isn't very nice of us.
      This reverts commit 7d33ab0f.
      Fixes: xorg/xserver#211
  13. 27 Jan, 2020 2 commits
  14. 15 Jan, 2020 1 commit
  15. 14 Jan, 2020 2 commits