From 7838c3ac0205bd49afed3738379ede153061acd7 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Jul 29 2019 12:52:52 +0000 Subject: import mutter-3.28.3-8.el7_6 --- diff --git a/SOURCES/0001-gpu-xrandr-Move-dpms-state-and-screen-size-updating-.patch b/SOURCES/0001-gpu-xrandr-Move-dpms-state-and-screen-size-updating-.patch new file mode 100644 index 0000000..2c6eae8 --- /dev/null +++ b/SOURCES/0001-gpu-xrandr-Move-dpms-state-and-screen-size-updating-.patch @@ -0,0 +1,114 @@ +From 8566bac05088708635e505709be656755f2849a0 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jonas=20=C3=85dahl?= +Date: Wed, 3 Oct 2018 10:50:07 +0200 +Subject: [PATCH 1/2] gpu/xrandr: Move dpms state and screen size updating into + helpers + +To be used by no-Xrandr fallback path. +--- + src/backends/x11/meta-gpu-xrandr.c | 70 ++++++++++++++++++++---------- + 1 file changed, 46 insertions(+), 24 deletions(-) + +diff --git a/src/backends/x11/meta-gpu-xrandr.c b/src/backends/x11/meta-gpu-xrandr.c +index add80c0d2..a4e187a49 100644 +--- a/src/backends/x11/meta-gpu-xrandr.c ++++ b/src/backends/x11/meta-gpu-xrandr.c +@@ -91,31 +91,15 @@ meta_gpu_xrandr_poll_hardware (MetaGpu *gpu) + gpu_xrandr->need_hardware_poll = TRUE; + } + +-static gboolean +-meta_gpu_xrandr_read_current (MetaGpu *gpu, +- GError **error) ++static void ++update_dpms_state (MetaMonitorManagerXrandr *monitor_manager_xrandr) + { +- MetaGpuXrandr *gpu_xrandr = META_GPU_XRANDR (gpu); +- MetaMonitorManager *monitor_manager = meta_gpu_get_monitor_manager (gpu); +- MetaMonitorManagerXrandr *monitor_manager_xrandr = +- META_MONITOR_MANAGER_XRANDR (monitor_manager); ++ MetaMonitorManager *monitor_manager = ++ META_MONITOR_MANAGER (monitor_manager_xrandr); + Display *xdisplay = + meta_monitor_manager_xrandr_get_xdisplay (monitor_manager_xrandr); +- XRRScreenResources *resources; +- RROutput primary_output; +- unsigned int i, j; +- GList *l; +- int min_width, min_height; +- Screen *screen; + BOOL dpms_capable, dpms_enabled; + CARD16 dpms_state; +- GList *outputs = NULL; +- GList *modes = NULL; +- GList *crtcs = NULL; +- +- if (gpu_xrandr->resources) +- XRRFreeScreenResources (gpu_xrandr->resources); +- gpu_xrandr->resources = NULL; + + dpms_capable = DPMSCapable (xdisplay); + +@@ -146,6 +130,47 @@ meta_gpu_xrandr_read_current (MetaGpu *gpu, + { + monitor_manager->power_save_mode = META_POWER_SAVE_UNSUPPORTED; + } ++} ++ ++static void ++update_screen_size (MetaMonitorManagerXrandr *monitor_manager_xrandr) ++{ ++ MetaMonitorManager *monitor_manager = ++ META_MONITOR_MANAGER (monitor_manager_xrandr); ++ Display *xdisplay = ++ meta_monitor_manager_xrandr_get_xdisplay (monitor_manager_xrandr); ++ Screen *screen; ++ ++ screen = ScreenOfDisplay (xdisplay, DefaultScreen (xdisplay)); ++ ++ monitor_manager->screen_width = WidthOfScreen (screen); ++ monitor_manager->screen_height = HeightOfScreen (screen); ++} ++ ++static gboolean ++meta_gpu_xrandr_read_current (MetaGpu *gpu, ++ GError **error) ++{ ++ MetaGpuXrandr *gpu_xrandr = META_GPU_XRANDR (gpu); ++ MetaMonitorManager *monitor_manager = meta_gpu_get_monitor_manager (gpu); ++ MetaMonitorManagerXrandr *monitor_manager_xrandr = ++ META_MONITOR_MANAGER_XRANDR (monitor_manager); ++ Display *xdisplay = ++ meta_monitor_manager_xrandr_get_xdisplay (monitor_manager_xrandr); ++ XRRScreenResources *resources; ++ RROutput primary_output; ++ unsigned int i, j; ++ GList *l; ++ int min_width, min_height; ++ GList *outputs = NULL; ++ GList *modes = NULL; ++ GList *crtcs = NULL; ++ ++ if (gpu_xrandr->resources) ++ XRRFreeScreenResources (gpu_xrandr->resources); ++ gpu_xrandr->resources = NULL; ++ ++ update_dpms_state (monitor_manager_xrandr); + + XRRGetScreenSizeRange (xdisplay, DefaultRootWindow (xdisplay), + &min_width, +@@ -153,10 +178,7 @@ meta_gpu_xrandr_read_current (MetaGpu *gpu, + &gpu_xrandr->max_screen_width, + &gpu_xrandr->max_screen_height); + +- screen = ScreenOfDisplay (xdisplay, DefaultScreen (xdisplay)); +- /* This is updated because we called XRRUpdateConfiguration. */ +- monitor_manager->screen_width = WidthOfScreen (screen); +- monitor_manager->screen_height = HeightOfScreen (screen); ++ update_screen_size (monitor_manager_xrandr); + + if (gpu_xrandr->need_hardware_poll) + { +-- +2.21.0 + diff --git a/SOURCES/0002-monitor-manager-xrandr-Create-dummy-screen-sized-mon.patch b/SOURCES/0002-monitor-manager-xrandr-Create-dummy-screen-sized-mon.patch new file mode 100644 index 0000000..7aeeb68 --- /dev/null +++ b/SOURCES/0002-monitor-manager-xrandr-Create-dummy-screen-sized-mon.patch @@ -0,0 +1,171 @@ +From f5b0e165c71d5114ba5221eea6ac9ec68b8ced94 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jonas=20=C3=85dahl?= +Date: Wed, 3 Oct 2018 10:50:47 +0200 +Subject: [PATCH 2/2] monitor-manager/xrandr: Create dummy screen sized monitor + if no RANDR + +When there is no RANDR support enabled in the X server, we wont get +notified of any monitors, resulting in mutter believing we're being +headless. To get at least something working, although with no way +configuration ability, lets pretend the whole screen is just a single +monitor with a single output, crtc and mode. +--- + src/backends/x11/meta-gpu-xrandr.c | 60 +++++++++++++++++++ + .../x11/meta-monitor-manager-xrandr.c | 20 +++++++ + .../x11/meta-monitor-manager-xrandr.h | 2 + + 3 files changed, 82 insertions(+) + +diff --git a/src/backends/x11/meta-gpu-xrandr.c b/src/backends/x11/meta-gpu-xrandr.c +index a4e187a49..9397c1f64 100644 +--- a/src/backends/x11/meta-gpu-xrandr.c ++++ b/src/backends/x11/meta-gpu-xrandr.c +@@ -147,6 +147,63 @@ update_screen_size (MetaMonitorManagerXrandr *monitor_manager_xrandr) + monitor_manager->screen_height = HeightOfScreen (screen); + } + ++static gboolean ++read_current_fallback (MetaGpuXrandr *gpu_xrandr, ++ MetaMonitorManagerXrandr *monitor_manager_xrandr) ++{ ++ MetaGpu *gpu = META_GPU (gpu_xrandr); ++ MetaMonitorManager *monitor_manager = ++ META_MONITOR_MANAGER (monitor_manager_xrandr); ++ MetaCrtcMode *mode; ++ MetaCrtc *crtc; ++ MetaOutput *output; ++ ++ update_dpms_state (monitor_manager_xrandr); ++ update_screen_size (monitor_manager_xrandr); ++ ++ mode = g_object_new (META_TYPE_CRTC_MODE, NULL); ++ mode->mode_id = 0; ++ mode->width = monitor_manager->screen_width; ++ mode->height = monitor_manager->screen_height; ++ mode->refresh_rate = 60.0; ++ mode->name = g_strdup_printf ("%dx%d", mode->width, mode->height); ++ ++ meta_gpu_take_modes (gpu, g_list_prepend (NULL, mode)); ++ ++ crtc = g_object_new (META_TYPE_CRTC, NULL); ++ crtc->gpu = gpu; ++ crtc->crtc_id = 0; ++ crtc->rect = (MetaRectangle) { .width = mode->width, .height = mode->height }; ++ crtc->current_mode = mode; ++ ++ meta_gpu_take_crtcs (gpu, g_list_prepend (NULL, crtc)); ++ ++ output = g_object_new (META_TYPE_OUTPUT, NULL); ++ output->gpu = gpu; ++ output->winsys_id = 0; ++ output->name = g_strdup ("X11 Screen"); ++ output->vendor = g_strdup ("unknown"); ++ output->product = g_strdup ("unknown"); ++ output->serial = g_strdup ("unknown"); ++ output->hotplug_mode_update = TRUE; ++ output->suggested_x = -1; ++ output->suggested_y = -1; ++ output->connector_type = META_CONNECTOR_TYPE_Unknown; ++ output->modes = g_new0 (MetaCrtcMode *, 1); ++ output->modes[0] = mode; ++ output->n_modes = 1; ++ output->preferred_mode = mode; ++ output->possible_crtcs = g_new0 (MetaCrtc *, 1); ++ output->possible_crtcs[0] = crtc; ++ output->n_possible_crtcs = 1; ++ meta_output_assign_crtc (output, crtc); ++ output->is_primary = TRUE; ++ ++ meta_gpu_take_outputs (gpu, g_list_prepend (NULL, output)); ++ ++ return TRUE; ++} ++ + static gboolean + meta_gpu_xrandr_read_current (MetaGpu *gpu, + GError **error) +@@ -166,6 +223,9 @@ meta_gpu_xrandr_read_current (MetaGpu *gpu, + GList *modes = NULL; + GList *crtcs = NULL; + ++ if (!meta_monitor_manager_xrandr_has_randr (monitor_manager_xrandr)) ++ return read_current_fallback (gpu_xrandr, monitor_manager_xrandr); ++ + if (gpu_xrandr->resources) + XRRFreeScreenResources (gpu_xrandr->resources); + gpu_xrandr->resources = NULL; +diff --git a/src/backends/x11/meta-monitor-manager-xrandr.c b/src/backends/x11/meta-monitor-manager-xrandr.c +index d0da2c539..26b057a55 100644 +--- a/src/backends/x11/meta-monitor-manager-xrandr.c ++++ b/src/backends/x11/meta-monitor-manager-xrandr.c +@@ -64,6 +64,7 @@ struct _MetaMonitorManagerXrandr + guint logind_watch_id; + guint logind_signal_sub_id; + ++ gboolean has_randr; + gboolean has_randr15; + + /* +@@ -107,6 +108,12 @@ meta_monitor_manager_xrandr_get_xdisplay (MetaMonitorManagerXrandr *manager_xran + return manager_xrandr->xdisplay; + } + ++gboolean ++meta_monitor_manager_xrandr_has_randr (MetaMonitorManagerXrandr *manager_xrandr) ++{ ++ return manager_xrandr->has_randr; ++} ++ + gboolean + meta_monitor_manager_xrandr_has_randr15 (MetaMonitorManagerXrandr *manager_xrandr) + { +@@ -577,9 +584,18 @@ meta_monitor_manager_xrandr_apply_monitors_config (MetaMonitorManager *mana + MetaMonitorsConfigMethod method, + GError **error) + { ++ MetaMonitorManagerXrandr *manager_xrandr = ++ META_MONITOR_MANAGER_XRANDR (manager); + GPtrArray *crtc_infos; + GPtrArray *output_infos; + ++ if (!manager_xrandr->has_randr) ++ { ++ g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, ++ "Tried to change configuration without XRANDR support"); ++ return FALSE; ++ } ++ + if (!config) + { + meta_monitor_manager_xrandr_rebuild_derived (manager, NULL); +@@ -1046,11 +1062,15 @@ meta_monitor_manager_xrandr_constructed (GObject *object) + &manager_xrandr->rr_event_base, + &manager_xrandr->rr_error_base)) + { ++ g_warning ("No RANDR support, monitor configuration disabled"); + return; + } + else + { + int major_version, minor_version; ++ ++ manager_xrandr->has_randr = TRUE; ++ + /* We only use ScreenChangeNotify, but GDK uses the others, + and we don't want to step on its toes */ + XRRSelectInput (manager_xrandr->xdisplay, +diff --git a/src/backends/x11/meta-monitor-manager-xrandr.h b/src/backends/x11/meta-monitor-manager-xrandr.h +index f09cbfd83..343c8131e 100644 +--- a/src/backends/x11/meta-monitor-manager-xrandr.h ++++ b/src/backends/x11/meta-monitor-manager-xrandr.h +@@ -33,6 +33,8 @@ G_DECLARE_FINAL_TYPE (MetaMonitorManagerXrandr, meta_monitor_manager_xrandr, + + Display * meta_monitor_manager_xrandr_get_xdisplay (MetaMonitorManagerXrandr *manager_xrandr); + ++gboolean meta_monitor_manager_xrandr_has_randr (MetaMonitorManagerXrandr *manager_xrandr); ++ + gboolean meta_monitor_manager_xrandr_has_randr15 (MetaMonitorManagerXrandr *manager_xrandr); + + gboolean meta_monitor_manager_xrandr_handle_xevent (MetaMonitorManagerXrandr *manager, +-- +2.21.0 + diff --git a/SPECS/mutter.spec b/SPECS/mutter.spec index 5da8262..1ece681 100644 --- a/SPECS/mutter.spec +++ b/SPECS/mutter.spec @@ -10,7 +10,7 @@ Name: mutter Version: 3.28.3 -Release: 7%{?dist} +Release: 8%{?dist} Summary: Window and compositing manager based on Clutter License: GPLv2+ @@ -67,6 +67,10 @@ Patch202: 0001-renderer-native-Check-calculated-transform-when-crea.patch # Don't ignore 'MetaModes' (#1690760) Patch250: inherit-xrandr-metamodes.patch +# Handle lack of XRANDR (#1714959) +Patch260: 0001-gpu-xrandr-Move-dpms-state-and-screen-size-updating-.patch +Patch261: 0002-monitor-manager-xrandr-Create-dummy-screen-sized-mon.patch + BuildRequires: chrpath BuildRequires: pango-devel BuildRequires: startup-notification-devel @@ -222,6 +226,9 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || : %{_libdir}/pkgconfig/* %changelog +* Wed Jun 12 2019 Jonas Ådahl - 3.28.3-8 +- Handle lack of XRANDR (#1714959) + * Mon Mar 18 2019 Jonas Ådahl - 3.28.3-7 - Don't ignore current mode when deriving current config (#1690760)