Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package mutter for openSUSE:Factory checked in at 2021-08-25 20:56:20 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/mutter (Old) and /work/SRC/openSUSE:Factory/.mutter.new.1899 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "mutter" Wed Aug 25 20:56:20 2021 rev:170 rq:913695 version:40.4 Changes: -------- --- /work/SRC/openSUSE:Factory/mutter/mutter.changes 2021-08-10 10:28:18.577747858 +0200 +++ /work/SRC/openSUSE:Factory/.mutter.new.1899/mutter.changes 2021-08-25 20:56:48.465271506 +0200 @@ -1,0 +2,9 @@ +Wed Aug 18 17:30:34 UTC 2021 - Bj??rn Lie <[email protected]> + +- Update to version 40.4: + + Don't require a newly attached buffer to apply state. + + Fix upside-down Xshape surface with EGLstream. + + Misc. bug fixes and cleanups. + + Updated translations. + +------------------------------------------------------------------- Old: ---- mutter-40.3.tar.xz New: ---- mutter-40.4.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ mutter.spec ++++++ --- /var/tmp/diff_new_pack.1M8a6n/_old 2021-08-25 20:56:49.137270624 +0200 +++ /var/tmp/diff_new_pack.1M8a6n/_new 2021-08-25 20:56:49.141270619 +0200 @@ -23,7 +23,7 @@ %define api_minor 0 %define libmutter libmutter-%{api_major}-%{api_minor} Name: mutter -Version: 40.3 +Version: 40.4 Release: 0 Summary: Window and compositing manager based on Clutter License: GPL-2.0-or-later ++++++ mutter-40.3.tar.xz -> mutter-40.4.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mutter-40.3/NEWS new/mutter-40.4/NEWS --- old/mutter-40.3/NEWS 2021-07-12 20:49:39.172553800 +0200 +++ new/mutter-40.4/NEWS 2021-08-18 01:08:04.424999000 +0200 @@ -1,3 +1,15 @@ +40.4 +==== +* Don't require a newly attached buffer to apply state [Christian, Jonas; !1795] +* Fix upside-down Xshape surface with EGLstream [Robert; !1937] +* Misc. bug fixes and cleanups [Jonas; !1942, !1912] + +Contributors: + Robert Mader, Christian Rauch, Jonas ??dahl + +Translators: + Marek ??ernock?? [cs] + 40.3 ==== * Fix area screencasts when window is unredirected [Michel; #1707] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mutter-40.3/clutter/clutter/clutter-paint-nodes.c new/mutter-40.4/clutter/clutter/clutter-paint-nodes.c --- old/mutter-40.3/clutter/clutter/clutter-paint-nodes.c 2021-07-12 20:49:39.235551600 +0200 +++ new/mutter-40.4/clutter/clutter/clutter-paint-nodes.c 2021-08-18 01:08:04.444999000 +0200 @@ -1551,29 +1551,29 @@ float height, guint8 opacity) { - ClutterLayerNode *res; + ClutterLayerNode *lnode; CoglContext *context; CoglTexture2D *tex_2d; CoglTexture *texture; CoglColor color; - CoglOffscreen *offscreen; + g_autoptr (CoglOffscreen) offscreen = NULL; g_autoptr (GError) error = NULL; - res = _clutter_paint_node_create (CLUTTER_TYPE_LAYER_NODE); + lnode = _clutter_paint_node_create (CLUTTER_TYPE_LAYER_NODE); - res->needs_fbo_setup = TRUE; - res->projection = *projection; - res->viewport = *viewport; - res->fbo_width = width; - res->fbo_height = height; - res->opacity = opacity; + lnode->needs_fbo_setup = TRUE; + lnode->projection = *projection; + lnode->viewport = *viewport; + lnode->fbo_width = width; + lnode->fbo_height = height; + lnode->opacity = opacity; /* the texture backing the FBO */ context = clutter_backend_get_cogl_context (clutter_get_default_backend ()); tex_2d = cogl_texture_2d_new_with_size (context, - MAX (res->fbo_width, 1), - MAX (res->fbo_height, 1)); + MAX (lnode->fbo_width, 1), + MAX (lnode->fbo_height, 1)); texture = COGL_TEXTURE (tex_2d); cogl_texture_set_premultiplied (texture, TRUE); @@ -1582,11 +1582,11 @@ { g_warning ("Unable to create an allocate paint node offscreen: %s", error->message); - g_object_unref (offscreen); - goto out; + cogl_object_unref (texture); + return NULL; } - res->offscreen = COGL_FRAMEBUFFER (offscreen); + lnode->offscreen = COGL_FRAMEBUFFER (g_steal_pointer (&offscreen)); cogl_color_init_from_4ub (&color, opacity, opacity, opacity, opacity); @@ -1594,17 +1594,16 @@ * interpolation filters because the texture is always * going to be painted at a 1:1 texel:pixel ratio */ - res->pipeline = cogl_pipeline_copy (default_texture_pipeline); - cogl_pipeline_set_layer_filters (res->pipeline, 0, + lnode->pipeline = cogl_pipeline_copy (default_texture_pipeline); + cogl_pipeline_set_layer_filters (lnode->pipeline, 0, COGL_PIPELINE_FILTER_NEAREST, COGL_PIPELINE_FILTER_NEAREST); - cogl_pipeline_set_layer_texture (res->pipeline, 0, texture); - cogl_pipeline_set_color (res->pipeline, &color); + cogl_pipeline_set_layer_texture (lnode->pipeline, 0, texture); + cogl_pipeline_set_color (lnode->pipeline, &color); -out: cogl_object_unref (texture); - return (ClutterPaintNode *) res; + return (ClutterPaintNode *) lnode; } /** diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mutter-40.3/meson.build new/mutter-40.4/meson.build --- old/mutter-40.3/meson.build 2021-07-12 20:49:39.324548700 +0200 +++ new/mutter-40.4/meson.build 2021-08-18 01:08:04.497999200 +0200 @@ -1,5 +1,5 @@ project('mutter', 'c', - version: '40.3', + version: '40.4', meson_version: '>= 0.51.0', license: 'GPLv2+' ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mutter-40.3/po/cs.po new/mutter-40.4/po/cs.po --- old/mutter-40.3/po/cs.po 2021-07-12 20:49:39.343548000 +0200 +++ new/mutter-40.4/po/cs.po 2021-08-18 01:08:04.508999000 +0200 @@ -10,10 +10,10 @@ # msgid "" msgstr "" -"Project-Id-Version: mutter\n" +"Project-Id-Version: mutter gnome-40\n" "Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/mutter/issues\n" -"POT-Creation-Date: 2021-03-12 15:44+0000\n" -"PO-Revision-Date: 2021-03-13 11:52+0100\n" +"POT-Creation-Date: 2021-07-29 13:30+0000\n" +"PO-Revision-Date: 2021-08-08 20:31+0200\n" "Last-Translator: Marek ??ernock?? <[email protected]>\n" "Language-Team: ??e??tina <[email protected]>\n" "Language: cs\n" @@ -56,110 +56,126 @@ msgid "Move window one workspace to the right" msgstr "P??esunout okno o jednu pracovn?? plochu doprava" -#: data/50-mutter-navigation.xml:30 +#: data/50-mutter-navigation.xml:31 +msgid "Move window one workspace up" +msgstr "P??esunout okno o jednu pracovn?? plochu v????" + +#: data/50-mutter-navigation.xml:35 +msgid "Move window one workspace down" +msgstr "P??esunout okno o jednu pracovn?? plochu n????" + +#: data/50-mutter-navigation.xml:38 msgid "Move window one monitor to the left" msgstr "P??esunout okno o jeden monitor doleva" -#: data/50-mutter-navigation.xml:33 +#: data/50-mutter-navigation.xml:41 msgid "Move window one monitor to the right" msgstr "P??esunout okno o jeden monitor doprava" -#: data/50-mutter-navigation.xml:36 +#: data/50-mutter-navigation.xml:44 msgid "Move window one monitor up" msgstr "P??esunout okno o jeden monitor nahoru" -#: data/50-mutter-navigation.xml:39 +#: data/50-mutter-navigation.xml:47 msgid "Move window one monitor down" msgstr "P??esunout okno o jeden monitor dol??" -#: data/50-mutter-navigation.xml:43 +#: data/50-mutter-navigation.xml:51 msgid "Switch applications" msgstr "P??epnout do jin?? aplikace" -#: data/50-mutter-navigation.xml:48 +#: data/50-mutter-navigation.xml:56 msgid "Switch to previous application" msgstr "P??epnout do p??edchoz?? aplikaci" -#: data/50-mutter-navigation.xml:52 +#: data/50-mutter-navigation.xml:60 msgid "Switch windows" msgstr "P??epnout do jin??ho okna" -#: data/50-mutter-navigation.xml:57 +#: data/50-mutter-navigation.xml:65 msgid "Switch to previous window" msgstr "P??epnout do minul??ho okna" -#: data/50-mutter-navigation.xml:61 +#: data/50-mutter-navigation.xml:69 msgid "Switch windows of an application" msgstr "P??epnout do jin??ho okna aplikace" -#: data/50-mutter-navigation.xml:66 +#: data/50-mutter-navigation.xml:74 msgid "Switch to previous window of an application" msgstr "P??epnout do p??edchoz??ho okna aplikace" -#: data/50-mutter-navigation.xml:70 +#: data/50-mutter-navigation.xml:78 msgid "Switch system controls" msgstr "P??epnout na syst??mov?? ovl??dac?? prvek" -#: data/50-mutter-navigation.xml:75 +#: data/50-mutter-navigation.xml:83 msgid "Switch to previous system control" msgstr "P??epnout na minul?? syst??mov?? ovl??dac?? prvek" -#: data/50-mutter-navigation.xml:79 +#: data/50-mutter-navigation.xml:87 msgid "Switch windows directly" msgstr "P??epnout p????mo do okna" -#: data/50-mutter-navigation.xml:84 +#: data/50-mutter-navigation.xml:92 msgid "Switch directly to previous window" msgstr "P??epnout p????mo do p??edchoz??ho okna" -#: data/50-mutter-navigation.xml:88 +#: data/50-mutter-navigation.xml:96 msgid "Switch windows of an app directly" msgstr "P??epnout p????mo do jin??ho okna aplikace" -#: data/50-mutter-navigation.xml:93 +#: data/50-mutter-navigation.xml:101 msgid "Switch directly to previous window of an app" msgstr "P??epnout p????mo do p??edchoz??ho okna aplikace" -#: data/50-mutter-navigation.xml:97 +#: data/50-mutter-navigation.xml:105 msgid "Switch system controls directly" msgstr "P??epnout p????mo na syst??mov?? ovl??dac?? prvek" -#: data/50-mutter-navigation.xml:102 +#: data/50-mutter-navigation.xml:110 msgid "Switch directly to previous system control" msgstr "P??epnout p????mo na p??edchoz?? syst??mov?? ovl??dac?? prvek" -#: data/50-mutter-navigation.xml:105 +#: data/50-mutter-navigation.xml:113 msgid "Hide all normal windows" msgstr "Skr??t v??echna b????n?? okna" -#: data/50-mutter-navigation.xml:108 +#: data/50-mutter-navigation.xml:116 msgid "Switch to workspace 1" msgstr "P??epnout na pracovn?? plochu 1" -#: data/50-mutter-navigation.xml:111 +#: data/50-mutter-navigation.xml:119 msgid "Switch to workspace 2" msgstr "P??epnout na pracovn?? plochu 2" -#: data/50-mutter-navigation.xml:114 +#: data/50-mutter-navigation.xml:122 msgid "Switch to workspace 3" msgstr "P??epnout na pracovn?? plochu 3" -#: data/50-mutter-navigation.xml:117 +#: data/50-mutter-navigation.xml:125 msgid "Switch to workspace 4" msgstr "P??epnout na pracovn?? plochu 4" -#: data/50-mutter-navigation.xml:120 +#: data/50-mutter-navigation.xml:128 msgid "Switch to last workspace" msgstr "P??epnout na posledn?? pracovn?? plochu" -#: data/50-mutter-navigation.xml:123 +#: data/50-mutter-navigation.xml:131 msgid "Move to workspace on the left" msgstr "P??epnout na pracovn?? plochu vlevo" -#: data/50-mutter-navigation.xml:126 +#: data/50-mutter-navigation.xml:134 msgid "Move to workspace on the right" msgstr "P??epnout na pracovn?? plochu vpravo" +#: data/50-mutter-navigation.xml:138 +msgid "Move to workspace above" +msgstr "P??epnout na pracovn?? plochu nad" + +#: data/50-mutter-navigation.xml:142 +msgid "Move to workspace below" +msgstr "P??epnout na pracovn?? plochu pod" + #: data/50-mutter-system.xml:6 data/50-mutter-wayland.xml:6 msgid "System" msgstr "Syst??m" @@ -710,7 +726,7 @@ #. TRANSLATORS: This string refers to a button that switches between #. * different modes. #. -#: src/core/meta-pad-action-mapper.c:780 +#: src/core/meta-pad-action-mapper.c:782 #, c-format msgid "Mode Switch (Group %d)" msgstr "P??ep??na?? re??imu (skupina %d)" @@ -718,11 +734,11 @@ #. TRANSLATORS: This string refers to an action, cycles drawing tablets' #. * mapping through the available outputs. #. -#: src/core/meta-pad-action-mapper.c:803 +#: src/core/meta-pad-action-mapper.c:805 msgid "Switch monitor" msgstr "P??epnout monitor" -#: src/core/meta-pad-action-mapper.c:805 +#: src/core/meta-pad-action-mapper.c:807 msgid "Show on-screen help" msgstr "Zobrazit n??pov??du na obrazovce" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mutter-40.3/src/compositor/meta-shaped-texture.c new/mutter-40.4/src/compositor/meta-shaped-texture.c --- old/mutter-40.3/src/compositor/meta-shaped-texture.c 2021-07-12 20:49:39.498543000 +0200 +++ new/mutter-40.4/src/compositor/meta-shaped-texture.c 2021-08-18 01:08:04.574999300 +0200 @@ -368,15 +368,15 @@ &GRAPHENE_POINT3D_INIT (0.5, 0.5, 0.0)); } + cogl_pipeline_set_layer_matrix (pipeline, 1, &matrix); + if (!stex->is_y_inverted) { graphene_matrix_translate (&matrix, &GRAPHENE_POINT3D_INIT (0, -1, 0)); graphene_matrix_scale (&matrix, 1, -1, 1); - cogl_pipeline_set_layer_matrix (pipeline, 0, &matrix); } cogl_pipeline_set_layer_matrix (pipeline, 0, &matrix); - cogl_pipeline_set_layer_matrix (pipeline, 1, &matrix); if (stex->snippet) cogl_pipeline_add_layer_snippet (pipeline, 0, stex->snippet); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mutter-40.3/src/tests/meson.build new/mutter-40.4/src/tests/meson.build --- old/mutter-40.3/src/tests/meson.build 2021-07-12 20:49:39.536542000 +0200 +++ new/mutter-40.4/src/tests/meson.build 2021-08-18 01:08:04.596999400 +0200 @@ -84,6 +84,8 @@ 'meta-gpu-test.h', 'meta-monitor-manager-test.c', 'meta-monitor-manager-test.h', + 'meta-wayland-test-driver.c', + 'meta-wayland-test-driver.h', 'monitor-config-migration-unit-tests.c', 'monitor-config-migration-unit-tests.h', 'monitor-store-unit-tests.c', @@ -250,6 +252,7 @@ 'restore-position', 'default-size', 'modals', + 'map-fixed-size', ] foreach stacking_test: stacking_tests diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mutter-40.3/src/tests/meta-wayland-test-driver.c new/mutter-40.4/src/tests/meta-wayland-test-driver.c --- old/mutter-40.3/src/tests/meta-wayland-test-driver.c 1970-01-01 01:00:00.000000000 +0100 +++ new/mutter-40.4/src/tests/meta-wayland-test-driver.c 2021-08-18 01:08:04.597999600 +0200 @@ -0,0 +1,160 @@ +/* + * Copyright (C) 2019 Red Hat, Inc. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see <http://www.gnu.org/licenses/>. + */ + +#include "config.h" + +#include "tests/meta-wayland-test-driver.h" + +#include <wayland-server.h> + +#include "wayland/meta-wayland-actor-surface.h" +#include "wayland/meta-wayland-private.h" + +#include "test-driver-server-protocol.h" + +enum +{ + SYNC_POINT, + + N_SIGNALS +}; + +static int signals[N_SIGNALS]; + +struct _MetaWaylandTestDriver +{ + GObject parent; + + struct wl_global *test_driver; +}; + +G_DEFINE_TYPE (MetaWaylandTestDriver, meta_wayland_test_driver, + G_TYPE_OBJECT) + +static void +on_actor_destroyed (ClutterActor *actor, + struct wl_resource *callback) +{ + wl_callback_send_done (callback, 0); + wl_resource_destroy (callback); +} + +static void +sync_actor_destroy (struct wl_client *client, + struct wl_resource *resource, + uint32_t id, + struct wl_resource *surface_resource) +{ + MetaWaylandSurface *surface = wl_resource_get_user_data (surface_resource); + MetaWaylandActorSurface *actor_surface; + MetaSurfaceActor *actor; + struct wl_resource *callback; + + g_assert_nonnull (surface); + + actor_surface = (MetaWaylandActorSurface *) surface->role; + g_assert_nonnull (actor_surface); + + actor = meta_wayland_actor_surface_get_actor (actor_surface); + g_assert_nonnull (actor); + + callback = wl_resource_create (client, &wl_callback_interface, 1, id); + + g_signal_connect (actor, "destroy", G_CALLBACK (on_actor_destroyed), + callback); +} + +static void +sync_point (struct wl_client *client, + struct wl_resource *resource, + uint32_t sequence) +{ + MetaWaylandTestDriver *test_driver = wl_resource_get_user_data (resource); + + g_signal_emit (test_driver, signals[SYNC_POINT], 0, + sequence, + client); +} + +static const struct test_driver_interface meta_test_driver_interface = { + sync_actor_destroy, + sync_point, +}; + +static void +bind_test_driver (struct wl_client *client, + void *user_data, + uint32_t version, + uint32_t id) +{ + MetaWaylandTestDriver *test_driver = user_data; + struct wl_resource *resource; + + resource = wl_resource_create (client, &test_driver_interface, + version, id); + wl_resource_set_implementation (resource, &meta_test_driver_interface, + test_driver, NULL); +} + +static void +meta_wayland_test_driver_finalize (GObject *object) +{ + MetaWaylandTestDriver *test_driver = META_WAYLAND_TEST_DRIVER (object); + + g_clear_pointer (&test_driver->test_driver, wl_global_destroy); + + G_OBJECT_CLASS (meta_wayland_test_driver_parent_class)->finalize (object); +} + +static void +meta_wayland_test_driver_class_init (MetaWaylandTestDriverClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + object_class->finalize = meta_wayland_test_driver_finalize; + + signals[SYNC_POINT] = + g_signal_new ("sync-point", + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST, + 0, + NULL, NULL, NULL, + G_TYPE_NONE, 2, + G_TYPE_UINT, + G_TYPE_POINTER); +} + +static void +meta_wayland_test_driver_init (MetaWaylandTestDriver *test_driver) +{ +} + +MetaWaylandTestDriver * +meta_wayland_test_driver_new (MetaWaylandCompositor *compositor) +{ + MetaWaylandTestDriver *test_driver; + + test_driver = g_object_new (META_TYPE_WAYLAND_TEST_DRIVER, NULL); + test_driver->test_driver = wl_global_create (compositor->wayland_display, + &test_driver_interface, + 1, + test_driver, bind_test_driver); + if (!test_driver->test_driver) + g_error ("Failed to register a global wl-subcompositor object"); + + return test_driver; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mutter-40.3/src/tests/meta-wayland-test-driver.h new/mutter-40.4/src/tests/meta-wayland-test-driver.h --- old/mutter-40.3/src/tests/meta-wayland-test-driver.h 1970-01-01 01:00:00.000000000 +0100 +++ new/mutter-40.4/src/tests/meta-wayland-test-driver.h 2021-08-18 01:08:04.597999600 +0200 @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2019 Red Hat, Inc. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef META_WAYLAND_TEST_DRIVER_H +#define META_WAYLAND_TEST_DRIVER_H + +#include "wayland/meta-wayland.h" + +#define META_TYPE_WAYLAND_TEST_DRIVER (meta_wayland_test_driver_get_type ()) +G_DECLARE_FINAL_TYPE (MetaWaylandTestDriver, meta_wayland_test_driver, + META, WAYLAND_TEST_DRIVER, + GObject) + +MetaWaylandTestDriver * meta_wayland_test_driver_new (MetaWaylandCompositor *compositor); + +#endif /* META_WAYLAND_TEST_DRIVER_H */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mutter-40.3/src/tests/stacking/map-fixed-size.metatest new/mutter-40.4/src/tests/stacking/map-fixed-size.metatest --- old/mutter-40.3/src/tests/stacking/map-fixed-size.metatest 1970-01-01 01:00:00.000000000 +0100 +++ new/mutter-40.4/src/tests/stacking/map-fixed-size.metatest 2021-08-18 01:08:04.601999500 +0200 @@ -0,0 +1,75 @@ +# Map an initially maximized window + +# Map a Wayland window initially maximized + +new_client w wayland +create w/1 csd +maximize w/1 + +wait + +assert_stacking + +show w/1 + +wait + +assert_stacking w/1 +assert_size w/1 MONITOR_WIDTH MONITOR_HEIGHT + +hide w/1 + +# Map a Wayland window initially fullscreen + +create w/2 csd +fullscreen w/2 + +wait + +assert_stacking + +show w/2 + +wait + +assert_stacking w/2 +assert_size w/2 MONITOR_WIDTH MONITOR_HEIGHT + +hide w/2 + +# Map a X11 window initially maximized + +new_client x x11 +create x/1 csd +maximize x/1 + +wait + +assert_stacking + +show x/1 + +wait + +assert_stacking x/1 +assert_size x/1 MONITOR_WIDTH MONITOR_HEIGHT + +hide x/1 + +# Map a X11 window initially fullscreen + +create x/2 csd +fullscreen x/2 + +wait + +assert_stacking + +show x/2 + +wait + +assert_stacking x/2 +assert_size x/2 MONITOR_WIDTH MONITOR_HEIGHT + +hide x/2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mutter-40.3/src/tests/wayland-test-clients/meson.build new/mutter-40.4/src/tests/wayland-test-clients/meson.build --- old/mutter-40.3/src/tests/wayland-test-clients/meson.build 2021-07-12 20:49:39.550541400 +0200 +++ new/mutter-40.4/src/tests/wayland-test-clients/meson.build 2021-08-18 01:08:04.602999400 +0200 @@ -49,6 +49,7 @@ 'subsurface-remap-toplevel', 'invalid-subsurfaces', 'invalid-xdg-shell-actions', + 'xdg-apply-limits', ] foreach test : wayland_test_clients diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mutter-40.3/src/tests/wayland-test-clients/test-driver.xml new/mutter-40.4/src/tests/wayland-test-clients/test-driver.xml --- old/mutter-40.3/src/tests/wayland-test-clients/test-driver.xml 2021-07-12 20:49:39.550541400 +0200 +++ new/mutter-40.4/src/tests/wayland-test-clients/test-driver.xml 2021-08-18 01:08:04.602999400 +0200 @@ -5,5 +5,9 @@ <arg name="callback" type="new_id" interface="wl_callback"/> <arg name="surface" type="object" interface="wl_surface"/> </request> + + <request name="sync_point"> + <arg name="sequence" type="uint"/> + </request> </interface> </protocol> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mutter-40.3/src/tests/wayland-test-clients/xdg-apply-limits.c new/mutter-40.4/src/tests/wayland-test-clients/xdg-apply-limits.c --- old/mutter-40.3/src/tests/wayland-test-clients/xdg-apply-limits.c 1970-01-01 01:00:00.000000000 +0100 +++ new/mutter-40.4/src/tests/wayland-test-clients/xdg-apply-limits.c 2021-08-18 01:08:04.602999400 +0200 @@ -0,0 +1,408 @@ +/* + * Copyright (C) 2021 Christian Rauch + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see <http://www.gnu.org/licenses/>. + */ + +#include "config.h" + +#include <glib.h> +#include <sys/mman.h> +#include <unistd.h> +#include <wayland-client.h> + +#include "wayland-test-client-utils.h" + +#include "test-driver-client-protocol.h" +#include "xdg-shell-client-protocol.h" + +typedef enum _State +{ + STATE_INIT = 0, + STATE_WAIT_FOR_CONFIGURE_1, + STATE_WAIT_FOR_FRAME_1, + STATE_WAIT_FOR_ACTOR_DESTROYED, + STATE_WAIT_FOR_CONFIGURE_2, + STATE_WAIT_FOR_FRAME_2 +} State; + +static struct wl_display *display; +static struct wl_registry *registry; +static struct wl_compositor *compositor; +static struct wl_subcompositor *subcompositor; +static struct xdg_wm_base *xdg_wm_base; +static struct wl_shm *shm; +static struct test_driver *test_driver; + +static struct wl_surface *surface; +static struct xdg_surface *xdg_surface; +static struct xdg_toplevel *xdg_toplevel; + +static struct wl_surface *subsurface_surface; +static struct wl_subsurface *subsurface; + +static struct wl_callback *frame_callback; + +static gboolean running; + +static State state; + +static void +init_surface (void) +{ + xdg_toplevel_set_title (xdg_toplevel, "toplevel-limits-test"); + wl_surface_commit (surface); +} + +static void +actor_destroyed (void *data, + struct wl_callback *callback, + uint32_t serial) +{ + g_assert_cmpint (state, ==, STATE_WAIT_FOR_ACTOR_DESTROYED); + + init_surface (); + state = STATE_WAIT_FOR_CONFIGURE_2; + + wl_callback_destroy (callback); +} + +static const struct wl_callback_listener actor_destroy_listener = { + actor_destroyed, +}; + +static void +reset_surface (void) +{ + struct wl_callback *callback; + + if (test_driver) + { + callback = test_driver_sync_actor_destroyed (test_driver, surface); + wl_callback_add_listener (callback, &actor_destroy_listener, NULL); + } + + wl_surface_attach (surface, NULL, 0, 0); + wl_surface_commit (surface); + + state = STATE_WAIT_FOR_ACTOR_DESTROYED; +} + +static void +handle_buffer_release (void *data, + struct wl_buffer *buffer) +{ + wl_buffer_destroy (buffer); +} + +static const struct wl_buffer_listener buffer_listener = { + handle_buffer_release +}; + +static gboolean +create_shm_buffer (int width, + int height, + struct wl_buffer **out_buffer, + void **out_data, + int *out_size) +{ + struct wl_shm_pool *pool; + static struct wl_buffer *buffer; + int fd, size, stride; + int bytes_per_pixel; + void *data; + + bytes_per_pixel = 4; + stride = width * bytes_per_pixel; + size = stride * height; + + fd = create_anonymous_file (size); + if (fd < 0) + { + fprintf (stderr, "Creating a buffer file for %d B failed: %m\n", + size); + return FALSE; + } + + data = mmap (NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); + if (data == MAP_FAILED) + { + fprintf (stderr, "mmap failed: %m\n"); + close (fd); + return FALSE; + } + + pool = wl_shm_create_pool (shm, fd, size); + buffer = wl_shm_pool_create_buffer (pool, 0, + width, height, + stride, + WL_SHM_FORMAT_ARGB8888); + wl_buffer_add_listener (buffer, &buffer_listener, buffer); + wl_shm_pool_destroy (pool); + close (fd); + + *out_buffer = buffer; + *out_data = data; + *out_size = size; + + return TRUE; +} + +static void +fill (void *buffer_data, + int width, + int height, + uint32_t color) +{ + uint32_t *pixels = buffer_data; + int x, y; + + for (y = 0; y < height; y++) + { + for (x = 0; x < width; x++) + pixels[y * width + x] = color; + } +} + +static void +draw (struct wl_surface *surface, + int width, + int height, + uint32_t color) +{ + struct wl_buffer *buffer; + void *buffer_data; + int size; + + if (!create_shm_buffer (width, height, + &buffer, &buffer_data, &size)) + g_error ("Failed to create shm buffer"); + + fill (buffer_data, width, height, color); + + wl_surface_attach (surface, buffer, 0, 0); +} + +static void +draw_main (void) +{ + draw (surface, 700, 500, 0xff00ff00); +} + +static void +draw_subsurface (void) +{ + draw (subsurface_surface, 500, 300, 0xff007f00); +} + +static void +handle_xdg_toplevel_configure (void *data, + struct xdg_toplevel *xdg_toplevel, + int32_t width, + int32_t height, + struct wl_array *state) +{ +} + +static void +handle_xdg_toplevel_close(void *data, + struct xdg_toplevel *xdg_toplevel) +{ + g_assert_not_reached (); +} + +static const struct xdg_toplevel_listener xdg_toplevel_listener = { + handle_xdg_toplevel_configure, + handle_xdg_toplevel_close, +}; + +static void +handle_frame_callback (void *data, + struct wl_callback *callback, + uint32_t time) +{ + switch (state) + { + case STATE_WAIT_FOR_FRAME_1: + reset_surface (); + test_driver_sync_point (test_driver, 1); + break; + case STATE_WAIT_FOR_FRAME_2: + exit (EXIT_SUCCESS); + case STATE_INIT: + g_assert_not_reached (); + case STATE_WAIT_FOR_CONFIGURE_1: + g_assert_not_reached (); + case STATE_WAIT_FOR_ACTOR_DESTROYED: + g_assert_not_reached (); + case STATE_WAIT_FOR_CONFIGURE_2: + g_assert_not_reached (); + } +} + +static const struct wl_callback_listener frame_listener = { + handle_frame_callback, +}; + +static void +handle_xdg_surface_configure (void *data, + struct xdg_surface *xdg_surface, + uint32_t serial) +{ + switch (state) + { + case STATE_INIT: + g_assert_not_reached (); + case STATE_WAIT_FOR_CONFIGURE_1: + draw_main (); + state = STATE_WAIT_FOR_FRAME_1; + break; + case STATE_WAIT_FOR_CONFIGURE_2: + draw_main (); + state = STATE_WAIT_FOR_FRAME_2; + break; + case STATE_WAIT_FOR_ACTOR_DESTROYED: + g_assert_not_reached (); + case STATE_WAIT_FOR_FRAME_1: + case STATE_WAIT_FOR_FRAME_2: + /* ignore */ + return; + } + + xdg_surface_ack_configure (xdg_surface, serial); + frame_callback = wl_surface_frame (surface); + wl_callback_add_listener (frame_callback, &frame_listener, NULL); + wl_surface_commit (surface); + wl_display_flush (display); +} + +static const struct xdg_surface_listener xdg_surface_listener = { + handle_xdg_surface_configure, +}; + +static void +handle_xdg_wm_base_ping (void *data, + struct xdg_wm_base *xdg_wm_base, + uint32_t serial) +{ + xdg_wm_base_pong (xdg_wm_base, serial); +} + +static const struct xdg_wm_base_listener xdg_wm_base_listener = { + handle_xdg_wm_base_ping, +}; + +static void +handle_registry_global (void *data, + struct wl_registry *registry, + uint32_t id, + const char *interface, + uint32_t version) +{ + if (strcmp (interface, "wl_compositor") == 0) + { + compositor = wl_registry_bind (registry, id, &wl_compositor_interface, 1); + } + else if (strcmp (interface, "wl_subcompositor") == 0) + { + subcompositor = wl_registry_bind (registry, + id, &wl_subcompositor_interface, 1); + } + else if (strcmp (interface, "xdg_wm_base") == 0) + { + xdg_wm_base = wl_registry_bind (registry, id, + &xdg_wm_base_interface, 1); + xdg_wm_base_add_listener (xdg_wm_base, &xdg_wm_base_listener, NULL); + } + else if (strcmp (interface, "wl_shm") == 0) + { + shm = wl_registry_bind (registry, + id, &wl_shm_interface, 1); + } + else if (strcmp (interface, "test_driver") == 0) + { + test_driver = wl_registry_bind (registry, id, &test_driver_interface, 1); + } +} + +static void +handle_registry_global_remove (void *data, + struct wl_registry *registry, + uint32_t name) +{ +} + +static const struct wl_registry_listener registry_listener = { + handle_registry_global, + handle_registry_global_remove +}; + +int +main (int argc, + char **argv) +{ + display = wl_display_connect (NULL); + registry = wl_display_get_registry (display); + wl_registry_add_listener (registry, ®istry_listener, NULL); + wl_display_roundtrip (display); + + if (!shm) + { + fprintf (stderr, "No wl_shm global\n"); + return EXIT_FAILURE; + } + + if (!xdg_wm_base) + { + fprintf (stderr, "No xdg_wm_base global\n"); + return EXIT_FAILURE; + } + + wl_display_roundtrip (display); + + // g_assert_nonnull (test_driver); + + surface = wl_compositor_create_surface (compositor); + xdg_surface = xdg_wm_base_get_xdg_surface (xdg_wm_base, surface); + xdg_surface_add_listener (xdg_surface, &xdg_surface_listener, NULL); + xdg_toplevel = xdg_surface_get_toplevel (xdg_surface); + xdg_toplevel_add_listener (xdg_toplevel, &xdg_toplevel_listener, NULL); + + subsurface_surface = wl_compositor_create_surface (compositor); + subsurface = wl_subcompositor_get_subsurface (subcompositor, + subsurface_surface, + surface); + wl_subsurface_set_position (subsurface, 100, 100); + draw_subsurface (); + wl_surface_commit (subsurface_surface); + + init_surface (); + state = STATE_WAIT_FOR_CONFIGURE_1; + + /* set minimum and maximum size and commit */ + xdg_toplevel_set_min_size(xdg_toplevel, 700, 500); + xdg_toplevel_set_max_size(xdg_toplevel, 700, 500); + wl_surface_commit (surface); + + test_driver_sync_point (test_driver, 0); + + running = TRUE; + while (running) + { + if (wl_display_dispatch (display) == -1) + return EXIT_FAILURE; + } + + return EXIT_SUCCESS; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mutter-40.3/src/tests/wayland-unit-tests.c new/mutter-40.4/src/tests/wayland-unit-tests.c --- old/mutter-40.3/src/tests/wayland-unit-tests.c 2021-07-12 20:49:39.550541400 +0200 +++ new/mutter-40.4/src/tests/wayland-unit-tests.c 2021-08-18 01:08:04.602999400 +0200 @@ -20,14 +20,12 @@ #include "tests/wayland-unit-tests.h" #include <gio/gio.h> -#include <wayland-server.h> +#include "core/display-private.h" +#include "core/window-private.h" +#include "tests/meta-wayland-test-driver.h" #include "wayland/meta-wayland.h" -#include "wayland/meta-wayland-actor-surface.h" #include "wayland/meta-wayland-surface.h" -#include "wayland/meta-wayland-private.h" - -#include "test-driver-server-protocol.h" typedef struct _WaylandTestClient { @@ -36,6 +34,8 @@ GMainLoop *main_loop; } WaylandTestClient; +static MetaWaylandTestDriver *test_driver; + static char * get_test_client_path (const char *test_client_name) { @@ -120,6 +120,25 @@ g_free (wayland_test_client); } +static MetaWindow * +find_client_window (const char *title) +{ + MetaDisplay *display = meta_get_display (); + g_autoptr (GSList) windows = NULL; + GSList *l; + + windows = meta_display_list_windows (display, META_LIST_DEFAULT); + for (l = windows; l; l = l->next) + { + MetaWindow *window = l->data; + + if (g_strcmp0 (meta_window_get_title (window), title) == 0) + return window; + } + + return NULL; +} + static void subsurface_remap_toplevel (void) { @@ -155,55 +174,69 @@ g_test_assert_expected_messages (); } -static void -on_actor_destroyed (ClutterActor *actor, - struct wl_resource *callback) +typedef enum _ApplyLimitState { - wl_callback_send_done (callback, 0); - wl_resource_destroy (callback); -} + APPLY_LIMIT_STATE_INIT, + APPLY_LIMIT_STATE_RESET, + APPLY_LIMIT_STATE_FINISH, +} ApplyLimitState; -static void -sync_actor_destroy (struct wl_client *client, - struct wl_resource *resource, - uint32_t id, - struct wl_resource *surface_resource) +typedef struct _ApplyLimitData { - MetaWaylandSurface *surface = wl_resource_get_user_data (surface_resource); - MetaWaylandActorSurface *actor_surface; - MetaSurfaceActor *actor; - struct wl_resource *callback; + GMainLoop *loop; + WaylandTestClient *wayland_test_client; + ApplyLimitState state; +} ApplyLimitData; - g_assert_nonnull (surface); +static void +on_sync_point (MetaWaylandTestDriver *test_driver, + unsigned int sequence, + struct wl_client *wl_client, + ApplyLimitData *data) +{ + MetaWindow *window; - actor_surface = (MetaWaylandActorSurface *) surface->role; - g_assert_nonnull (actor_surface); + if (sequence == 0) + g_assert (data->state == APPLY_LIMIT_STATE_INIT); + else if (sequence == 0) + g_assert (data->state == APPLY_LIMIT_STATE_RESET); - actor = meta_wayland_actor_surface_get_actor (actor_surface); - g_assert_nonnull (actor); + window = find_client_window ("toplevel-limits-test"); - callback = wl_resource_create (client, &wl_callback_interface, 1, id); + if (sequence == 0) + { + g_assert_nonnull (window); + g_assert_cmpint (window->size_hints.max_width, ==, 700); + g_assert_cmpint (window->size_hints.max_height, ==, 500); + g_assert_cmpint (window->size_hints.min_width, ==, 700); + g_assert_cmpint (window->size_hints.min_height, ==, 500); - g_signal_connect (actor, "destroy", G_CALLBACK (on_actor_destroyed), - callback); + data->state = APPLY_LIMIT_STATE_RESET; + } + else if (sequence == 1) + { + g_assert_null (window); + data->state = APPLY_LIMIT_STATE_FINISH; + g_main_loop_quit (data->loop); + } + else + { + g_assert_not_reached (); + } } -static const struct test_driver_interface meta_test_driver_interface = { - sync_actor_destroy, -}; - static void -bind_test_driver (struct wl_client *client, - void *data, - uint32_t version, - uint32_t id) +toplevel_apply_limits (void) { - struct wl_resource *resource; + ApplyLimitData data = {}; - resource = wl_resource_create (client, &test_driver_interface, - version, id); - wl_resource_set_implementation (resource, &meta_test_driver_interface, - NULL, NULL); + data.loop = g_main_loop_new (NULL, FALSE); + data.wayland_test_client = wayland_test_client_new ("xdg-apply-limits"); + g_signal_connect (test_driver, "sync-point", G_CALLBACK (on_sync_point), &data); + g_main_loop_run (data.loop); + g_assert_cmpint (data.state, ==, APPLY_LIMIT_STATE_FINISH); + wayland_test_client_finish (data.wayland_test_client); + g_test_assert_expected_messages (); } void @@ -214,11 +247,7 @@ compositor = meta_wayland_compositor_get_default (); g_assert_nonnull (compositor); - if (wl_global_create (compositor->wayland_display, - &test_driver_interface, - 1, - NULL, bind_test_driver) == NULL) - g_error ("Failed to register a global wl-subcompositor object"); + test_driver = meta_wayland_test_driver_new (compositor); } void @@ -230,4 +259,6 @@ subsurface_invalid_subsurfaces); g_test_add_func ("/wayland/subsurface/invalid-xdg-shell-actions", subsurface_invalid_xdg_shell_actions); + g_test_add_func ("/wayland/toplevel/apply-limits", + toplevel_apply_limits); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mutter-40.3/src/wayland/meta-wayland-legacy-xdg-shell.c new/mutter-40.4/src/wayland/meta-wayland-legacy-xdg-shell.c --- old/mutter-40.3/src/wayland/meta-wayland-legacy-xdg-shell.c 2021-07-12 20:49:39.563541000 +0200 +++ new/mutter-40.4/src/wayland/meta-wayland-legacy-xdg-shell.c 2021-08-18 01:08:04.608999500 +0200 @@ -709,9 +709,6 @@ if (!window) return; - if (!pending->newly_attached) - return; - old_geometry = xdg_surface_priv->geometry; surface_role_class = @@ -1016,9 +1013,6 @@ META_WAYLAND_SURFACE_ROLE_CLASS (meta_wayland_zxdg_popup_v6_parent_class); surface_role_class->post_apply_state (surface_role, pending); - if (!pending->newly_attached) - return; - if (!surface->buffer_ref->buffer) return; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mutter-40.3/src/wayland/meta-wayland-wl-shell.c new/mutter-40.4/src/wayland/meta-wayland-wl-shell.c --- old/mutter-40.3/src/wayland/meta-wayland-wl-shell.c 2021-07-12 20:49:39.572540800 +0200 +++ new/mutter-40.4/src/wayland/meta-wayland-wl-shell.c 2021-08-18 01:08:04.612999700 +0200 @@ -611,9 +611,6 @@ if (!window) return; - if (!pending->newly_attached) - return; - input_region = meta_wayland_surface_calculate_input_region (surface); if (!cairo_region_is_empty (input_region)) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mutter-40.3/src/wayland/meta-wayland-xdg-shell.c new/mutter-40.4/src/wayland/meta-wayland-xdg-shell.c --- old/mutter-40.3/src/wayland/meta-wayland-xdg-shell.c 2021-07-12 20:49:39.573540700 +0200 +++ new/mutter-40.4/src/wayland/meta-wayland-xdg-shell.c 2021-08-18 01:08:04.613999600 +0200 @@ -810,9 +810,6 @@ META_WAYLAND_SURFACE_ROLE_CLASS (meta_wayland_xdg_toplevel_parent_class); surface_role_class->post_apply_state (surface_role, pending); - if (!pending->newly_attached) - return; - window_geometry = meta_wayland_xdg_surface_get_window_geometry (xdg_surface); geometry_changed = !meta_rectangle_equal (&old_geometry, &window_geometry); @@ -1164,9 +1161,6 @@ if (!window) return; - if (!pending->newly_attached) - return; - if (!surface->buffer_ref->buffer) return; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mutter-40.3/src/wayland/meta-window-wayland.c new/mutter-40.4/src/wayland/meta-window-wayland.c --- old/mutter-40.3/src/wayland/meta-window-wayland.c 2021-07-12 20:49:39.574540600 +0200 +++ new/mutter-40.4/src/wayland/meta-window-wayland.c 2021-08-18 01:08:04.613999600 +0200 @@ -355,21 +355,10 @@ { MetaWaylandWindowConfiguration *configuration; - /* If the constrained size is 1x1 and the unconstrained size is 0x0 - * it means that we are trying to resize a window where the client has - * not yet committed a buffer. The 1x1 constrained size is a result of - * how the constraints code works. Lets avoid trying to have the - * client configure itself to draw on a 1x1 surface. - * - * We cannot guard against only an empty unconstrained_rect here, - * because the client may have created a xdg surface without a buffer - * attached and asked it to be maximized. In such case we should let - * it know about the expected window geometry of a maximized window, - * even though there is currently no buffer attached. */ - if (unconstrained_rect.width == 0 && - unconstrained_rect.height == 0 && - constrained_rect.width == 1 && - constrained_rect.height == 1) + if (!meta_wayland_surface_get_buffer (window->surface) && + !META_WINDOW_MAXIMIZED (window) && + window->tile_mode == META_TILE_NONE && + !meta_window_is_fullscreen (window)) return; configuration =
