diff -Nru metacity-3.18.5/configure metacity-3.18.6/configure --- metacity-3.18.5/configure 2016-06-25 09:19:54.000000000 +0000 +++ metacity-3.18.6/configure 2016-07-12 20:33:54.000000000 +0000 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for metacity 3.18.5. +# Generated by GNU Autoconf 2.69 for metacity 3.18.6. # # Report bugs to . # @@ -590,8 +590,8 @@ # Identity of this package. PACKAGE_NAME='metacity' PACKAGE_TARNAME='metacity' -PACKAGE_VERSION='3.18.5' -PACKAGE_STRING='metacity 3.18.5' +PACKAGE_VERSION='3.18.6' +PACKAGE_STRING='metacity 3.18.6' PACKAGE_BUGREPORT='https://bugzilla.gnome.org/enter_bug.cgi?product=metacity' PACKAGE_URL='' @@ -1443,7 +1443,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures metacity 3.18.5 to adapt to many kinds of systems. +\`configure' configures metacity 3.18.6 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1518,7 +1518,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of metacity 3.18.5:";; + short | recursive ) echo "Configuration of metacity 3.18.6:";; esac cat <<\_ACEOF @@ -1678,7 +1678,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -metacity configure 3.18.5 +metacity configure 3.18.6 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2230,7 +2230,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by metacity $as_me 3.18.5, which was +It was created by metacity $as_me 3.18.6, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -5100,7 +5100,7 @@ # Define the identity of the package. PACKAGE='metacity' - VERSION='3.18.5' + VERSION='3.18.6' cat >>confdefs.h <<_ACEOF @@ -18996,7 +18996,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by metacity $as_me 3.18.5, which was +This file was extended by metacity $as_me 3.18.6, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -19062,7 +19062,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -metacity config.status 3.18.5 +metacity config.status 3.18.6 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -Nru metacity-3.18.5/configure.ac metacity-3.18.6/configure.ac --- metacity-3.18.5/configure.ac 2016-06-25 09:19:39.000000000 +0000 +++ metacity-3.18.6/configure.ac 2016-07-12 20:27:55.000000000 +0000 @@ -4,7 +4,7 @@ m4_define([m_major_version], [3]) m4_define([m_minor_version], [18]) -m4_define([m_micro_version], [5]) +m4_define([m_micro_version], [6]) m4_define([m_version], [m_major_version.m_minor_version.m_micro_version]) dnl ************************************************************************** diff -Nru metacity-3.18.5/debian/changelog metacity-3.18.6/debian/changelog --- metacity-3.18.5/debian/changelog 2016-06-27 17:55:16.000000000 +0000 +++ metacity-3.18.6/debian/changelog 2016-07-12 20:55:01.000000000 +0000 @@ -1,3 +1,10 @@ +metacity (1:3.18.6-0ubuntu1) yakkety; urgency=medium + + * New upstream bugfix release. + * Drop titlebar_resize.diff, applied upstream. + + -- Dmitry Shachnev Tue, 12 Jul 2016 23:53:34 +0300 + metacity (1:3.18.5-0ubuntu1) yakkety; urgency=medium * New upstream bugfix release. diff -Nru metacity-3.18.5/debian/patches/series metacity-3.18.6/debian/patches/series --- metacity-3.18.5/debian/patches/series 2016-06-27 17:52:32.000000000 +0000 +++ metacity-3.18.6/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -titlebar_resize.diff diff -Nru metacity-3.18.5/debian/patches/titlebar_resize.diff metacity-3.18.6/debian/patches/titlebar_resize.diff --- metacity-3.18.5/debian/patches/titlebar_resize.diff 2016-06-27 17:53:34.000000000 +0000 +++ metacity-3.18.6/debian/patches/titlebar_resize.diff 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -Description: frames: restore window resize using titlebar -Origin: upstream, https://git.gnome.org/browse/metacity/commit/?h=ccedb2e969594f5a -Bug: https://bugs.launchpad.net/bugs/1596574 -Last-Update: 2016-06-27 - ---- a/src/ui/frames.c -+++ b/src/ui/frames.c -@@ -2814,7 +2814,7 @@ - - if (POINT_IN_RECT (x, y, fgeom.title_rect)) - { -- if (has_vert && y <= TOP_RESIZE_HEIGHT && has_north_resize) -+ if (has_vert && y <= (fgeom.borders.invisible.top + TOP_RESIZE_HEIGHT) && has_north_resize) - return META_FRAME_CONTROL_RESIZE_N; - else - return META_FRAME_CONTROL_TITLE; diff -Nru metacity-3.18.5/m4/glib-gettext.m4 metacity-3.18.6/m4/glib-gettext.m4 --- metacity-3.18.5/m4/glib-gettext.m4 2016-06-25 09:18:51.000000000 +0000 +++ metacity-3.18.6/m4/glib-gettext.m4 2016-07-12 20:33:42.000000000 +0000 @@ -383,8 +383,7 @@ rm -f po/POTFILES sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \ < $srcdir/po/POTFILES.in > po/POTFILES - ], - [[$0: This macro is deprecated. You should use upstream gettext instead.]]) + ]) # AM_GLIB_DEFINE_LOCALEDIR(VARIABLE) # ------------------------------- diff -Nru metacity-3.18.5/Makefile.in metacity-3.18.6/Makefile.in --- metacity-3.18.5/Makefile.in 2016-06-25 09:19:54.000000000 +0000 +++ metacity-3.18.6/Makefile.in 2016-07-12 20:33:55.000000000 +0000 @@ -182,8 +182,8 @@ $(top_srcdir)/build-aux/ltmain.sh \ $(top_srcdir)/build-aux/missing AUTHORS COPYING ChangeLog \ INSTALL NEWS README build-aux/compile build-aux/config.guess \ - build-aux/config.sub build-aux/depcomp build-aux/install-sh \ - build-aux/ltmain.sh build-aux/missing + build-aux/config.sub build-aux/install-sh build-aux/ltmain.sh \ + build-aux/missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) diff -Nru metacity-3.18.5/NEWS metacity-3.18.6/NEWS --- metacity-3.18.5/NEWS 2016-06-25 09:46:30.000000000 +0000 +++ metacity-3.18.6/NEWS 2016-07-12 20:31:23.000000000 +0000 @@ -1,3 +1,9 @@ +Version 3.18.6 +============== +- Fix window resizing using titlebar (Alberts Muktupāvels; LP:#1596574) +- Small HiDPI support improvements (Alberts Muktupāvels, Giovanni Campagna) +- Fix crash when removing secondary monitor (Alberts Muktupāvels; #766156) + Version 3.18.5 ============== - Fix _NET_WM_ICON in Alt-Tab switcher (Jasper St. Pierre, Owen W. Taylor; diff -Nru metacity-3.18.5/src/core/constraints.c metacity-3.18.6/src/core/constraints.c --- metacity-3.18.5/src/core/constraints.c 2016-06-25 09:18:11.000000000 +0000 +++ metacity-3.18.6/src/core/constraints.c 2016-07-04 07:30:26.000000000 +0000 @@ -337,6 +337,27 @@ g_free (info.borders); } +static gboolean +validate_fullscreen_monitors (MetaWindow *window) +{ + gint i; + + if (window->fullscreen_monitors[0] == -1) + return FALSE; + + for (i = 0; i < 4; i++) + { + gint monitor; + + monitor = window->fullscreen_monitors[i]; + + if (monitor < 0 || monitor > window->screen->n_xinerama_infos) + return FALSE; + } + + return TRUE; +} + static void setup_constraint_info (ConstraintInfo *info, MetaWindow *window, @@ -412,7 +433,7 @@ xinerama_info->number, &info->work_area_xinerama); - if (!window->fullscreen || window->fullscreen_monitors[0] == -1) + if (!window->fullscreen || !validate_fullscreen_monitors (window)) { info->entire_xinerama = xinerama_info->rect; } diff -Nru metacity-3.18.5/src/core/window.c metacity-3.18.6/src/core/window.c --- metacity-3.18.5/src/core/window.c 2016-06-25 09:18:11.000000000 +0000 +++ metacity-3.18.6/src/core/window.c 2016-07-07 16:00:38.000000000 +0000 @@ -8048,8 +8048,8 @@ if (window->display->grab_resize_popup == NULL) { - if (window->size_hints.width_inc > 1 || - window->size_hints.height_inc > 1) + if (window->size_hints.width_inc > 2 || + window->size_hints.height_inc > 2) window->display->grab_resize_popup = meta_ui_resize_popup_new (window->display->xdisplay, window->screen->number); diff -Nru metacity-3.18.5/src/ui/frames.c metacity-3.18.6/src/ui/frames.c --- metacity-3.18.5/src/ui/frames.c 2016-06-25 09:18:11.000000000 +0000 +++ metacity-3.18.6/src/ui/frames.c 2016-07-04 07:30:26.000000000 +0000 @@ -2814,7 +2814,7 @@ if (POINT_IN_RECT (x, y, fgeom.title_rect)) { - if (has_vert && y <= TOP_RESIZE_HEIGHT && has_north_resize) + if (has_vert && y <= (fgeom.borders.invisible.top + TOP_RESIZE_HEIGHT) && has_north_resize) return META_FRAME_CONTROL_RESIZE_N; else return META_FRAME_CONTROL_TITLE; diff -Nru metacity-3.18.5/src/ui/theme.c metacity-3.18.6/src/ui/theme.c --- metacity-3.18.5/src/ui/theme.c 2016-06-25 09:18:11.000000000 +0000 +++ metacity-3.18.6/src/ui/theme.c 2016-07-12 12:19:10.000000000 +0000 @@ -3762,17 +3762,8 @@ break; case META_DRAW_GRADIENT: - { - pixbuf = meta_gradient_spec_render (op->data.gradient.gradient_spec, - context, width, height); - - pixbuf = apply_alpha (pixbuf, - op->data.gradient.alpha_spec, - FALSE); - } break; - case META_DRAW_IMAGE: { if (op->data.image.colorize_spec) @@ -3899,6 +3890,91 @@ env->theme = meta_current_theme; } +static cairo_pattern_t * +create_cairo_pattern_from_gradient_spec (const MetaGradientSpec *spec, + const MetaAlphaGradientSpec *alpha_spec, + GtkStyleContext *context) +{ + gint n_colors; + cairo_pattern_t *pattern; + GSList *tmp; + gint i; + + n_colors = g_slist_length (spec->color_specs); + if (n_colors == 0) + return NULL; + + if (alpha_spec != NULL) + g_assert (n_colors == alpha_spec->n_alphas); + + if (spec->type == META_GRADIENT_HORIZONTAL) + pattern = cairo_pattern_create_linear (0, 0, 1, 0); + else if (spec->type == META_GRADIENT_VERTICAL) + pattern = cairo_pattern_create_linear (0, 0, 0, 1); + else if (spec->type == META_GRADIENT_DIAGONAL) + pattern = cairo_pattern_create_linear (0, 0, 1, 1); + else + g_assert_not_reached (); + + i = 0; + tmp = spec->color_specs; + while (tmp != NULL) + { + GdkRGBA color; + + meta_color_spec_render (tmp->data, context, &color); + + if (alpha_spec != NULL) + cairo_pattern_add_color_stop_rgba (pattern, i / (gfloat) (n_colors - 1), + color.red, color.green, color.blue, + alpha_spec->alphas[i] / 255.0); + else + cairo_pattern_add_color_stop_rgb (pattern, i / (gfloat) (n_colors - 1), + color.red, color.green, color.blue); + + tmp = tmp->next; + ++i; + } + + if (cairo_pattern_status (pattern) != CAIRO_STATUS_SUCCESS) + { + cairo_pattern_destroy (pattern); + return NULL; + } + + return pattern; +} + +static void +gradient_spec_render (const MetaGradientSpec *spec, + const MetaAlphaGradientSpec *alpha_spec, + cairo_t *cr, + GtkStyleContext *context, + gint x, + gint y, + gint width, + gint height) +{ + cairo_pattern_t *pattern; + + pattern = create_cairo_pattern_from_gradient_spec (spec, alpha_spec, context); + if (pattern == NULL) + return; + + cairo_save (cr); + + cairo_rectangle (cr, x, y, width, height); + + cairo_translate (cr, x, y); + cairo_scale (cr, width, height); + + cairo_set_source (cr, pattern); + cairo_fill (cr); + cairo_pattern_destroy (pattern); + + cairo_restore (cr); +} + /* This code was originally rendering anti-aliased using X primitives, and * now has been switched to draw anti-aliased using cairo. In general, the * closest correspondence between X rendering and cairo rendering is given @@ -4117,23 +4193,15 @@ case META_DRAW_GRADIENT: { int rx, ry, rwidth, rheight; - GdkPixbuf *pixbuf; rx = parse_x_position_unchecked (op->data.gradient.x, env); ry = parse_y_position_unchecked (op->data.gradient.y, env); rwidth = parse_size_unchecked (op->data.gradient.width, env); rheight = parse_size_unchecked (op->data.gradient.height, env); - pixbuf = draw_op_as_pixbuf (op, style_gtk, info, - rwidth, rheight); - - if (pixbuf) - { - gdk_cairo_set_source_pixbuf (cr, pixbuf, rx, ry); - cairo_paint (cr); - - g_object_unref (G_OBJECT (pixbuf)); - } + gradient_spec_render (op->data.gradient.gradient_spec, + op->data.gradient.alpha_spec, + cr, style_gtk, rx, ry, rwidth, rheight); } break;