about summary refs log tree commit diff
path: root/nixpkgs/pkgs/desktops/gnome-3/core/mutter
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/desktops/gnome-3/core/mutter')
-rw-r--r--nixpkgs/pkgs/desktops/gnome-3/core/mutter/0001-Revert-ClutterActor-Preserve-valid-paint-volumes-til.patch147
-rw-r--r--nixpkgs/pkgs/desktops/gnome-3/core/mutter/0001-build-use-get_pkgconfig_variable-for-sysprof-dbusdir.patch25
-rw-r--r--nixpkgs/pkgs/desktops/gnome-3/core/mutter/3.28.nix97
-rw-r--r--nixpkgs/pkgs/desktops/gnome-3/core/mutter/default.nix149
-rw-r--r--nixpkgs/pkgs/desktops/gnome-3/core/mutter/drop-inheritable.patch132
-rw-r--r--nixpkgs/pkgs/desktops/gnome-3/core/mutter/fix-paths-328.patch13
-rw-r--r--nixpkgs/pkgs/desktops/gnome-3/core/mutter/fix-paths.patch13
-rw-r--r--nixpkgs/pkgs/desktops/gnome-3/core/mutter/libglvnd-328.patch63
8 files changed, 639 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/desktops/gnome-3/core/mutter/0001-Revert-ClutterActor-Preserve-valid-paint-volumes-til.patch b/nixpkgs/pkgs/desktops/gnome-3/core/mutter/0001-Revert-ClutterActor-Preserve-valid-paint-volumes-til.patch
new file mode 100644
index 000000000000..0e1c33773b0e
--- /dev/null
+++ b/nixpkgs/pkgs/desktops/gnome-3/core/mutter/0001-Revert-ClutterActor-Preserve-valid-paint-volumes-til.patch
@@ -0,0 +1,147 @@
+From 76477def5c103f10d62e604305802d7f5506afd4 Mon Sep 17 00:00:00 2001
+From: worldofpeace <worldofpeace@protonmail.ch>
+Date: Sun, 15 Sep 2019 20:14:16 -0400
+Subject: [PATCH] Revert "ClutterActor: Preserve valid paint volumes till the
+ next relayout/repaint"
+
+This causes issues for users of mutter like in gala[0].
+
+Upstream report: https://gitlab.gnome.org/GNOME/mutter/issues/536
+[0]: https://github.com/elementary/gala/issues/605
+---
+ clutter/clutter/clutter-actor.c | 35 +++++----------------------------
+ 1 file changed, 5 insertions(+), 30 deletions(-)
+
+diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c
+index e70892308..8cb60fa07 100644
+--- a/clutter/clutter/clutter-actor.c
++++ b/clutter/clutter/clutter-actor.c
+@@ -24,7 +24,7 @@
+ 
+ /**
+  * SECTION:clutter-actor
+- * @short_description: The basic element of the scene graph 
++ * @short_description: The basic element of the scene graph
+  *
+  * The ClutterActor class is the basic element of the scene graph in Clutter,
+  * and it encapsulates the position, size, and transformations of a node in
+@@ -840,7 +840,6 @@ struct _ClutterActorPrivate
+   guint needs_compute_expand        : 1;
+   guint needs_x_expand              : 1;
+   guint needs_y_expand              : 1;
+-  guint needs_paint_volume_update   : 1;
+   guint had_effects_on_last_paint_volume_update : 1;
+ };
+ 
+@@ -1511,8 +1510,6 @@ clutter_actor_real_map (ClutterActor *self)
+ 
+   CLUTTER_ACTOR_SET_FLAGS (self, CLUTTER_ACTOR_MAPPED);
+ 
+-  self->priv->needs_paint_volume_update = TRUE;
+-
+   stage = _clutter_actor_get_stage_internal (self);
+   priv->pick_id = _clutter_stage_acquire_pick_id (CLUTTER_STAGE (stage), self);
+ 
+@@ -2746,7 +2743,6 @@ clutter_actor_real_queue_relayout (ClutterActor *self)
+   priv->needs_width_request  = TRUE;
+   priv->needs_height_request = TRUE;
+   priv->needs_allocation     = TRUE;
+-  priv->needs_paint_volume_update = TRUE;
+ 
+   /* reset the cached size requests */
+   memset (priv->width_requests, 0,
+@@ -4742,7 +4738,7 @@ clutter_actor_set_rotation_center_internal (ClutterActor        *self,
+                                             ClutterRotateAxis    axis,
+                                             const ClutterVertex *center)
+ {
+-  ClutterVertex v = CLUTTER_VERTEX_INIT_ZERO; 
++  ClutterVertex v = CLUTTER_VERTEX_INIT_ZERO;
+   GObject *obj = G_OBJECT (self);
+   ClutterTransformInfo *info;
+ 
+@@ -8531,7 +8527,6 @@ clutter_actor_init (ClutterActor *self)
+   priv->needs_width_request = TRUE;
+   priv->needs_height_request = TRUE;
+   priv->needs_allocation = TRUE;
+-  priv->needs_paint_volume_update = TRUE;
+ 
+   priv->cached_width_age = 1;
+   priv->cached_height_age = 1;
+@@ -10098,9 +10093,6 @@ clutter_actor_allocate (ClutterActor           *self,
+       return;
+     }
+ 
+-  if (CLUTTER_ACTOR_IS_MAPPED (self))
+-    self->priv->needs_paint_volume_update = TRUE;
+-
+   if (!stage_allocation_changed)
+     {
+       /* If the actor didn't move but needs_allocation is set, we just
+@@ -12992,9 +12984,6 @@ clutter_actor_add_child_internal (ClutterActor              *self,
+       child->priv->needs_height_request = TRUE;
+       child->priv->needs_allocation = TRUE;
+ 
+-      if (CLUTTER_ACTOR_IS_MAPPED (child))
+-        child->priv->needs_paint_volume_update = TRUE;
+-
+       /* we only queue a relayout here, because any possible
+        * redraw has already been queued either by show() or
+        * by our call to queue_redraw() above
+@@ -14130,7 +14119,7 @@ clutter_actor_get_anchor_point_gravity (ClutterActor *self)
+  *
+  * Since: 0.6
+  *
+- * Deprecated: 1.12: Use #ClutterActor:pivot-point and 
++ * Deprecated: 1.12: Use #ClutterActor:pivot-point and
+  * clutter_actor_set_translation() instead.
+  */
+ void
+@@ -14178,7 +14167,7 @@ clutter_actor_move_anchor_point (ClutterActor *self,
+  *
+  * Since: 0.6
+  *
+- * Deprecated: 1.12: Use #ClutterActor:pivot-point and 
++ * Deprecated: 1.12: Use #ClutterActor:pivot-point and
+  * clutter_actor_set_translation() instead.
+  */
+ void
+@@ -14230,7 +14219,7 @@ clutter_actor_move_anchor_point_from_gravity (ClutterActor   *self,
+  *
+  * Since: 0.6
+  *
+- * Deprecated: 1.12: Use #ClutterActor:pivot-point and 
++ * Deprecated: 1.12: Use #ClutterActor:pivot-point and
+  * clutter_actor_set_translation() instead. E.g. For %CLUTTER_GRAVITY_CENTER set
+  * pivot_point to (0.5,0.5) and the translation to (width/2,height/2).
+  */
+@@ -17567,19 +17556,6 @@ _clutter_actor_get_paint_volume_mutable (ClutterActor *self)
+ 
+   if (priv->paint_volume_valid)
+     {
+-      /* If effects are applied, the actor paint volume
+-       * needs to be recomputed on each paint, since those
+-       * paint volumes could change over the duration of the
+-       * effect.
+-       *
+-       * We also need to update the paint volume if we went
+-       * from having effects to not having effects on the last
+-       * paint volume update. */
+-      if (!priv->needs_paint_volume_update &&
+-          priv->current_effect == NULL &&
+-          !has_paint_volume_override_effects &&
+-          !priv->had_effects_on_last_paint_volume_update)
+-        return &priv->paint_volume;
+       clutter_paint_volume_free (&priv->paint_volume);
+     }
+ 
+@@ -17588,7 +17564,6 @@ _clutter_actor_get_paint_volume_mutable (ClutterActor *self)
+   if (_clutter_actor_get_paint_volume_real (self, &priv->paint_volume))
+     {
+       priv->paint_volume_valid = TRUE;
+-      priv->needs_paint_volume_update = FALSE;
+       return &priv->paint_volume;
+     }
+   else
+-- 
+2.22.1
+
diff --git a/nixpkgs/pkgs/desktops/gnome-3/core/mutter/0001-build-use-get_pkgconfig_variable-for-sysprof-dbusdir.patch b/nixpkgs/pkgs/desktops/gnome-3/core/mutter/0001-build-use-get_pkgconfig_variable-for-sysprof-dbusdir.patch
new file mode 100644
index 000000000000..2df70ff9646a
--- /dev/null
+++ b/nixpkgs/pkgs/desktops/gnome-3/core/mutter/0001-build-use-get_pkgconfig_variable-for-sysprof-dbusdir.patch
@@ -0,0 +1,25 @@
+From 71acfd5258b4d12323fc51dda48e83830e62e696 Mon Sep 17 00:00:00 2001
+From: worldofpeace <worldofpeace@protonmail.ch>
+Date: Mon, 16 Sep 2019 11:18:27 -0400
+Subject: [PATCH] build: use get_pkgconfig_variable for sysprof dbusdir
+
+---
+ src/meson.build | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/meson.build b/src/meson.build
+index 182f7f5f5..43060865b 100644
+--- a/src/meson.build
++++ b/src/meson.build
+@@ -710,7 +710,7 @@ if have_profiler
+     'backends/meta-profiler.h',
+   ]
+ 
+-  dbus_interfaces_dir = join_paths(datadir, 'dbus-1', 'interfaces')
++  dbus_interfaces_dir = join_paths(sysprof_dep.get_pkgconfig_variable('prefix'), 'share', 'dbus-1', 'interfaces')
+   sysprof3_dbus_file = join_paths(dbus_interfaces_dir, 'org.gnome.Sysprof3.Profiler.xml')
+ 
+   dbus_sysprof3_profiler_built_sources = gnome.gdbus_codegen('meta-dbus-sysprof3-profiler',
+-- 
+2.22.1
+
diff --git a/nixpkgs/pkgs/desktops/gnome-3/core/mutter/3.28.nix b/nixpkgs/pkgs/desktops/gnome-3/core/mutter/3.28.nix
new file mode 100644
index 000000000000..85208163415b
--- /dev/null
+++ b/nixpkgs/pkgs/desktops/gnome-3/core/mutter/3.28.nix
@@ -0,0 +1,97 @@
+{ fetchFromGitLab, stdenv, substituteAll, pkgconfig, gnome3, intltool, gobject-introspection, upower, cairo
+, glib, gtk3, pango, cogl, clutter, libstartup_notification, zenity, libcanberra-gtk3, fetchpatch
+, gsettings-desktop-schemas, gnome-desktop, wrapGAppsHook
+, libtool, xkeyboard_config, libxkbfile, libxkbcommon, libXtst, libinput
+, geocode-glib, libgudev, libwacom, xwayland, autoreconfHook }:
+
+stdenv.mkDerivation rec {
+  pname = "mutter";
+  version = "3.28.4";
+
+  src = fetchFromGitLab {
+    domain = "gitlab.gnome.org";
+    owner = "GNOME";
+    repo = pname;
+    rev = "74e3126b77eb5f27c0ae3f53b0aff2d2eebc15af"; # patches of tip from gnome-3-28 branch
+    sha256 = "0gw1n1w3i040w5mv30kkg7g8a59ymjlc5yaklip0ngg8xv76g0zi";
+  };
+
+  patches = [
+    (substituteAll {
+      src = ./fix-paths-328.patch;
+      inherit zenity;
+    })
+
+    # https://bugzilla.redhat.com/show_bug.cgi?id=1700337
+    # https://gitlab.gnome.org/GNOME/mutter/merge_requests/133
+    (fetchpatch {
+      url = "https://src.fedoraproject.org/rpms/mutter328/raw/fff28bebda02111b4c534952465ff967ba7efced/f/0070-clutter-Add-API-to-retrieve-the-physical-size-of-abs.patch";
+      sha256 = "11xg0clrqwvssy2r6hv4iya8g87z2v5f47fimd2b4hha6ki3g1is";
+    })
+    (fetchpatch {
+      url = "https://src.fedoraproject.org/rpms/mutter328/raw/fff28bebda02111b4c534952465ff967ba7efced/f/0071-backends-Add-MetaInputMapper.patch";
+      sha256 = "1kcp42hg8sy1q21w5586gdgmi95nf36829kkfswbah61h6bkb518";
+    })
+    (fetchpatch {
+      url = "https://src.fedoraproject.org/rpms/mutter328/raw/fff28bebda02111b4c534952465ff967ba7efced/f/0072-backends-Delegate-on-MetaInputMapper-for-unmapped-di.patch";
+      sha256 = "0zf4yxhq5s3dnzmn15mx4yb978g27ij4vmq055my9p7xgh6h9ga8";
+    })
+    (fetchpatch {
+      url = "https://src.fedoraproject.org/rpms/mutter328/raw/fff28bebda02111b4c534952465ff967ba7efced/f/0073-backends-Add-MetaInputMapper-method-to-lookup-device.patch";
+      sha256 = "0dnb2hqx5in6x9ar6wnr1hy3bg2wdcl3wbdx4jn66c7bi7s1k5zd";
+    })
+    (fetchpatch {
+      url = "https://src.fedoraproject.org/rpms/mutter328/raw/fff28bebda02111b4c534952465ff967ba7efced/f/0074-backends-Turn-builtin-touchscreen-on-off-together-wi.patch";
+      sha256 = "17fvs7j5ws4sz6fkch93gjlik0nm4z426w4n348gyw5llh0r76pg";
+    })
+    (fetchpatch {
+      url = "https://src.fedoraproject.org/rpms/mutter328/raw/fff28bebda02111b4c534952465ff967ba7efced/f/0075-backends-Update-to-new-output-setting-for-tablets-to.patch";
+      sha256 = "141p3an83s042f67fw2fqmr79i5g634ndrbpd8cs47fd4wwiwpj5";
+    })
+    # https://gitlab.gnome.org/GNOME/mutter/merge_requests/670
+    # Needed for gala redorder workspace
+    (fetchpatch {
+      url = "https://github.com/elementary/os-patches/commit/d636a44885c5be662997f8e19f7dcd26670b3219.patch";
+      sha256 = "12pbxk6f39a09jxjam5a5hxl4whp3cifzpck2m7fpp0n98nc63qh";
+    })
+    # See patch commit message
+    ./0001-Revert-ClutterActor-Preserve-valid-paint-volumes-til.patch
+    # Fix build with libglvnd provided headers
+    ./libglvnd-328.patch
+  ];
+
+  configureFlags = [
+    "--with-x"
+    "--enable-shape"
+    "--enable-sm"
+    "--enable-startup-notification"
+    "--enable-xsync"
+    "--enable-verbose-mode"
+    "--with-libcanberra"
+    "--with-xwayland-path=${xwayland}/bin/Xwayland"
+    "--enable-compile-warnings=maximum"
+  ];
+
+  propagatedBuildInputs = [
+    # required for pkgconfig to detect mutter-clutter
+    libXtst
+  ];
+
+  nativeBuildInputs = [ autoreconfHook pkgconfig intltool libtool wrapGAppsHook ];
+
+  buildInputs = [
+    glib gobject-introspection gtk3 gsettings-desktop-schemas upower
+    gnome-desktop cairo pango cogl clutter zenity libstartup_notification
+    geocode-glib libinput libgudev libwacom
+    libcanberra-gtk3 zenity xkeyboard_config libxkbfile
+    libxkbcommon
+  ];
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    platforms = platforms.linux;
+    maintainers = gnome3.maintainers;
+    license = licenses.gpl2;
+  };
+}
diff --git a/nixpkgs/pkgs/desktops/gnome-3/core/mutter/default.nix b/nixpkgs/pkgs/desktops/gnome-3/core/mutter/default.nix
new file mode 100644
index 000000000000..642a825d5396
--- /dev/null
+++ b/nixpkgs/pkgs/desktops/gnome-3/core/mutter/default.nix
@@ -0,0 +1,149 @@
+{ fetchurl
+, fetchpatch
+, substituteAll
+, stdenv
+, pkgconfig
+, gnome3
+, gettext
+, gobject-introspection
+, upower
+, cairo
+, pango
+, cogl
+, json-glib
+, libstartup_notification
+, zenity
+, libcanberra-gtk3
+, ninja
+, xkeyboard_config
+, libxkbfile
+, libxkbcommon
+, libXtst
+, libinput
+, gsettings-desktop-schemas
+, glib
+, gtk3
+, gnome-desktop
+, geocode-glib
+, pipewire
+, libgudev
+, libwacom
+, xwayland
+, meson
+, gnome-settings-daemon
+, xorgserver
+, python3
+, wrapGAppsHook
+, sysprof
+, desktop-file-utils
+, libcap_ng
+, egl-wayland
+}:
+
+stdenv.mkDerivation rec {
+  pname = "mutter";
+  version = "3.34.3";
+
+  outputs = [ "out" "dev" "man" ];
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/mutter/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "12aaxmclg3aw7qkk3pzpw8f5vrk0cxwprdrjnx9bjpf31gfpvxfd";
+  };
+
+  mesonFlags = [
+    "-Degl_device=true"
+    "-Dinstalled_tests=false" # TODO: enable these
+    "-Dwayland_eglstream=true"
+    "-Dxwayland-path=${xwayland}/bin/Xwayland"
+  ];
+
+  propagatedBuildInputs = [
+    # required for pkgconfig to detect mutter-clutter
+    json-glib
+    libXtst
+    libcap_ng
+  ];
+
+  nativeBuildInputs = [
+    desktop-file-utils
+    gettext
+    meson
+    ninja
+    pkgconfig
+    python3
+    wrapGAppsHook
+    xorgserver # for cvt command
+  ];
+
+  buildInputs = [
+    cairo
+    cogl
+    egl-wayland
+    geocode-glib
+    glib
+    gnome-desktop
+    gnome-settings-daemon
+    gobject-introspection
+    gsettings-desktop-schemas
+    gtk3
+    libcanberra-gtk3
+    libgudev
+    libinput
+    libstartup_notification
+    libwacom
+    libxkbcommon
+    libxkbfile
+    pango
+    pipewire
+    sysprof
+    upower
+    xkeyboard_config
+    xwayland
+    zenity
+    zenity
+  ];
+
+  patches = [
+    # Fix build with libglvnd provided headers
+    (fetchpatch {
+      url = "https://gitlab.gnome.org/GNOME/mutter/commit/a444a4c5f58ea516ad3cd9d6ddc0056c3ca9bc90.patch";
+      sha256 = "0imy2j8af9477jliwdq4jc40yw1cifsjjf196gnmwxr9rkj0hbrd";
+    })
+
+    # Drop inheritable cap_sys_nice, to prevent the ambient set from leaking
+    # from mutter/gnome-shell, see https://github.com/NixOS/nixpkgs/issues/71381
+    ./drop-inheritable.patch
+
+    # TODO: submit upstream
+    ./0001-build-use-get_pkgconfig_variable-for-sysprof-dbusdir.patch
+
+    (substituteAll {
+      src = ./fix-paths.patch;
+      inherit zenity;
+    })
+  ];
+
+  postPatch = ''
+    patchShebangs src/backends/native/gen-default-modes.py
+  '';
+
+  postInstall = ''
+    ${glib.dev}/bin/glib-compile-schemas "$out/share/glib-2.0/schemas"
+  '';
+
+  passthru = {
+    updateScript = gnome3.updateScript {
+      packageName = pname;
+      attrPath = "gnome3.${pname}";
+    };
+  };
+
+  meta = with stdenv.lib; {
+    description = "A window manager for GNOME";
+    homepage = "https://gitlab.gnome.org/GNOME/mutter";
+    license = licenses.gpl2;
+    maintainers = gnome3.maintainers;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/desktops/gnome-3/core/mutter/drop-inheritable.patch b/nixpkgs/pkgs/desktops/gnome-3/core/mutter/drop-inheritable.patch
new file mode 100644
index 000000000000..574ed5725612
--- /dev/null
+++ b/nixpkgs/pkgs/desktops/gnome-3/core/mutter/drop-inheritable.patch
@@ -0,0 +1,132 @@
+From e9c772e265b2293af031c79f4bbc99b5847dfe3c Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Tor=20Hedin=20Br=C3=B8nner?= <torhedinbronner@gmail.com>
+Date: Sat, 19 Oct 2019 13:26:05 +0200
+Subject: [PATCH] drop inheritable
+
+Adapted from https://gitlab.gnome.org/GNOME/mutter/commit/c53c47ae123b03cc66044d2b846342123ecb3a01
+
+We only want to drop inheritable though, to prevent the ambient set leaking further than gnome-shell.
+
+---
+ config.h.meson    |  3 +++
+ meson.build       |  5 +++++
+ meson_options.txt |  6 ++++++
+ src/core/main.c   | 11 +++++++++++
+ src/meson.build   |  1 +
+ 5 files changed, 26 insertions(+)
+
+diff --git a/config.h.meson b/config.h.meson
+index 0bab71848..202fb7ed1 100644
+--- a/config.h.meson
++++ b/config.h.meson
+@@ -58,6 +58,9 @@
+ /* Xwayland applications allowed to issue keyboard grabs */
+ #mesondefine XWAYLAND_GRAB_DEFAULT_ACCESS_RULES
+ 
++/* Defined if libcap-ng is available */
++#mesondefine HAVE_LIBCAPNG
++
+ /* XKB base prefix */
+ #mesondefine XKB_BASE
+ 
+diff --git a/meson.build b/meson.build
+index 3322bd3b1..01c8020fa 100644
+--- a/meson.build
++++ b/meson.build
+@@ -35,6 +35,7 @@ libstartup_notification_req = '>= 0.7'
+ libcanberra_req = '>= 0.26'
+ libwacom_req = '>= 0.13'
+ atk_req = '>= 2.5.3'
++libcapng_req = '>= 0.7.9'
+ 
+ # optional version requirements
+ udev_req = '>= 228'
+@@ -125,6 +126,7 @@ xau_dep = dependency('xau')
+ ice_dep = dependency('ice')
+ atk_dep = dependency('atk', version: atk_req)
+ libcanberra_dep = dependency('libcanberra', version: libcanberra_req)
++libcapng_dep = dependency('libcap-ng', required: get_option('libcapng'))
+ 
+ # For now always require X11 support
+ have_x11 = true
+@@ -256,6 +258,7 @@ have_core_tests = false
+ have_cogl_tests = false
+ have_clutter_tests = false
+ have_installed_tests = false
++have_libcapng = libcapng_dep.found()
+ 
+ if have_tests
+   have_core_tests = get_option('core_tests')
+@@ -361,6 +364,7 @@ cdata.set('HAVE_LIBWACOM', have_libwacom)
+ cdata.set('HAVE_SM', have_sm)
+ cdata.set('HAVE_STARTUP_NOTIFICATION', have_startup_notification)
+ cdata.set('HAVE_INTROSPECTION', have_introspection)
++cdata.set('HAVE_LIBCAPNG', have_libcapng)
+ cdata.set('HAVE_PROFILER', have_profiler)
+ 
+ xkb_base = xkeyboard_config_dep.get_pkgconfig_variable('xkb_base')
+@@ -443,6 +447,7 @@ output = [
+   '        Startup notification..... ' + have_startup_notification.to_string(),
+   '        Introspection............ ' + have_introspection.to_string(),
+   '        Profiler................. ' + have_profiler.to_string(),
++  '        libcap-ng................ ' + have_libcapng.to_string(),
+   '',
+   '    Tests:',
+   '',
+diff --git a/meson_options.txt b/meson_options.txt
+index 73aa7adde..8bfaacd9a 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -152,3 +152,9 @@ option('xwayland_grab_default_access_rules',
+   value: 'gnome-boxes,remote-viewer,virt-viewer,virt-manager,vinagre,vncviewer,Xephyr',
+   description: 'Comma delimited list of applications ressources or class allowed to issue X11 grabs in Xwayland'
+ )
++
++option('libcapng',
++  type: 'feature',
++  value: 'auto',
++  description: 'Enable libcap-ng support'
++)
+diff --git a/src/core/main.c b/src/core/main.c
+index 7f4f666d2..b27968f13 100644
+--- a/src/core/main.c
++++ b/src/core/main.c
+@@ -66,6 +66,10 @@
+ #include <girepository.h>
+ #endif
+ 
++#ifdef HAVE_LIBCAPNG
++#include <cap-ng.h>
++#endif
++
+ #if defined(HAVE_NATIVE_BACKEND) && defined(HAVE_WAYLAND)
+ #include <systemd/sd-login.h>
+ #endif /* HAVE_WAYLAND && HAVE_NATIVE_BACKEND */
+@@ -673,6 +677,12 @@ meta_run (void)
+   if (!meta_display_open ())
+     meta_exit (META_EXIT_ERROR);
+ 
++#ifdef HAVE_LIBCAPNG
++  capng_clear(CAPNG_SELECT_BOTH);
++  capng_update(CAPNG_ADD, CAPNG_EFFECTIVE|CAPNG_PERMITTED, CAP_SYS_NICE);
++  capng_apply(CAPNG_SELECT_BOTH);
++#endif
++
+   g_main_loop_run (meta_main_loop);
+ 
+   meta_finalize ();
+diff --git a/src/meson.build b/src/meson.build
+index 90d80734f..a9fffa2c2 100644
+--- a/src/meson.build
++++ b/src/meson.build
+@@ -18,6 +18,7 @@ mutter_pkg_deps = [
+   glib_dep,
+   gsettings_desktop_schemas_dep,
+   gtk3_dep,
++  libcapng_dep,
+   pango_dep,
+ ]
+ 
+-- 
+2.23.0
+
diff --git a/nixpkgs/pkgs/desktops/gnome-3/core/mutter/fix-paths-328.patch b/nixpkgs/pkgs/desktops/gnome-3/core/mutter/fix-paths-328.patch
new file mode 100644
index 000000000000..6c40624a55da
--- /dev/null
+++ b/nixpkgs/pkgs/desktops/gnome-3/core/mutter/fix-paths-328.patch
@@ -0,0 +1,13 @@
+diff --git a/src/core/util.c b/src/core/util.c
+index 5b8de18c7..546352a95 100644
+--- a/src/core/util.c
++++ b/src/core/util.c
+@@ -635,7 +635,7 @@ meta_show_dialog (const char *type,
+
+   args = g_ptr_array_new ();
+
+-  append_argument (args, "zenity");
++  append_argument (args, "@zenity@/bin/zenity");
+   append_argument (args, type);
+
+   if (display)
diff --git a/nixpkgs/pkgs/desktops/gnome-3/core/mutter/fix-paths.patch b/nixpkgs/pkgs/desktops/gnome-3/core/mutter/fix-paths.patch
new file mode 100644
index 000000000000..6ac0a431f61f
--- /dev/null
+++ b/nixpkgs/pkgs/desktops/gnome-3/core/mutter/fix-paths.patch
@@ -0,0 +1,13 @@
+diff --git a/src/core/util.c b/src/core/util.c
+index 57b73747d..f424cc81c 100644
+--- a/src/core/util.c
++++ b/src/core/util.c
+@@ -636,7 +636,7 @@ meta_show_dialog (const char *type,
+ 
+   args = g_ptr_array_new ();
+ 
+-  append_argument (args, "zenity");
++  append_argument (args, "@zenity@/bin/zenity");
+   append_argument (args, type);
+ 
+   if (display)
diff --git a/nixpkgs/pkgs/desktops/gnome-3/core/mutter/libglvnd-328.patch b/nixpkgs/pkgs/desktops/gnome-3/core/mutter/libglvnd-328.patch
new file mode 100644
index 000000000000..96e275598288
--- /dev/null
+++ b/nixpkgs/pkgs/desktops/gnome-3/core/mutter/libglvnd-328.patch
@@ -0,0 +1,63 @@
+diff --git a/cogl/configure.ac b/cogl/configure.ac
+index 3be282f..d338cd1 100644
+--- a/cogl/configure.ac
++++ b/cogl/configure.ac
+@@ -490,6 +490,11 @@ AS_IF([test "x$enable_gles1" = "xyes"],
+ #include <EGL/eglext.h>"],
+                              [],
+                              [$COGL_EGL_INCLUDES])
++            AC_CHECK_HEADERS([EGL/eglmesaext.h],
++                             [COGL_EGL_INCLUDES="$COGL_EGL_INCLUDE
++#include <EGL/eglmesaext.h>"],
++                             [],
++                             [$COGL_EGL_INCLUDES])
+ 
+             # Check for a GLES 1.x Common Profile library with/without EGL.
+             #
+@@ -759,7 +764,9 @@ AS_IF([test "x$NEED_EGL" = "xyes" && test "x$EGL_CHECKED" != "xyes"],
+           )
+ 
+         COGL_EGL_INCLUDES="#include <EGL/egl.h>
+-#include <EGL/eglext.h>"
++#include <EGL/eglext.h>
++#include <EGL/eglmesaext.h>
++"
+         AC_SUBST([COGL_EGL_INCLUDES])
+       ])
+ 
+diff --git a/src/backends/meta-egl-ext.h b/src/backends/meta-egl-ext.h
+index 8705e7d..db0b74f 100644
+--- a/src/backends/meta-egl-ext.h
++++ b/src/backends/meta-egl-ext.h
+@@ -29,6 +29,7 @@
+ 
+ #include <EGL/egl.h>
+ #include <EGL/eglext.h>
++#include <EGL/eglmesaext.h>
+ 
+ /*
+  * This is a little different to the tests shipped with EGL implementations,
+diff --git a/src/backends/meta-egl.c b/src/backends/meta-egl.c
+index 755ec49..bd253c9 100644
+--- a/src/backends/meta-egl.c
++++ b/src/backends/meta-egl.c
+@@ -31,6 +31,7 @@
+ 
+ #include <EGL/egl.h>
+ #include <EGL/eglext.h>
++#include <EGL/eglmesaext.h>
+ #include <gio/gio.h>
+ #include <glib.h>
+ #include <glib-object.h>
+diff --git a/src/backends/meta-egl.h b/src/backends/meta-egl.h
+index 060c7cd..2fef264 100644
+--- a/src/backends/meta-egl.h
++++ b/src/backends/meta-egl.h
+@@ -27,6 +27,7 @@
+ 
+ #include <EGL/egl.h>
+ #include <EGL/eglext.h>
++#include <EGL/eglmesaext.h>
+ #include <glib-object.h>
+ 
+ #define META_EGL_ERROR meta_egl_error_quark ()