diff options
author | parcimonic | 2022-07-14 11:04:02 -0300 |
---|---|---|
committer | parcimonic | 2022-07-14 11:05:21 -0300 |
commit | 8b2ca7f74a4dfb5ee329959d34325e4b4e71a408 (patch) | |
tree | a26073677951c5616a0c2e31cf357976577da7f1 | |
download | aur-8b2ca7f74a4dfb5ee329959d34325e4b4e71a408.tar.gz |
Initial commit
-rw-r--r-- | .SRCINFO | 46 | ||||
-rw-r--r-- | 0001-Revert-backends-native-Disable-touch-mode-with-point.patch | 117 | ||||
-rw-r--r-- | PKGBUILD | 91 |
3 files changed, 254 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..2a439d286580 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,46 @@ +pkgbase = mutter-auto-rotation + pkgdesc = A window manager for GNOME, with touch-mode auto-rotation (reverts MR 1710) + pkgver = 42.3 + pkgrel = 1 + url = https://gitlab.gnome.org/GNOME/mutter + arch = x86_64 + groups = gnome + license = GPL + checkdepends = xorg-server-xvfb + checkdepends = wireplumber + checkdepends = python-dbusmock + makedepends = gobject-introspection + makedepends = git + makedepends = egl-wayland + makedepends = meson + makedepends = xorg-server + makedepends = wayland-protocols + makedepends = sysprof + makedepends = gi-docgen + makedepends = xorg-server-xvfb + depends = dconf + depends = gobject-introspection-runtime + depends = gsettings-desktop-schemas + depends = libcanberra + depends = startup-notification + depends = zenity + depends = libsm + depends = gnome-desktop + depends = libxkbcommon-x11 + depends = gnome-settings-daemon + depends = libgudev + depends = libinput + depends = pipewire + depends = xorg-xwayland + depends = graphene + depends = libxkbfile + depends = libsysprof-capture + provides = libmutter-10.so + provides = mutter + conflicts = mutter + source = git+https://gitlab.gnome.org/GNOME/mutter.git#commit=1903356b45c6c884a0451580f32494ff1288656d + source = 0001-Revert-backends-native-Disable-touch-mode-with-point.patch + sha256sums = SKIP + sha256sums = fce87093b2f162114cd438a4aa5d3969a709a00416d179f76411a566e5403dae + +pkgname = mutter-auto-rotation diff --git a/0001-Revert-backends-native-Disable-touch-mode-with-point.patch b/0001-Revert-backends-native-Disable-touch-mode-with-point.patch new file mode 100644 index 000000000000..6e8e8403f3e9 --- /dev/null +++ b/0001-Revert-backends-native-Disable-touch-mode-with-point.patch @@ -0,0 +1,117 @@ +diff --git a/src/backends/native/meta-seat-impl.c b/src/backends/native/meta-seat-impl.c +index 624b2fe6f..d130d634b 100644 +--- a/src/backends/native/meta-seat-impl.c ++++ b/src/backends/native/meta-seat-impl.c +@@ -1559,30 +1559,6 @@ has_touchscreen (MetaSeatImpl *seat_impl) + return FALSE; + } + +-static inline gboolean +-device_type_is_pointer (ClutterInputDeviceType device_type) +-{ +- return device_type == CLUTTER_POINTER_DEVICE || +- device_type == CLUTTER_TOUCHPAD_DEVICE; +-} +- +-static gboolean +-has_pointer (MetaSeatImpl *seat_impl) +-{ +- GSList *l; +- +- for (l = seat_impl->devices; l; l = l->next) +- { +- ClutterInputDeviceType device_type; +- +- device_type = clutter_input_device_get_device_type (l->data); +- if (device_type_is_pointer (device_type)) +- return TRUE; +- } +- +- return FALSE; +-} +- + static gboolean + device_is_tablet_switch (MetaInputDeviceNative *device_native) + { +@@ -1622,14 +1598,11 @@ update_touch_mode (MetaSeatImpl *seat_impl) + /* If we have a tablet mode switch, honor it being unset */ + else if (seat_impl->has_tablet_switch && !seat_impl->tablet_mode_switch_state) + touch_mode = FALSE; +- /* If tablet mode is enabled, go for it */ +- else if (seat_impl->has_tablet_switch && seat_impl->tablet_mode_switch_state) +- touch_mode = TRUE; +- /* If there is no tablet mode switch (eg. kiosk machines), +- * assume touch-mode is mutually exclusive with pointers. ++ /* If tablet mode is enabled, or if there is no tablet mode switch ++ * (eg. kiosk machines), assume touch-mode. + */ + else +- touch_mode = !seat_impl->has_pointer; ++ touch_mode = TRUE; + + if (seat_impl->touch_mode != touch_mode) + { +@@ -1649,7 +1622,7 @@ evdev_add_device (MetaSeatImpl *seat_impl, + { + ClutterInputDeviceType type; + ClutterInputDevice *device; +- gboolean is_touchscreen, is_tablet_switch, is_pointer; ++ gboolean is_touchscreen, is_tablet_switch; + + device = meta_input_device_native_new_in_impl (seat_impl, libinput_device); + +@@ -1663,13 +1636,11 @@ evdev_add_device (MetaSeatImpl *seat_impl, + is_touchscreen = type == CLUTTER_TOUCHSCREEN_DEVICE; + is_tablet_switch = + device_is_tablet_switch (META_INPUT_DEVICE_NATIVE (device)); +- is_pointer = device_type_is_pointer (type); + + seat_impl->has_touchscreen |= is_touchscreen; + seat_impl->has_tablet_switch |= is_tablet_switch; +- seat_impl->has_pointer |= is_pointer; + +- if (is_touchscreen || is_tablet_switch || is_pointer) ++ if (is_touchscreen || is_tablet_switch) + update_touch_mode (seat_impl); + + return device; +@@ -1681,7 +1652,7 @@ evdev_remove_device (MetaSeatImpl *seat_impl, + { + ClutterInputDevice *device; + ClutterInputDeviceType device_type; +- gboolean is_touchscreen, is_tablet_switch, is_pointer; ++ gboolean is_touchscreen, is_tablet_switch; + + device = CLUTTER_INPUT_DEVICE (device_native); + seat_impl->devices = g_slist_remove (seat_impl->devices, device); +@@ -1690,16 +1661,13 @@ evdev_remove_device (MetaSeatImpl *seat_impl, + + is_touchscreen = device_type == CLUTTER_TOUCHSCREEN_DEVICE; + is_tablet_switch = device_is_tablet_switch (device_native); +- is_pointer = device_type_is_pointer (device_type); + + if (is_touchscreen) + seat_impl->has_touchscreen = has_touchscreen (seat_impl); + if (is_tablet_switch) + seat_impl->has_tablet_switch = has_tablet_switch (seat_impl); +- if (is_pointer) +- seat_impl->has_pointer = has_pointer (seat_impl); + +- if (is_touchscreen || is_tablet_switch || is_pointer) ++ if (is_touchscreen || is_tablet_switch) + update_touch_mode (seat_impl); + + if (seat_impl->repeat_source && seat_impl->repeat_device == device) +diff --git a/src/backends/native/meta-seat-impl.h b/src/backends/native/meta-seat-impl.h +index d3e2ab860..14ec75dc1 100644 +--- a/src/backends/native/meta-seat-impl.h ++++ b/src/backends/native/meta-seat-impl.h +@@ -100,7 +100,6 @@ struct _MetaSeatImpl + gboolean tablet_mode_switch_state; + gboolean has_touchscreen; + gboolean has_tablet_switch; +- gboolean has_pointer; + gboolean touch_mode; + gboolean input_thread_initialized; + +-- diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..0e77bac2a4f9 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,91 @@ +# Maintainer: parcimonic <aur-at_parcimonic-dot_me> +# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org> +# Contributor: Ionut Biru <ibiru@archlinux.org> +# Contributor: Michael Kanis <mkanis_at_gmx_dot_de> + +pkgbase=mutter-auto-rotation +pkgname=mutter-auto-rotation +provides=(libmutter-10.so mutter) +conflicts=(mutter) +groups=(gnome) +pkgver=42.3 +pkgrel=1 +pkgdesc="A window manager for GNOME, with touch-mode auto-rotation (reverts MR 1710)" +url="https://gitlab.gnome.org/GNOME/mutter" +arch=(x86_64) +license=(GPL) +depends=(dconf gobject-introspection-runtime gsettings-desktop-schemas + libcanberra startup-notification zenity libsm gnome-desktop + libxkbcommon-x11 gnome-settings-daemon libgudev libinput pipewire + xorg-xwayland graphene libxkbfile libsysprof-capture) +makedepends=(gobject-introspection git egl-wayland meson xorg-server + wayland-protocols sysprof gi-docgen xorg-server-xvfb) +checkdepends=(xorg-server-xvfb wireplumber python-dbusmock) +_commit=1903356b45c6c884a0451580f32494ff1288656d # tags/42.3^0 + +source=("git+https://gitlab.gnome.org/GNOME/mutter.git#commit=$_commit" + "0001-Revert-backends-native-Disable-touch-mode-with-point.patch") + +sha256sums=('SKIP' + 'fce87093b2f162114cd438a4aa5d3969a709a00416d179f76411a566e5403dae') + +pkgver() { + cd mutter + git describe --tags | sed 's/[^-]*-g/r&/;s/-/+/g' +} + +prepare() { + cd mutter + git apply ../0001-Revert-backends-native-Disable-touch-mode-with-point.patch +} + +build() { + CFLAGS="${CFLAGS/-O2/-O3} -fno-semantic-interposition" + LDFLAGS+=" -Wl,-Bsymbolic-functions" + + arch-meson mutter build \ + -D egl_device=true \ + -D wayland_eglstream=true \ + -D docs=true \ + -D installed_tests=false + meson compile -C build +} + +_check() ( + mkdir -p -m 700 "${XDG_RUNTIME_DIR:=$PWD/runtime-dir}" + glib-compile-schemas "${GSETTINGS_SCHEMA_DIR:=$PWD/build/data}" + export XDG_RUNTIME_DIR GSETTINGS_SCHEMA_DIR + + pipewire & + _p1=$! + + wireplumber & + _p2=$! + + trap "kill $_p1 $_p2; wait" EXIT + + meson test -C build --print-errorlogs -t 3 +) + +_check_disabled() { + dbus-run-session xvfb-run -s '-nolisten local +iglx -noreset' \ + bash -c "$(declare -f _check); _check" +} + +_pick() { + local p="$1" f d; shift + for f; do + d="$srcdir/$p/${f#$pkgdir/}" + mkdir -p "$(dirname "$d")" + mv "$f" "$d" + rmdir -p --ignore-fail-on-non-empty "$(dirname "$f")" + done +} + +package() { + meson install -C build --destdir "$pkgdir" + + _pick docs "$pkgdir"/usr/share/mutter-*/doc +} + +# vim:set sw=2 et: |