diff options
author | github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | 2023-04-17 18:01:41 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-17 18:01:41 +0000 |
commit | 23eaff7dae5763d1193231897ef37da6476baab2 (patch) | |
tree | 7beae4caf8e9c8019e6e28fac3a0335142b4a8ca /pkgs/development/libraries/gtk | |
parent | 91108545c409f8abd47b9cc52253427d915c530a (diff) | |
parent | 70c125225f50590626f347e047f38c905d4cbca9 (diff) |
Merge staging-next into staging
Diffstat (limited to 'pkgs/development/libraries/gtk')
-rw-r--r-- | pkgs/development/libraries/gtk/2.x.nix | 5 | ||||
-rw-r--r-- | pkgs/development/libraries/gtk/patches/2.0-gnome_bugzilla_557780_306776_freeciv_darwin.patch | 54 |
2 files changed, 55 insertions, 4 deletions
diff --git a/pkgs/development/libraries/gtk/2.x.nix b/pkgs/development/libraries/gtk/2.x.nix index 1f66917d3b2a4..4a77afa176a63 100644 --- a/pkgs/development/libraries/gtk/2.x.nix +++ b/pkgs/development/libraries/gtk/2.x.nix @@ -46,10 +46,7 @@ stdenv.mkDerivation (finalAttrs: { ./patches/2.0-immodules.cache.patch ./patches/gtk2-theme-paths.patch ] ++ lib.optionals stdenv.isDarwin [ - (fetchpatch { - url = "https://bug557780.bugzilla-attachments.gnome.org/attachment.cgi?id=306776"; - sha256 = "0sp8f1r5c4j2nlnbqgv7s7nxa4cfwigvm033hvhb1ld652pjag4r"; - }) + ./patches/2.0-gnome_bugzilla_557780_306776_freeciv_darwin.patch ./patches/2.0-darwin-x11.patch ]; diff --git a/pkgs/development/libraries/gtk/patches/2.0-gnome_bugzilla_557780_306776_freeciv_darwin.patch b/pkgs/development/libraries/gtk/patches/2.0-gnome_bugzilla_557780_306776_freeciv_darwin.patch new file mode 100644 index 0000000000000..3b1c080abf083 --- /dev/null +++ b/pkgs/development/libraries/gtk/patches/2.0-gnome_bugzilla_557780_306776_freeciv_darwin.patch @@ -0,0 +1,54 @@ +From 8b822ab0060acdf4217f589411fe71574cbb09c0 Mon Sep 17 00:00:00 2001 +From: Daniel Trebbien <dtrebbien@gmail.com> +Date: Fri, 3 Jul 2015 12:08:18 -0400 +Subject: [PATCH] quartz: Bug 557780 - Missing support for depth == 1 in + gdk_image_new_for_depth() + +When the gtk2 client of Freeciv is started, an assertion failure is seen +immediately and the client stops: +"Gdk:ERROR:gdkimage-quartz.c:325:_gdk_image_new_for_depth: assertion +failed: (depth == 24 || depth == 32)" + +In this case, _gdk_image_new_for_depth() is being called from +_gdk_quartz_image_copy_to_image(). The GdkImage passed to this function +is NULL so a new GdkImage is created. However, the depth of the passed +GdkDrawable is 1 and this is passed directly as the `depth' parameter to +_gdk_image_new_for_depth(), leading to the assertion failure. + +In _gdk_quartz_image_copy_to_image(), rather than directly pass the +GdkDrawable's depth to _gdk_image_new_for_depth(), if the depth is 1, +then create the new GdkImage with depth 24. The case where the depth is +1 is already handled in _gdk_quartz_image_copy_to_image(). + +This allows the Freeciv 2.5.0 gtk2 client to start and play a game. +--- + gdk/quartz/gdkimage-quartz.c | 13 +++++++++---- + 1 file changed, 9 insertions(+), 4 deletions(-) + +diff --git a/gdk/quartz/gdkimage-quartz.c b/gdk/quartz/gdkimage-quartz.c +index 493efba..853ef61 100644 +--- a/gdk/quartz/gdkimage-quartz.c ++++ b/gdk/quartz/gdkimage-quartz.c +@@ -43,10 +43,15 @@ _gdk_quartz_image_copy_to_image (GdkDrawable *drawable, + + screen = gdk_drawable_get_screen (drawable); + if (!image) +- image = _gdk_image_new_for_depth (screen, GDK_IMAGE_FASTEST, NULL, +- width, height, +- gdk_drawable_get_depth (drawable)); +- ++ { ++ gint drawable_depth = gdk_drawable_get_depth (drawable); ++ if (drawable_depth == 1) ++ drawable_depth = 24; ++ image = _gdk_image_new_for_depth (screen, GDK_IMAGE_FASTEST, NULL, ++ width, height, ++ drawable_depth); ++ } ++ + if (GDK_IS_PIXMAP_IMPL_QUARTZ (drawable)) + { + GdkPixmapImplQuartz *pix_impl; +-- +2.3.2 (Apple Git-55) + |