1. 08 Apr, 2019 20 commits
    • Marco Trevisan's avatar
      monitor-manager-xrandr: Trigger a rebuild if only crtc scale changed · 793b5f4d
      Marco Trevisan authored
      When in logical global UI scale, and we change the scale from an integer value
      to another integer value, we have de-facto to only change the UI scale, while
      no crtc configuration has to be done.
      So, avoid applying the crtc assignments in such case (as they wouldn't lead to
      any xserver reconfiguration and RRScreenChangeNotify event anyway), but update
      the logical configuration that will eventually lead to an UI scale factor
      update and related signaling.
    • Marco Trevisan's avatar
      x11: Add logical layout mode with randr and UI scaling · baa2326b
      Marco Trevisan authored
      Implement a new layout mode where we use both the global UI scaling and logical
      sized monitors with inverse randr scaling.
      It allows to support fractional scaling in the X11 backend with some good
      quality image results also in multi-monitor with multi-DPI.
      It works by scaling up the UI to the maximum ceiled scaling value across the
      monitors, and then scaling down (via randr transformations) the monitors so
        monitor_scaling = ui_scale * monitor_randr_scaling
      In order to do this the layout GLOBAL_UI_LOGICAL is added which is logical mode
      where monitor positioning is computed dividing the monitor scale by the maximum
      scaling across the displays.
      This is known to work at best with modesetting drivers when glamor is used.
    • Marco Trevisan's avatar
      monitor-manager: Optionally derive scaling from CRTCs with a threshold · ae7a77b7
      Marco Trevisan authored
      If outputs support native scaling, get the scale value directly from the CRTCs,
      however since this value could not perfectly match the allowed values as per
      the backend limitations, we use a bigger threshold in matching a value.
      To do this, redefine meta_monitor_manager_is_scale_supported using
      meta_monitor_manager_is_scale_supported_with_threshold that takes a threshold
      as argument, and that returns the matched value as an out parameter.
    • Marco Trevisan's avatar
      x11: Only allow scaling values that produces integer inputs · bc009bed
      Marco Trevisan authored
      While the backend doesn't precisely need this, it might use a different rounding
      policy that mismatches with us, causing some scaling levels not to be appliable.
      So just do the same we do for other backends when using fractional scaling, and
      so return the scaling values as they are computed, and use more relaxed
      comparisons when it comes to comparing the setting values with the one computed
      from the crtc.
    • Marco Trevisan's avatar
      compositor: Disable scaling on the unredirected window monitor · 4223e6b8
      Marco Trevisan authored
      If xrandr scaling is enabled in the monitor where a fullscreen window is going
      go be unredirected, we need to temporary disable the scaling on the monitor or
      the window won't be presented properly and the performances will be decreased
      for no reason, since in this case the control has to belong completely to the
      Also monitor for monitor changes to update the scaling disabling in case it
      would be needed.
    • Marco Trevisan's avatar
      window: Add monitor-changed signal · b6330f98
      Marco Trevisan authored
      When a window logical monitor has changed, we should notify this not only
      at display level but also at window level, so that we can monitor this change
      for a single window only.
    • Marco Trevisan's avatar
      monitor-manager: Allow to temporary disable scaling for a monitor · 7aed49bc
      Marco Trevisan authored
      It might be requested by a fullscreen application to disable the scaling for
      the monitor where it's painted, and in such case we can generate a temporary
      configuration with no scaling on the given monitor and apply it.
      When requested, this can be disabled again or transferred to other monitor.
    • Marco Trevisan's avatar
      monitor-manager: Always update the layout mode from specific manager · ccb8fb12
      Marco Trevisan authored
      Set the layout mode getting it the default from the current implementation of
      the monitor manager instead of always set it to physical.
      In fact even when deriving monitors we might get layout mode from the manager.
    • Marco Trevisan's avatar
      monitor-manager: Add function to get the maximum scale · bac5545d
      Marco Trevisan authored
      This function computes the maximum scaling level for the current setup.
    • Marco Trevisan's avatar
      x11, monitor-manager: Update screen size after we updated from server · d5d2ba5c
      Marco Trevisan authored
      When the randr transformation increases the screen size, we need to update the
      screen area, because after calling XRRUpdateConfiguration in this case the
      values don't change.
      So, we need to read actual values, in case scale them, and finally update
      the screen size again if needed.
      We don't have to use inverted size values when monitors are rotated, because
      this is already taken in account by the crtc rectangles.
      Do this by implementing update_screen_size_derived vfunc so that we can notify
      after that we've computed the crtc assignments and before that we notify
      monitors changes
    • Marco Trevisan's avatar
      MonitorManager: Add update_screen_size[_derived] vfuncs · e4f70c24
      Marco Trevisan authored
      The screen size needs to be computed before emitting monitors changed, so it's
      better to make this strongly happen when we need, adding the ability to
      implementations to override the default behavior.
      Since so far all the implementations (minus xrandr) where using the same code
      for computing the screen size from configurations, we just reuse this as default
    • Marco Trevisan's avatar
      x11: Add support to use Randr output fractional scaling · 8499e69d
      Marco Trevisan authored
      Added an experimental feature under the "x11-randr-fractional-scaling" setting,
      to enable fractional scaling under X11 using randr output transformations.
      In this first basic implementation, we just scale everything up using pure
      transformation, and so everything will be blurry.
    • Marco Trevisan's avatar
      x11, monitor-manager: Update the screen size using scale for computing sizes · db38bc1b
      Marco Trevisan authored
      And only perform this if the screen size changed since the last update we received
    • Marco Trevisan's avatar
    • Marco Trevisan's avatar
      x11, crtc: Add function to scale a single crtc using randr · 2020623c
      Marco Trevisan authored
      Randr transformation can be used to scale a single crtc using various filters.
    • Marco Trevisan's avatar
      x11, crtc: Read current randr scaling when creating a new crtc · 19a0d0a1
      Marco Trevisan authored
      Since now we've this flag in the crtc, we can get the current scaling from X11
      and save it in the crtc infos.
    • Marco Trevisan's avatar
      x11, monitor-manager: Expose output scaling capability if randr is available · 74a3dc35
      Marco Trevisan authored
      When randr extension version is major than 1.3, we can use transformations,
      and in this case we can expose this capability to use related functions.
    • Marco Trevisan's avatar
      crtc: Save CRT controller scale · de7d84fb
      Marco Trevisan authored
      In some backends (X11) the scaling could be applied natively at crtc level,
      so we need to save it at this level.
    • Marco Trevisan's avatar
    • Marco Trevisan's avatar
      monitor-manager: Add tiling as capability · b21d7536
      Marco Trevisan authored
      Instead of having a private method for xrandr only, just use
      MetaMonitorManagerCapability to store this feature.
      In this way we can just store the randr version and do the versioning check
      using few utility macros.
      Tiling was available since randr 1.5
  2. 03 Apr, 2019 11 commits
  3. 02 Apr, 2019 9 commits