diff options
-rw-r--r-- | .SRCINFO | 80 | ||||
-rw-r--r-- | 0001-entry-Undo-ABI-breakage-from-addition-of-insert_emoj.patch | 37 | ||||
-rw-r--r-- | 0001-gdkscreen-x11-Fix-screen-and-monitor-size-calculatio.patch | 83 | ||||
-rw-r--r-- | PKGBUILD | 231 | ||||
-rw-r--r-- | add_ubuntu_headers_to_meson_build.patch | 21 | ||||
-rw-r--r-- | gtk-update-icon-cache.hook | 13 | ||||
-rw-r--r-- | gtk-update-icon-cache.script | 10 | ||||
-rw-r--r-- | gtk3.install | 10 | ||||
-rw-r--r-- | settings.ini | 4 | ||||
-rw-r--r-- | ubuntu_gtk_custom_menu_items.patch | 185 |
10 files changed, 178 insertions, 496 deletions
@@ -1,6 +1,6 @@ pkgbase = gtk3-ubuntu pkgdesc = GObject-based multi-platform toolkit - pkgver = 3.22.30 + pkgver = 3.24.38 pkgrel = 1 url = http://www.gtk.org/ arch = x86_64 @@ -10,19 +10,21 @@ pkgbase = gtk3-ubuntu makedepends = gtk-doc makedepends = glib2-docs makedepends = sassc + makedepends = meson + makedepends = wayland-protocols depends = adwaita-icon-theme depends = at-spi2-atk depends = atk depends = cairo depends = cantarell-fonts - depends = colord depends = dconf depends = desktop-file-utils + depends = fribidi + depends = iso-codes depends = gdk-pixbuf2 depends = gtk-update-icon-cache - depends = json-glib - depends = libcanberra depends = libcloudproviders + depends = libcolord depends = libcups depends = libepoxy depends = librsvg @@ -35,68 +37,26 @@ pkgbase = gtk3-ubuntu depends = libxrandr depends = mesa depends = pango - depends = rest depends = shared-mime-info + depends = tracker3 depends = wayland - depends = wayland-protocols - depends = gtk-update-icon-cache - source = git+https://gitlab.gnome.org/GNOME/gtk.git#commit=2e7ac262be15fb402c4103d28533c6c6d955bf65 - source = settings.ini + source = git+https://gitlab.gnome.org/GNOME/gtk.git#commit=3e6fd55ee00d4209ce2f2af292829e4d6f674adc source = gtk-query-immodules-3.0.hook - source = gtk-update-icon-cache.hook - source = gtk-update-icon-cache.script - source = https://launchpad.net/ubuntu/+archive/primary/+files/gtk+3.0_3.22.30-1ubuntu1.debian.tar.xz - sha512sums = SKIP - sha512sums = ad2c0b0388f4169592b9574f0b3db673a969b7c4721548c4ac7c438eddbcdc378fcaac04e2b6c858a1562cc23ddf4804e5f7be08068340b7c9365e2b11ddcfb8 - sha512sums = f0ffd95544863f2e10fda81488b4727aa9a8a35a7d39fb96872db6664d03442db2b58af788b5990825c7b3a83681f7220ca481409cca5421dfb39b9a3bbac9ac - sha512sums = abfd73de4faa6f53784182800395aa3c39bb98e15a0eb300fb4142073ff7ce565a0836a2363393b2f132060b5293dbc0c30c380a023f38d5bd39c62cb58389c2 - sha512sums = 5cd50d93bb6bc203438a2a0764bd717409658e124058b18a1da26a21f10ef7564a16f32fc0633a68b45b2e303fa63a5efefeadd6b0bf1d7f474556df8cdb6c58 - sha512sums = 8baf8e62ed71cf1fc8d172725749b4f63d1d3c5f9303e1b1874a97df1250139e7aae777b3053ad5dd7c5af7267832af1e9559db6b6501af294c8159d1b1c6fd4 + source = add_ubuntu_headers_to_meson_build.patch + source = https://launchpad.net/ubuntu/+archive/primary/+files/gtk+3.0_3.24.38-5ubuntu2.debian.tar.xz + sha256sums = SKIP + sha256sums = de46e5514ff39a7a65e01e485e874775ab1c0ad20b8e94ada43f4a6af1370845 + sha256sums = 5d283c23657a2301fec22cec5130ea7d5edb659e0e50e7a2a5e87fea234893af + sha256sums = d6c6614a2c9915dc728745d225970ab9eac7f1b973cdf60afd4fd1c827f4cc84 pkgname = gtk3-ubuntu install = gtk3.install - depends = adwaita-icon-theme - depends = at-spi2-atk - depends = atk - depends = cairo - depends = cantarell-fonts - depends = colord - depends = dconf - depends = desktop-file-utils - depends = gdk-pixbuf2 - depends = gtk-update-icon-cache - depends = json-glib - depends = libcanberra - depends = libcloudproviders - depends = libcups - depends = libepoxy - depends = librsvg - depends = libxcomposite - depends = libxcursor - depends = libxdamage - depends = libxi - depends = libxinerama - depends = libxkbcommon - depends = libxrandr - depends = mesa - depends = pango - depends = rest - depends = shared-mime-info - depends = wayland - depends = wayland-protocols - depends = gtk-update-icon-cache - depends = gtk-update-icon-cache - provides = gtk3 - provides = gtk3-print-backends + optdepends = evince: Default print preview command + provides = gtk3=3.24.38 + provides = gtk3-print-backends=3.24.38 + provides = libgtk-3.so + provides = libgdk-3.so + provides = libgailutil-3.so conflicts = gtk3 conflicts = gtk3-print-backends replaces = gtk3-print-backends<=3.22.26-1 - -pkgname = gtk-update-icon-cache-ubuntu - pkgdesc = GTK+ icon cache updater - depends = gdk-pixbuf2 - depends = librsvg - depends = hicolor-icon-theme - provides = gtk-update-icon-cache - conflicts = gtk-update-icon-cache - diff --git a/0001-entry-Undo-ABI-breakage-from-addition-of-insert_emoj.patch b/0001-entry-Undo-ABI-breakage-from-addition-of-insert_emoj.patch deleted file mode 100644 index 7b7a9e0f70e1..000000000000 --- a/0001-entry-Undo-ABI-breakage-from-addition-of-insert_emoj.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 9577618e2ae679988231cfa2162eb48cdb6ce5a0 Mon Sep 17 00:00:00 2001 -Message-Id: <9577618e2ae679988231cfa2162eb48cdb6ce5a0.1511732020.git.jan.steffens@gmail.com> -From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com> -Date: Sun, 26 Nov 2017 22:32:36 +0100 -Subject: [PATCH] entry: Undo ABI breakage from addition of insert_emoji - ---- - gtk/gtkentry.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/gtk/gtkentry.h b/gtk/gtkentry.h -index 073e703d0deea6a6..0372752f2963c940 100644 ---- a/gtk/gtkentry.h -+++ b/gtk/gtkentry.h -@@ -146,19 +146,19 @@ struct _GtkEntryClass - void (* copy_clipboard) (GtkEntry *entry); - void (* paste_clipboard) (GtkEntry *entry); - void (* toggle_overwrite) (GtkEntry *entry); -- void (* insert_emoji) (GtkEntry *entry); - - /* hooks to add other objects beside the entry (like in GtkSpinButton) */ - void (* get_text_area_size) (GtkEntry *entry, - gint *x, - gint *y, - gint *width, - gint *height); - void (* get_frame_size) (GtkEntry *entry, - gint *x, - gint *y, - gint *width, - gint *height); -+ void (* insert_emoji) (GtkEntry *entry); - - /*< private >*/ - --- -2.15.0 diff --git a/0001-gdkscreen-x11-Fix-screen-and-monitor-size-calculatio.patch b/0001-gdkscreen-x11-Fix-screen-and-monitor-size-calculatio.patch deleted file mode 100644 index 5d6210e54529..000000000000 --- a/0001-gdkscreen-x11-Fix-screen-and-monitor-size-calculatio.patch +++ /dev/null @@ -1,83 +0,0 @@ -From 0d945f06faee49788191e3e28f797f72959b3583 Mon Sep 17 00:00:00 2001 -From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com> -Date: Mon, 10 Oct 2016 16:34:28 +0200 -Subject: [PATCH] gdkscreen-x11: Fix screen and monitor size calculation - -The monitors are already in scaled pixels, so scaling again when retrieving -the screen size is wrong. - -With GDK_SCALE unset, the initial monitor sizes are unscaled, and when the -xsettings client sets a scale > 1, the monitor sizes should be updated. - -The end result is that the monitor sizes start out wrong, and get -corrected on the first xrandr event, while the screen size starts out -right and becomes wrong after the event. - -This patch fixes Firefox misplacing menus and popovers when the xrandr -configuration changes while it is running. - -Fix for the X11 side of - -https://bugzilla.gnome.org/show_bug.cgi?id=772202 ---- - gdk/x11/gdkscreen-x11.c | 16 ++++------------ - 1 file changed, 4 insertions(+), 12 deletions(-) - -diff --git a/gdk/x11/gdkscreen-x11.c b/gdk/x11/gdkscreen-x11.c -index 7738a47adfed1484..28a43a69bedbe955 100644 ---- a/gdk/x11/gdkscreen-x11.c -+++ b/gdk/x11/gdkscreen-x11.c -@@ -49,6 +49,7 @@ - static void gdk_x11_screen_dispose (GObject *object); - static void gdk_x11_screen_finalize (GObject *object); - static void init_randr_support (GdkScreen *screen); -+static void process_monitors_change (GdkScreen *screen); - - enum - { -@@ -82,13 +83,13 @@ gdk_x11_screen_get_display (GdkScreen *screen) - gint - gdk_x11_screen_get_width (GdkScreen *screen) - { -- return GDK_X11_SCREEN (screen)->width / GDK_X11_SCREEN (screen)->window_scale; -+ return GDK_X11_SCREEN (screen)->width; - } - - gint - gdk_x11_screen_get_height (GdkScreen *screen) - { -- return GDK_X11_SCREEN (screen)->height / GDK_X11_SCREEN (screen)->window_scale; -+ return GDK_X11_SCREEN (screen)->height; - } - - static gint -@@ -906,10 +907,8 @@ void - _gdk_x11_screen_set_window_scale (GdkX11Screen *x11_screen, - gint scale) - { -- GdkX11Display *x11_display = GDK_X11_DISPLAY (x11_screen->display); - GList *toplevels, *l; - GdkWindow *root; -- int i; - - if (x11_screen->window_scale == scale) - return; -@@ -928,14 +927,7 @@ _gdk_x11_screen_set_window_scale (GdkX11Screen *x11_screen, - _gdk_x11_window_set_window_scale (window, scale); - } - -- for (i = 0; i < x11_display->monitors->len; i++) -- { -- GdkMonitor *monitor = GDK_MONITOR (x11_display->monitors->pdata[i]); -- -- gdk_monitor_set_scale_factor (monitor, scale); -- } -- -- g_signal_emit_by_name (GDK_SCREEN (x11_screen), "monitors-changed"); -+ process_monitors_change (GDK_SCREEN (x11_screen)); - } - - /* --- -2.10.1 - @@ -1,44 +1,34 @@ -# Maintainer: Michael Healy <horsemanoffaith@gmail.com> +# Maintainer: Que Quotion <quequotion@bugmenot.com> +# Contributor: Michael Healy <horsemanoffaith@gmail.com> +# Contributor: Xiao-Long Chen <chenxiaolong@cxl.epac.to> # Contributor: Christopher Reimer <github@creimer.net> - -# vercheck-pkgbuild: auto -# vercheck-ubuntu: name=gtk+3.0, repo=bionic -# vercheck-archlinux: name=gtk3, repo=extra, arch=x86_64 -# vercheck-gnome: name=gtk+, majorver=3.22 -# vercheck-ppa: name=gtk+3.0, url=ppa:gnome3-team/gnome3-staging - -_use_ppa=true - -pkgbase=gtk3-ubuntu -pkgname=(gtk3-ubuntu gtk-update-icon-cache-ubuntu) -_ubuntu_ver=3.22.30 -_ubuntu_rel=1ubuntu1 -pkgver=3.22.30 +# Contributor: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com> +# Contributor: Ionut Biru <ibiru@archlinux.org> +# Maintainer: Solomon Choina <shlomochoina@gmail.com> +pkgname=gtk3-ubuntu +_ubuntu_ver=3.24.38 +_ubuntu_rel=5ubuntu2 +_import_pkgver=3.24.38 +pkgver=3.24.38 pkgrel=1 pkgdesc="GObject-based multi-platform toolkit" arch=(x86_64) url="http://www.gtk.org/" -depends=(adwaita-icon-theme at-spi2-atk atk cairo cantarell-fonts colord dconf desktop-file-utils - gdk-pixbuf2 gtk-update-icon-cache json-glib libcanberra libcloudproviders libcups libepoxy - librsvg libxcomposite libxcursor libxdamage libxi libxinerama libxkbcommon libxrandr mesa - pango rest shared-mime-info wayland wayland-protocols gtk-update-icon-cache) -makedepends=(gobject-introspection git gtk-doc glib2-docs sassc) +depends=(adwaita-icon-theme {at-spi2-,}atk cairo cantarell-fonts dconf +desktop-file-utils fribidi iso-codes gdk-pixbuf2 gtk-update-icon-cache +lib{cloudproviders,colord,cups,epoxy,rsvg,xcomposite,xcursor,xdamage,xi,xinerama,xkbcommon,xrandr} +mesa pango shared-mime-info tracker3 wayland) +makedepends=(gobject-introspection git gtk-doc glib2-docs sassc meson wayland-protocols) license=(LGPL) -_commit=2e7ac262be15fb402c4103d28533c6c6d955bf65 # tags/3.22.30^0 +_commit=3e6fd55ee00d4209ce2f2af292829e4d6f674adc # tags/3.24.38^0 source=("git+https://gitlab.gnome.org/GNOME/gtk.git#commit=$_commit" - settings.ini - gtk-query-immodules-3.0.hook - gtk-update-icon-cache.hook - gtk-update-icon-cache.script) - -source+=("https://launchpad.net/ubuntu/+archive/primary/+files/gtk+3.0_${_ubuntu_ver:-${pkgver}}-${_ubuntu_rel}.debian.tar.xz") - -sha512sums=('SKIP' - 'ad2c0b0388f4169592b9574f0b3db673a969b7c4721548c4ac7c438eddbcdc378fcaac04e2b6c858a1562cc23ddf4804e5f7be08068340b7c9365e2b11ddcfb8' - 'f0ffd95544863f2e10fda81488b4727aa9a8a35a7d39fb96872db6664d03442db2b58af788b5990825c7b3a83681f7220ca481409cca5421dfb39b9a3bbac9ac' - 'abfd73de4faa6f53784182800395aa3c39bb98e15a0eb300fb4142073ff7ce565a0836a2363393b2f132060b5293dbc0c30c380a023f38d5bd39c62cb58389c2' - '5cd50d93bb6bc203438a2a0764bd717409658e124058b18a1da26a21f10ef7564a16f32fc0633a68b45b2e303fa63a5efefeadd6b0bf1d7f474556df8cdb6c58' - '8baf8e62ed71cf1fc8d172725749b4f63d1d3c5f9303e1b1874a97df1250139e7aae777b3053ad5dd7c5af7267832af1e9559db6b6501af294c8159d1b1c6fd4') + gtk-query-immodules-3.0.hook + add_ubuntu_headers_to_meson_build.patch) +source+=("https://launchpad.net/ubuntu/+archive/primary/+files/gtk+3.0_${_ubuntu_ver:-${import_pkgver}}-${_ubuntu_rel}.debian.tar.xz") +sha256sums=('SKIP' + 'de46e5514ff39a7a65e01e485e874775ab1c0ad20b8e94ada43f4a6af1370845' + '5d283c23657a2301fec22cec5130ea7d5edb659e0e50e7a2a5e87fea234893af' + 'd6c6614a2c9915dc728745d225970ab9eac7f1b973cdf60afd4fd1c827f4cc84') pkgver() { cd gtk @@ -46,78 +36,131 @@ pkgver() { } prepare() { - cd gtk - - local patches=( - 016_no_offscreen_widgets_grabbing.patch - 017_no_offscreen_device_grabbing.patch - 060_ignore-random-icons.patch - 073_treeview_almost_fixed.patch - no-accessibility-dump.patch - bzg_gtkcellrenderer_grabbing_modifier.patch - print-dialog-show-options-of-remote-dnssd-printers.patch - uimanager-guard-against-nested-node-updates.patch - x-canonical-accel.patch - message-dialog-restore-traditional-look-on-unity.patch - 0001-calendar-always-emit-day-selected-once.patch - 0001-gtkwindow-set-transparent-background-color.patch - ubuntu_gtk_custom_menu_items.patch - unity-border-radius.patch - unity-headerbar-maximized-mode.patch - ) - - for i in "${patches[@]}"; do - msg "Applying ${i} ..." - patch -p1 -i "../debian/patches/${i}" - done - - NOCONFIGURE=1 ./autogen.sh + cd gtk + + local patches=( + Use-correct-stat-struct-for-ftw.patch + Make-sure-that-the-charcode-is-signless.patch + Update-Turkish-translation.patch + Fix-a-typo.patch + This-commit-fixes-a-performance-issue-on-X11-systems-in-r.patch + x11-Trap-XRandr-errors-when-getting-outputs-during-init-a.patch + gtkmountoperation-avoid-SEGV-after-bad-password-input.patch + ScrolledWindow-Frame-on-viewport-is-not-optional.patch + popover-Remove-useless-if-case.patch + Popover-Clarify-guard-out-rect-of-get_pointing_to.patch + Update-Czech-translation.patch + Update-Slovak-translation.patch + gdk-wayland-Create-pad-devices-on-enter.patch + gdk-wayland-Ensure-device-added-removed-emission-in-GdkSe.patch + gdk-wayland-Return-pad-devices-querying-for-all-devices.patch + Update-Catalan-translation.patch + Update-British-English-translation.patch + gdkgl-Check-for-GLsync-before-using-it.patch + gdk-wayland-Switch-behavior-of-BTN_STYLUS-STYLUS2-as-midd.patch + a11y-atspi-Fix-reporting-table-cell-pos-at-index-0-0.patch + GdkWindow-Check-for-offscreen-windows-in-set_transient_fo.patch + GtkMenu-Take-offscreen-windows-in-account-for-positioning.patch + Update-fa.po.patch + Update-Spanish-translation.patch + GtkApplicationImplDBus-Cancel-DBus-method-calls-on-shutdo.patch + Update-Greek-translation.patch + Update-Slovenian-translation.patch + Update-Romanian-translation.patch + Update-Turkish-translation-1.patch + Update-Turkish-translation-2.patch + Update-Georgian-translation.patch + Update-Kazakh-translation.patch + Update-Georgian-translation-1.patch + Update-fa.po-1.patch + Fix-_gtk_get_slowdown.patch + Update-Punjabi-translation.patch + Update-Georgian-translation-2.patch + Update-Korean-translation.patch + 016_no_offscreen_widgets_grabbing.patch + 017_no_offscreen_device_grabbing.patch + 060_ignore-random-icons.patch + reftest_compare_surfaces-Report-how-much-the-images-diffe.patch + reftests-Allow-minor-differences-to-be-tolerated.patch + 073_treeview_almost_fixed.patch + bzg_gtkcellrenderer_grabbing_modifier.patch + ubuntu_gtk_custom_menu_items.patch + print-dialog-show-options-of-remote-dnssd-printers.patch + uimanager-guard-against-nested-node-updates.patch + x-canonical-accel.patch + message-dialog-restore-traditional-look-on-unity.patch + 0001-gtk-reftest-Force-icon-theme-to-Adwaita.patch + 0001-calendar-always-emit-day-selected-once.patch + 0001-gtkwindow-set-transparent-background-color.patch + unity-border-radius.patch + unity-headerbar-maximized-mode.patch + gitlab_opengl_fallback.patch + ) + + for i in "${patches[@]}"; do + msg "Applying ${i} ..." + patch -p1 -i "../debian/patches/${i}" + done + + #Ubuntu is still using autoconf, push ahead to meson + patch -Np1 < ../add_ubuntu_headers_to_meson_build.patch } build() { - cd gtk + CFLAGS+=" -DG_DISABLE_CAST_CHECKS" - CXX=/bin/false ./configure --prefix=/usr \ - --sysconfdir=/etc \ - --localstatedir=/var \ - --disable-schemas-compile \ - --enable-x11-backend \ - --enable-broadway-backend \ - --enable-wayland-backend \ - --enable-gtk-doc + local meson_options=( + -D broadway_backend=true + -D cloudproviders=true + -D tracker3=true + -D colord=yes + -D gtk_doc=true + -D man=true + ) - #https://bugzilla.gnome.org/show_bug.cgi?id=655517 - sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool + arch-meson gtk build "${meson_options[@]}" - make + meson compile -C build +} + +_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_gtk3-ubuntu() { - depends+=(gtk-update-icon-cache) - provides=(gtk3 gtk3-print-backends) - conflicts=(gtk3 gtk3-print-backends) - replaces=("gtk3-print-backends<=3.22.26-1") - install=gtk3.install + optdepends=('evince: Default print preview command') + provides=(gtk3{,-print-backends}=$pkgver lib{gtk,gdk,gailutil}-3.so) + conflicts=(gtk3{,-print-backends}) + replaces=("gtk3-print-backends<=3.22.26-1") + install=gtk3.install - cd gtk - make DESTDIR="$pkgdir" install + meson install -C build --destdir "$pkgdir" - install -Dm644 ../settings.ini "$pkgdir/usr/share/gtk-3.0/settings.ini" - install -Dm644 ../gtk-query-immodules-3.0.hook "$pkgdir/usr/share/libalpm/hooks/gtk-query-immodules-3.0.hook" + install -Dm644 /dev/stdin "$pkgdir/usr/share/gtk-3.0/settings.ini" <<END +[Settings] +gtk-icon-theme-name = Adwaita +gtk-theme-name = Adwaita +gtk-font-name = Cantarell 11 +END - # split this out to use with gtk2 too - rm "$pkgdir/usr/bin/gtk-update-icon-cache" -} + install -Dt "$pkgdir/usr/share/libalpm/hooks" -m644 gtk-query-immodules-3.0.hook -package_gtk-update-icon-cache-ubuntu() { - pkgdesc="GTK+ icon cache updater" - provides=(gtk-update-icon-cache) - conflicts=(gtk-update-icon-cache) - depends=(gdk-pixbuf2 librsvg hicolor-icon-theme) + cd "$pkgdir" - cd gtk - install -D gtk/gtk-update-icon-cache "$pkgdir/usr/bin/gtk-update-icon-cache" - install -Dm644 ../gtk-update-icon-cache.hook "$pkgdir/usr/share/libalpm/hooks/gtk-update-icon-cache.hook" - install -D ../gtk-update-icon-cache.script "$pkgdir/usr/share/libalpm/scripts/gtk-update-icon-cache" -} + rm usr/bin/gtk-update-icon-cache + rm usr/share/man/man1/gtk-update-icon-cache.1 + + _pick docs usr/share/gtk-doc + _pick demo usr/bin/gtk3-{demo,demo-application,icon-browser,widget-factory} + _pick demo usr/share/applications/gtk3-{demo,icon-browser,widget-factory}.desktop + _pick demo usr/share/glib-2.0/schemas/org.gtk.{Demo,exampleapp}.gschema.xml + _pick demo usr/share/icons/hicolor/*/apps/gtk3-{demo,widget-factory}[-.]* + _pick demo usr/share/man/man1/gtk3-{demo,demo-application,icon-browser,widget-factory}.1 +} diff --git a/add_ubuntu_headers_to_meson_build.patch b/add_ubuntu_headers_to_meson_build.patch new file mode 100644 index 000000000000..83628e544bb2 --- /dev/null +++ b/add_ubuntu_headers_to_meson_build.patch @@ -0,0 +1,21 @@ +--- a/gtk/meson.build 2022-02-18 21:58:42.158880825 +0900 ++++ b/gtk/meson.build 2022-02-18 22:17:13.959003252 +0900 +@@ -17,6 +17,7 @@ + + # List of sources to build the library from + gtk_sources = files( ++ 'ubuntumenuitemfactory.c', + 'gtkactionmuxer.c', + 'gtkactionobserver.c', + 'gtkactionobservable.c', +--- a/gtk/meson.build 2022-02-18 21:25:46.058931885 +0900 ++++ b/gtk/meson.build 2022-02-18 21:51:15.638021535 +0900 +@@ -396,6 +396,8 @@ + 'gtk.h', + 'gtk-autocleanups.h', + 'gtkx-autocleanups.h', ++ 'ubuntu-private.h', ++ 'ubuntumenuitemfactory.h', + 'gtk-a11y.h', + 'gtkaboutdialog.h', + 'gtkaccelgroup.h', diff --git a/gtk-update-icon-cache.hook b/gtk-update-icon-cache.hook deleted file mode 100644 index fca3fdc47dbb..000000000000 --- a/gtk-update-icon-cache.hook +++ /dev/null @@ -1,13 +0,0 @@ -[Trigger] -Type = File -Operation = Install -Operation = Upgrade -Operation = Remove -Target = usr/share/icons/*/ -Target = !usr/share/icons/*/?* - -[Action] -Description = Updating icon theme caches... -When = PostTransaction -Exec = /usr/share/libalpm/scripts/gtk-update-icon-cache -NeedsTargets diff --git a/gtk-update-icon-cache.script b/gtk-update-icon-cache.script deleted file mode 100644 index ee0f1d12d0b7..000000000000 --- a/gtk-update-icon-cache.script +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -while read -r f; do - if [[ -e ${f}index.theme ]]; then - gtk-update-icon-cache -q "$f" - elif [[ -d $f ]]; then - rm -f "${f}icon-theme.cache" - rmdir --ignore-fail-on-non-empty "$f" - fi -done diff --git a/gtk3.install b/gtk3.install index a0e620af1759..c0c44539de6f 100644 --- a/gtk3.install +++ b/gtk3.install @@ -1,13 +1,3 @@ -post_install() { - echo "If you want to use the global menus and you are not using Unity, you will need" - echo "to add the following to ~/.config/gtk-3.0/settings.ini" - echo - echo "********************************" - echo "[Settings]" - echo "gtk-shell-shows-menubar = 1" - echo "********************************" -} - pre_remove() { rm -f /usr/lib/gtk-3.0/3.0.0/immodules.cache } diff --git a/settings.ini b/settings.ini deleted file mode 100644 index 921d1ddeec01..000000000000 --- a/settings.ini +++ /dev/null @@ -1,4 +0,0 @@ -[Settings] -gtk-icon-theme-name = Adwaita -gtk-theme-name = Adwaita -gtk-font-name = Cantarell 11 diff --git a/ubuntu_gtk_custom_menu_items.patch b/ubuntu_gtk_custom_menu_items.patch deleted file mode 100644 index 70d9d0326b6a..000000000000 --- a/ubuntu_gtk_custom_menu_items.patch +++ /dev/null @@ -1,185 +0,0 @@ -From 59168f3c1a72f610b693cd1ed4cfa5fac281079a Mon Sep 17 00:00:00 2001 -From: Lars Uebernickel <lars.uebernickel@canonical.com> -Date: Wed, 6 Nov 2013 14:48:19 +0100 -Subject: [PATCH] Add UbuntuMenuItemFactory - -UbuntuMenuItemFactory is an interface for creating widgets for menu -items in a GMenuModel that have an 'x-canonical-type' attribute. - -It is needed by unity and should not be considered public API. ---- - gtk/Makefile.am | 3 ++ - gtk/gtkmenushell.c | 69 ++++++++++++++++++++++++++++++++++++++++++++ - gtk/gtkmenutrackeritem.c | 16 +++++++++++ - gtk/gtkmenutrackeritem.h | 4 +++ - gtk/ubuntu-private.h | 32 +++++++++++++++++++++ - gtk/ubuntumenuitemfactory.c | 70 +++++++++++++++++++++++++++++++++++++++++++++ - gtk/ubuntumenuitemfactory.h | 61 +++++++++++++++++++++++++++++++++++++++ - 7 files changed, 255 insertions(+) - create mode 100644 gtk/ubuntu-private.h - create mode 100644 gtk/ubuntumenuitemfactory.c - create mode 100644 gtk/ubuntumenuitemfactory.h - -diff --git a/gtk/Makefile.am b/gtk/Makefile.am -index 51153e6..3c01638 100644 ---- a/gtk/Makefile.am -+++ b/gtk/Makefile.am -@@ -108,6 +108,8 @@ include $(srcdir)/inspector/Makefile.inc - gtk_public_h_sources = \ - gtk.h \ - gtk-autocleanups.h \ -+ ubuntu-private.h \ -+ ubuntumenuitemfactory.h \ - gtkx.h \ - gtkx-autocleanups.h \ - gtk-a11y.h \ -@@ -528,6 +530,7 @@ gtk_base_c_sources = \ - $(a11y_c_sources) \ - $(deprecated_c_sources) \ - $(inspector_c_sources) \ -+ ubuntumenuitemfactory.c \ - gtkactionmuxer.c \ - gtkactionobserver.c \ - gtkactionobservable.c \ -diff --git a/gtk/gtkmenushell.c b/gtk/gtkmenushell.c -index e1ba138..6d7a2f6 100644 ---- a/gtk/gtkmenushell.c -+++ b/gtk/gtkmenushell.c -@@ -80,6 +80,8 @@ - - #include "a11y/gtkmenushellaccessible.h" - -+#include "ubuntu-private.h" -+ - - #define MENU_SHELL_TIMEOUT 500 - #define MENU_POPUP_DELAY 225 -@@ -2044,6 +2046,58 @@ gtk_menu_shell_tracker_remove_func (gint position, - gtk_widget_destroy (child); - } - -+static GtkWidget * -+create_custom_menu_item (GMenuItem *item, -+ GtkWidget *parent, -+ const gchar *action_namespace) -+{ -+ gchar *type; -+ GActionGroup *actions; -+ GtkMenuItem *widget = NULL; -+ GList *it; -+ -+ g_menu_item_get_attribute (item, "x-canonical-type", "s", &type); -+ -+ if (action_namespace) -+ { -+ gchar *action; -+ -+ /* Rewrite the menu item to include the fully qualified action -+ * name to make writing widgets easier. This won't break, as -+ * we don't use the tracker item for custom items. -+ */ -+ if (g_menu_item_get_attribute (item, "action", "s", &action)) -+ { -+ gchar *fullname; -+ -+ fullname = g_strconcat (action_namespace, ".", action, NULL); -+ g_menu_item_set_attribute (item, "action", "s", fullname); -+ -+ g_free (fullname); -+ g_free (action); -+ } -+ } -+ -+ /* Passing the parent muxer is wrong, but we'll only have access -+ * to the menuitem's muxer after the widget has been created. -+ * Thus we'd need some other form of passing the action group to -+ * the widget, which would complicate things for no practical -+ * reason: the panel service is the only consumer of this API and -+ * it will never call gtk_widget_insert_action_group() on the -+ * returned menu item. -+ */ -+ actions = G_ACTION_GROUP (_gtk_widget_get_action_muxer (parent, TRUE)); -+ -+ for (it = ubuntu_menu_item_factory_get_all (); it != NULL && widget == NULL; it = it->next) -+ widget = ubuntu_menu_item_factory_create_menu_item (it->data, type, item, actions); -+ -+ if (widget == NULL) -+ g_warning ("Cannot create custom menu item of type '%s'", type); -+ -+ g_free (type); -+ return GTK_WIDGET (widget); -+} -+ - static void - gtk_menu_shell_tracker_insert_func (GtkMenuTrackerItem *item, - gint position, -@@ -2051,6 +2105,9 @@ gtk_menu_shell_tracker_insert_func (GtkMenuTrackerItem *item, - { - GtkMenuShell *menu_shell = user_data; - GtkWidget *widget; -+ GMenuItem *menuitem; -+ -+ menuitem = gtk_menu_tracker_item_get_menu_item (item); - - if (gtk_menu_tracker_item_get_is_separator (item)) - { -@@ -2112,6 +2169,18 @@ gtk_menu_shell_tracker_insert_func (GtkMenuTrackerItem *item, - - gtk_widget_show (widget); - } -+ else if (g_menu_item_get_attribute (menuitem, "x-canonical-type", "s", NULL)) -+ { -+ const gchar *namespace; -+ -+ namespace = gtk_menu_tracker_item_get_action_namespace (item); -+ widget = create_custom_menu_item (menuitem, GTK_WIDGET (menu_shell), namespace); -+ -+ if (widget == NULL) -+ return; -+ -+ gtk_widget_show (widget); -+ } - else - { - widget = gtk_model_menu_item_new (); -diff --git a/gtk/gtkmenutrackeritem.c b/gtk/gtkmenutrackeritem.c -index c304b66..cd0c796 100644 ---- a/gtk/gtkmenutrackeritem.c -+++ b/gtk/gtkmenutrackeritem.c -@@ -979,3 +979,19 @@ gtk_menu_tracker_item_may_disappear (GtkMenuTrackerItem *self) - { - return self->hidden_when != HIDDEN_NEVER; - } -+ -+GMenuItem * -+gtk_menu_tracker_item_get_menu_item (GtkMenuTrackerItem *self) -+{ -+ g_return_val_if_fail (GTK_IS_MENU_TRACKER_ITEM (self), NULL); -+ -+ return self->item; -+} -+ -+const gchar * -+gtk_menu_tracker_item_get_action_namespace (GtkMenuTrackerItem *self) -+{ -+ g_return_val_if_fail (GTK_IS_MENU_TRACKER_ITEM (self), NULL); -+ -+ return self->action_namespace; -+} -diff --git a/gtk/gtkmenutrackeritem.h b/gtk/gtkmenutrackeritem.h -index 6b4fcb5..d74fe92 100644 ---- a/gtk/gtkmenutrackeritem.h -+++ b/gtk/gtkmenutrackeritem.h -@@ -92,4 +92,8 @@ void gtk_menu_tracker_item_request_submenu_shown (GtkMenu - - gboolean gtk_menu_tracker_item_get_submenu_shown (GtkMenuTrackerItem *self); - -+GMenuItem * gtk_menu_tracker_item_get_menu_item (GtkMenuTrackerItem *self); -+ -+const gchar * gtk_menu_tracker_item_get_action_namespace (GtkMenuTrackerItem *self); -+ - #endif - --- -2.1.4 - |