Merge ~3v1n0/ubuntu/+source/mutter:ubuntu/bionic into ~ubuntu-desktop/ubuntu/+source/mutter:ubuntu/bionic

Proposed by Marco Trevisan (Treviño)
Status: Merged
Merged at revision: 69e968c412d5559cfb9e04ac7ded0841bce64517
Proposed branch: ~3v1n0/ubuntu/+source/mutter:ubuntu/bionic
Merge into: ~ubuntu-desktop/ubuntu/+source/mutter:ubuntu/bionic
Prerequisite: ~3v1n0/ubuntu/+source/mutter:upstream/3.28.x
Diff against target: 1691 lines (+672/-63)
8 files modified
debian/changelog (+27/-0)
debian/libmutter-2-0.symbols (+7/-0)
debian/patches/bgo768531_workaround-startup-notifications.patch (+2/-2)
debian/patches/clutter-Fix-offscreen-effect-painting-of-clones.patch (+629/-0)
debian/patches/debian/skip-failing-tests-325.patch (+3/-3)
debian/patches/debian/skip-failing-tests.patch (+3/-3)
debian/patches/series (+1/-11)
dev/null (+0/-44)
Reviewer Review Type Date Requested Status
Iain Lane Needs Fixing
Review via email: mp+361811@code.launchpad.net

This proposal supersedes a proposal from 2019-01-15.

To post a comment you must log in.
Revision history for this message
Iain Lane (laney) wrote :

Thanks.

I haven't reviewed fully, but the version is not right - we need a "-" in there somewhere otherwise this is treated as a native package, which it isn't. I suggest "3.28.3+git20181011-0ubuntu18.04.1".

review: Needs Fixing
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Also, the fix for bug 1767648 (and hence bug 1779615) is not in disco or cosmic yet(?)

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

> Also, the fix for bug 1767648 (and hence bug 1779615) is not in disco or
> cosmic yet(?)

For both I'm preparing a landing in disco, don't worry (that's why I'm delaying the fixes on this a bit), so they were planned to land in disco already in the coming upload.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 360eba4..645be25 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,30 @@
6+mutter (3.28.3+git20190124-0ubuntu18.04.1) UNRELEASED; urgency=medium
7+
8+ * New upstream git snapshot based on 3.28.3 plus commits up to 4af8d9d47
9+ (LP: #1811900)
10+ - Fix crash in dual monitor setup and gdm activation (LP: #1790525,
11+ LP: #1795774)
12+ - Make possible to launch gnome-shell in wayland using nvidia and EGLDevice
13+ backend (LP: #1805444)
14+ * debian/libmutter-2-0.symbols: Add new symbols
15+ * d/p/gpu-kms-Don-t-crash-if-drmModeGetResources-returns-N.patch,
16+ d/p/native-gpu-Handle-drmModeSetCrtc-failing-gracefully.patch,
17+ d/p/monitor-manager-Filter-out-low-screen-resolutions.patch,
18+ d/p/window-wayland-Always-update-monitor-for-non-user-ops.patch,
19+ d/p/window-Don-t-refuse-to-move-focus-to-the-grab-window.patch,
20+ d/p/window-Explicitly-exclude-unmanaging-window-from-focus-ag.patch,
21+ d/p/monitor-Use-current-monitor-mode-to-check-whether-active.patch,
22+ d/p/core-Return-1-if-meta_window_get_monitor-is-called-on-an-.patch,
23+ d/p/renderer-native-Fallback-to-non-planar-API-if-gbm_bo_get_.patch,
24+ d/p/clutter-x11-Implement-keycode-lookup-from-keysyms-on-virt.patch,
25+ d/p/clutter-Do-not-latch-modifiers-on-modifier-keys.patch:
26+ - Removed as applied upstream
27+ * d/p/clutter-Fix-offscreen-effect-painting-of-clones.patch:
28+ - Fix offscreen-effect painting of clones in zoom mode (LP: #1767648,
29+ LP: #1779615)
30+
31+ -- Marco Trevisan (Treviño) <marco@ubuntu.com> Thu, 24 Jan 2019 18:05:12 +0000
32+
33 mutter (3.28.3-2~ubuntu18.04.2) bionic; urgency=medium
34
35 * d/p/renderer-native-Fallback-to-non-planar-API-if-gbm_bo_get_.patch:
36diff --git a/debian/libmutter-2-0.symbols b/debian/libmutter-2-0.symbols
37index e4203ad..1489074 100644
38--- a/debian/libmutter-2-0.symbols
39+++ b/debian/libmutter-2-0.symbols
40@@ -545,7 +545,9 @@ libmutter-2.so.0 libmutter-2-0 #MINVER#
41 meta_gpu_get_type@Base 3.28.2
42 meta_gpu_has_hotplug_mode_update@Base 3.28.2
43 meta_gpu_kms_apply_crtc_mode@Base 3.28.2
44+ meta_gpu_kms_can_have_outputs@Base 3.28.3+git20190124
45 meta_gpu_kms_error_quark@Base 3.28.2
46+ meta_gpu_kms_flip_closure_container_free@Base 3.28.3+git20190124
47 meta_gpu_kms_flip_crtc@Base 3.28.2
48 meta_gpu_kms_get_fd@Base 3.28.2
49 meta_gpu_kms_get_file_path@Base 3.28.2
50@@ -556,6 +558,7 @@ libmutter-2.so.0 libmutter-2-0 #MINVER#
51 meta_gpu_kms_new@Base 3.28.2
52 meta_gpu_kms_set_power_save_mode@Base 3.28.2
53 meta_gpu_kms_wait_for_flip@Base 3.28.2
54+ meta_gpu_kms_wrap_flip_closure@Base 3.28.3+git20190124
55 meta_gpu_read_current@Base 3.28.2
56 meta_gpu_take_crtcs@Base 3.28.2
57 meta_gpu_take_modes@Base 3.28.2
58@@ -1238,14 +1241,17 @@ libmutter-2.so.0 libmutter-2-0 #MINVER#
59 meta_warning@Base 3.28.2
60 meta_wayland_actor_surface_calculate_scale@Base 3.28.2
61 meta_wayland_actor_surface_get_type@Base 3.28.2
62+ meta_wayland_actor_surface_queue_frame_callbacks@Base 3.28.3+git20190124
63 meta_wayland_actor_surface_sync_actor_state@Base 3.28.2
64 meta_wayland_buffer_attach@Base 3.28.2
65 meta_wayland_buffer_create_snippet@Base 3.28.2
66 meta_wayland_buffer_from_resource@Base 3.28.2
67 meta_wayland_buffer_get_texture@Base 3.28.2
68 meta_wayland_buffer_get_type@Base 3.28.2
69+ meta_wayland_buffer_is_realized@Base 3.28.3+git20190124
70 meta_wayland_buffer_is_y_inverted@Base 3.28.2
71 meta_wayland_buffer_process_damage@Base 3.28.2
72+ meta_wayland_buffer_realize@Base 3.28.3+git20190124
73 meta_wayland_compositor_destroy_frame_callbacks@Base 3.28.2
74 meta_wayland_compositor_flush_clients@Base 3.28.2
75 meta_wayland_compositor_get_default@Base 3.28.2
76@@ -1397,6 +1403,7 @@ libmutter-2.so.0 libmutter-2-0 #MINVER#
77 meta_wayland_surface_apply_pending_state@Base 3.28.2
78 meta_wayland_surface_assign_role@Base 3.28.2
79 meta_wayland_surface_begin_grab_op@Base 3.28.2
80+ meta_wayland_surface_cache_pending_frame_callbacks@Base 3.28.3+git20190124
81 meta_wayland_surface_calculate_input_region@Base 3.28.2
82 meta_wayland_surface_cancel_inhibit_shortcuts_dialog@Base 3.28.2
83 meta_wayland_surface_clear_surface_actor@Base 3.28.2
84diff --git a/debian/patches/bgo768531_workaround-startup-notifications.patch b/debian/patches/bgo768531_workaround-startup-notifications.patch
85index bc6b697..26ac823 100644
86--- a/debian/patches/bgo768531_workaround-startup-notifications.patch
87+++ b/debian/patches/bgo768531_workaround-startup-notifications.patch
88@@ -16,10 +16,10 @@ Applied-upstream: no
89 1 file changed, 10 insertions(+)
90
91 diff --git a/src/wayland/meta-wayland-gtk-shell.c b/src/wayland/meta-wayland-gtk-shell.c
92-index 0ef9b83..891109a 100644
93+index 474595b..5837567 100644
94 --- a/src/wayland/meta-wayland-gtk-shell.c
95 +++ b/src/wayland/meta-wayland-gtk-shell.c
96-@@ -312,11 +312,21 @@ gtk_shell_set_startup_id (struct wl_client *client,
97+@@ -321,11 +321,21 @@ gtk_shell_set_startup_id (struct wl_client *client,
98 struct wl_resource *resource,
99 const char *startup_id)
100 {
101diff --git a/debian/patches/clutter-Do-not-latch-modifiers-on-modifier-keys.patch b/debian/patches/clutter-Do-not-latch-modifiers-on-modifier-keys.patch
102deleted file mode 100644
103index 120171f..0000000
104--- a/debian/patches/clutter-Do-not-latch-modifiers-on-modifier-keys.patch
105+++ /dev/null
106@@ -1,43 +0,0 @@
107-From: Carlos Garnacho <carlosg@gnome.org>
108-Date: Wed, 3 Oct 2018 22:43:21 +0200
109-Subject: clutter: Do not latch modifiers on modifier keys
110-
111-If the user maps eg. Alt+F2 to a pad button, the MetaInputSettings will
112-send the full Alt press, F2 press, F2 release, Alt release sequence.
113-However the keycode corresponding to Alt is found in level 1, so the
114-Shift modifier gets unintendedly latched in addition to the Alt key
115-press/release pair.
116-
117-We could probably improve keycode lookup heuristics so level=0 (and
118-no modifier latching) is preferred, but we can do without it altogether
119-for modifier keys.
120-
121-Ubuntu-Bug: https://bugs.launchpad.net/oem-priority/+bug/1730211
122-Applied-Upstream: yes, 3.30.1
123----
124- clutter/clutter/x11/clutter-virtual-input-device-x11.c | 6 ++++--
125- 1 file changed, 4 insertions(+), 2 deletions(-)
126-
127-diff --git a/clutter/clutter/x11/clutter-virtual-input-device-x11.c b/clutter/clutter/x11/clutter-virtual-input-device-x11.c
128-index b86ded0..e16ba3f 100644
129---- a/clutter/clutter/x11/clutter-virtual-input-device-x11.c
130-+++ b/clutter/clutter/x11/clutter-virtual-input-device-x11.c
131-@@ -147,14 +147,16 @@ clutter_virtual_input_device_x11_notify_keyval (ClutterVirtualInputDevice *virtu
132- return;
133- }
134-
135-- if (key_state == CLUTTER_KEY_STATE_PRESSED)
136-+ if (!_clutter_keymap_x11_get_is_modifier (keymap, keycode) &&
137-+ key_state == CLUTTER_KEY_STATE_PRESSED)
138- clutter_keymap_x11_latch_modifiers (keymap, level, TRUE);
139-
140- XTestFakeKeyEvent (clutter_x11_get_default_display (),
141- (KeyCode) keycode,
142- key_state == CLUTTER_KEY_STATE_PRESSED, 0);
143-
144-- if (key_state == CLUTTER_KEY_STATE_RELEASED)
145-+ if (!_clutter_keymap_x11_get_is_modifier (keymap, keycode) &&
146-+ key_state == CLUTTER_KEY_STATE_RELEASED)
147- clutter_keymap_x11_latch_modifiers (keymap, level, FALSE);
148- }
149-
150diff --git a/debian/patches/clutter-Fix-offscreen-effect-painting-of-clones.patch b/debian/patches/clutter-Fix-offscreen-effect-painting-of-clones.patch
151new file mode 100644
152index 0000000..faa2d7a
153--- /dev/null
154+++ b/debian/patches/clutter-Fix-offscreen-effect-painting-of-clones.patch
155@@ -0,0 +1,629 @@
156+From: Daniel van Vugt <daniel.van.vugt@canonical.com>
157+Date: Thu, 24 May 2018 11:51:22 +0200
158+Subject: clutter: Fix offscreen-effect painting of clones
159+
160+`ClutterOffscreenEffect` had been getting the wrong bounding box in the
161+case of clones and descendents of clones, causing visibly incorrect
162+clipping. This was due to `clutter_actor_get_paint_box` only ever being
163+given the source actor during a paint (which is correct) and not the clone.
164+Even if we weren't painting a clone but an offscreened descendent of a
165+clone (like in gnome-shell's desktop zoom), we would get the wrong result.
166+
167+Fortunately we don't need to know the actual clone/actor being painted so
168+don't need to call the problematic `clutter_actor_get_paint_box` at all.
169+The solution is to only keep untransformed rendering in the FBO and leave
170+the correct transformation for later. The correct clone/actor's
171+transformation is already set for us as the current cogl modelview matrix
172+by `clutter_actor_paint`.
173+
174+Bonus optimization: This all means we don't need to keep `last_matrix_drawn`
175+or force a full repaint every time some part of the transformation changes.
176+Because the FBO contents are no longer affected by transformations. As it
177+should be. In other words, offscreen-effected actors can now move around
178+on screen without themselves being repainted.
179+
180+Special thanks to Mai Lavelle for identifying the cause of the problem.
181+
182+Fixes:
183+https://bugzilla.gnome.org/show_bug.cgi?id=789050,
184+https://bugzilla.gnome.org/show_bug.cgi?id=659523#c9,
185+https://gitlab.gnome.org/GNOME/mutter/issues/196,
186+https://gitlab.gnome.org/GNOME/mutter/issues/282,
187+https://gitlab.gnome.org/GNOME/gnome-shell/issues/387,
188+https://launchpad.net/bugs/1767648,
189+https://launchpad.net/bugs/1779615
190+
191+Origin: https://gitlab.gnome.org/GNOME/mutter/commit/8655bc5d8d
192+Bug-Ubuntu: https://launchpad.net/bugs/1767648, https://launchpad.net/bugs/1779615
193+Applied-Upstream: yes
194+---
195+ clutter/clutter/clutter-actor-box-private.h | 12 ++
196+ clutter/clutter/clutter-actor-box.c | 52 +++++++
197+ clutter/clutter/clutter-offscreen-effect.c | 172 +++++++++------------
198+ clutter/clutter/clutter-paint-volume.c | 48 +-----
199+ clutter/tests/conform/Makefile.am | 1 -
200+ .../tests/conform/actor-offscreen-limit-max-size.c | 119 --------------
201+ clutter/tests/conform/actor-offscreen-redirect.c | 7 +-
202+ 7 files changed, 146 insertions(+), 265 deletions(-)
203+ create mode 100644 clutter/clutter/clutter-actor-box-private.h
204+ delete mode 100644 clutter/tests/conform/actor-offscreen-limit-max-size.c
205+
206+diff --git a/clutter/clutter/clutter-actor-box-private.h b/clutter/clutter/clutter-actor-box-private.h
207+new file mode 100644
208+index 0000000..e7aeb88
209+--- /dev/null
210++++ b/clutter/clutter/clutter-actor-box-private.h
211+@@ -0,0 +1,12 @@
212++#ifndef __CLUTTER_ACTOR_BOX_PRIVATE_H__
213++#define __CLUTTER_ACTOR_BOX_PRIVATE_H__
214++
215++#include <clutter/clutter-types.h>
216++
217++G_BEGIN_DECLS
218++
219++void _clutter_actor_box_enlarge_for_effects (ClutterActorBox *box);
220++
221++G_END_DECLS
222++
223++#endif /* __CLUTTER_ACTOR_BOX_PRIVATE_H__ */
224+diff --git a/clutter/clutter/clutter-actor-box.c b/clutter/clutter/clutter-actor-box.c
225+index 2991066..319eec3 100644
226+--- a/clutter/clutter/clutter-actor-box.c
227++++ b/clutter/clutter/clutter-actor-box.c
228+@@ -7,6 +7,7 @@
229+ #include "clutter-types.h"
230+ #include "clutter-interval.h"
231+ #include "clutter-private.h"
232++#include "clutter-actor-box-private.h"
233+
234+ /**
235+ * clutter_actor_box_new:
236+@@ -544,6 +545,57 @@ clutter_actor_box_set_size (ClutterActorBox *box,
237+ box->y2 = box->y1 + height;
238+ }
239+
240++void
241++_clutter_actor_box_enlarge_for_effects (ClutterActorBox *box)
242++{
243++ float width, height;
244++
245++ /* The aim here is that for a given rectangle defined with floating point
246++ * coordinates we want to determine a stable quantized size in pixels
247++ * that doesn't vary due to the original box's sub-pixel position.
248++ *
249++ * The reason this is important is because effects will use this
250++ * API to determine the size of offscreen framebuffers and so for
251++ * a fixed-size object that may be animated accross the screen we
252++ * want to make sure that the stage paint-box has an equally stable
253++ * size so that effects aren't made to continuously re-allocate
254++ * a corresponding fbo.
255++ *
256++ * The other thing we consider is that the calculation of this box is
257++ * subject to floating point precision issues that might be slightly
258++ * different to the precision issues involved with actually painting the
259++ * actor, which might result in painting slightly leaking outside the
260++ * user's calculated paint-volume. For this we simply aim to pad out the
261++ * paint-volume by at least half a pixel all the way around.
262++ */
263++ width = box->x2 - box->x1;
264++ height = box->y2 - box->y1;
265++ width = CLUTTER_NEARBYINT (width);
266++ height = CLUTTER_NEARBYINT (height);
267++ /* XXX: NB the width/height may now be up to 0.5px too small so we
268++ * must also pad by 0.25px all around to account for this. In total we
269++ * must padd by at least 0.75px around all sides. */
270++
271++ /* XXX: The furthest that we can overshoot the bottom right corner by
272++ * here is 1.75px in total if you consider that the 0.75 padding could
273++ * just cross an integer boundary and so ceil will effectively add 1.
274++ */
275++ box->x2 = ceilf (box->x2 + 0.75);
276++ box->y2 = ceilf (box->y2 + 0.75);
277++
278++ /* Now we redefine the top-left relative to the bottom right based on the
279++ * rounded width/height determined above + a constant so that the overall
280++ * size of the box will be stable and not dependant on the box's
281++ * position.
282++ *
283++ * Adding 3px to the width/height will ensure we cover the maximum of
284++ * 1.75px padding on the bottom/right and still ensure we have > 0.75px
285++ * padding on the top/left.
286++ */
287++ box->x1 = box->x2 - width - 3;
288++ box->y1 = box->y2 - height - 3;
289++}
290++
291+ G_DEFINE_BOXED_TYPE_WITH_CODE (ClutterActorBox, clutter_actor_box,
292+ clutter_actor_box_copy,
293+ clutter_actor_box_free,
294+diff --git a/clutter/clutter/clutter-offscreen-effect.c b/clutter/clutter/clutter-offscreen-effect.c
295+index 5db40b7..a26275e 100644
296+--- a/clutter/clutter/clutter-offscreen-effect.c
297++++ b/clutter/clutter/clutter-offscreen-effect.c
298+@@ -74,6 +74,8 @@
299+ #include "clutter-debug.h"
300+ #include "clutter-private.h"
301+ #include "clutter-stage-private.h"
302++#include "clutter-paint-volume-private.h"
303++#include "clutter-actor-box-private.h"
304+
305+ struct _ClutterOffscreenEffectPrivate
306+ {
307+@@ -84,8 +86,10 @@ struct _ClutterOffscreenEffectPrivate
308+ ClutterActor *actor;
309+ ClutterActor *stage;
310+
311+- gfloat x_offset;
312+- gfloat y_offset;
313++ ClutterVertex position;
314++
315++ int fbo_offset_x;
316++ int fbo_offset_y;
317+
318+ /* This is the calculated size of the fbo before being passed
319+ through create_texture(). This needs to be tracked separately so
320+@@ -95,16 +99,6 @@ struct _ClutterOffscreenEffectPrivate
321+ int fbo_height;
322+
323+ gint old_opacity_override;
324+-
325+- /* The matrix that was current the last time the fbo was updated. We
326+- need to keep track of this to detect when we can reuse the
327+- contents of the fbo without redrawing the actor. We need the
328+- actual matrix rather than just detecting queued redraws on the
329+- actor because any change in the parent hierarchy (even just a
330+- translation) could cause the actor to look completely different
331+- and it won't cause a redraw to be queued on the parent's
332+- children. */
333+- CoglMatrix last_matrix_drawn;
334+ };
335+
336+ G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (ClutterOffscreenEffect,
337+@@ -224,15 +218,15 @@ clutter_offscreen_effect_pre_paint (ClutterEffect *effect)
338+ {
339+ ClutterOffscreenEffect *self = CLUTTER_OFFSCREEN_EFFECT (effect);
340+ ClutterOffscreenEffectPrivate *priv = self->priv;
341+- ClutterActorBox box;
342++ ClutterActorBox raw_box, box;
343+ ClutterActor *stage;
344+- CoglMatrix projection;
345++ CoglMatrix projection, old_modelview, modelview;
346++ const ClutterPaintVolume *volume;
347+ CoglColor transparent;
348+ gfloat stage_width, stage_height;
349+ gfloat fbo_width = -1, fbo_height = -1;
350+- gfloat width, height;
351+- gfloat xexpand, yexpand;
352+- int texture_width, texture_height;
353++ ClutterVertex local_offset = { 0.f, 0.f, 0.f };
354++ gfloat old_viewport[4];
355+
356+ if (!clutter_actor_meta_get_enabled (CLUTTER_ACTOR_META (effect)))
357+ return FALSE;
358+@@ -243,92 +237,82 @@ clutter_offscreen_effect_pre_paint (ClutterEffect *effect)
359+ stage = _clutter_actor_get_stage_internal (priv->actor);
360+ clutter_actor_get_size (stage, &stage_width, &stage_height);
361+
362+- /* The paint box is the bounding box of the actor's paint volume in
363+- * stage coordinates. This will give us the size for the framebuffer
364+- * we need to redirect its rendering offscreen and its position will
365+- * be used to setup an offset viewport */
366+- if (clutter_actor_get_paint_box (priv->actor, &box))
367++ /* Get the minimal bounding box for what we want to paint, relative to the
368++ * parent of priv->actor. Note that we may actually be painting a clone of
369++ * priv->actor so we need to be careful to avoid querying the transformation
370++ * of priv->actor (like clutter_actor_get_paint_box would). Just stay in
371++ * local coordinates for now...
372++ */
373++ volume = clutter_actor_get_paint_volume (priv->actor);
374++ if (volume)
375+ {
376+- clutter_actor_box_get_size (&box, &fbo_width, &fbo_height);
377+- clutter_actor_box_get_origin (&box, &priv->x_offset, &priv->y_offset);
378++ ClutterPaintVolume mutable_volume;
379+
380+- fbo_width = MIN (fbo_width, stage_width);
381+- fbo_height = MIN (fbo_height, stage_height);
382++ _clutter_paint_volume_copy_static (volume, &mutable_volume);
383++ _clutter_paint_volume_get_bounding_box (&mutable_volume, &raw_box);
384++ clutter_paint_volume_free (&mutable_volume);
385+ }
386+ else
387+ {
388+- fbo_width = stage_width;
389+- fbo_height = stage_height;
390++ clutter_actor_get_allocation_box (priv->actor, &raw_box);
391+ }
392+
393+- if (fbo_width == stage_width)
394+- priv->x_offset = 0.0f;
395+- if (fbo_height == stage_height)
396+- priv->y_offset = 0.0f;
397++ box = raw_box;
398++ _clutter_actor_box_enlarge_for_effects (&box);
399++
400++ priv->fbo_offset_x = box.x1 - raw_box.x1;
401++ priv->fbo_offset_y = box.y1 - raw_box.y1;
402++
403++ clutter_actor_box_get_size (&box, &fbo_width, &fbo_height);
404+
405+ /* First assert that the framebuffer is the right size... */
406+ if (!update_fbo (effect, fbo_width, fbo_height))
407+ return FALSE;
408+
409+- texture_width = cogl_texture_get_width (priv->texture);
410+- texture_height = cogl_texture_get_height (priv->texture);
411+-
412+- /* get the current modelview matrix so that we can copy it to the
413+- * framebuffer. We also store the matrix that was last used when we
414+- * updated the FBO so that we can detect when we don't need to
415+- * update the FBO to paint a second time */
416+- cogl_get_modelview_matrix (&priv->last_matrix_drawn);
417++ cogl_get_modelview_matrix (&old_modelview);
418+
419+ /* let's draw offscreen */
420+ cogl_push_framebuffer (priv->offscreen);
421+
422+- /* Copy the modelview that would have been used if rendering onscreen */
423+- cogl_set_modelview_matrix (&priv->last_matrix_drawn);
424++ /* We don't want the FBO contents to be transformed. That could waste memory
425++ * (e.g. during zoom), or result in something that's not rectangular (clipped
426++ * incorrectly). So drop the modelview matrix of the current paint chain.
427++ * This is fine since paint_texture runs with the same modelview matrix,
428++ * so it will come out correctly whenever that is used to put the FBO
429++ * contents on screen...
430++ */
431++ clutter_actor_get_transform (priv->stage, &modelview);
432++ cogl_set_modelview_matrix (&modelview);
433+
434+- /* Set up the viewport so that it has the same size as the stage,
435+- * but offset it so that the actor of interest lands on our
436+- * framebuffer. */
437+- clutter_actor_get_size (priv->stage, &width, &height);
438++ /* Save the original viewport for calculating priv->position */
439++ _clutter_stage_get_viewport (CLUTTER_STAGE (priv->stage),
440++ &old_viewport[0],
441++ &old_viewport[1],
442++ &old_viewport[2],
443++ &old_viewport[3]);
444+
445+- /* Expand the viewport if the actor is partially off-stage,
446+- * otherwise the actor will end up clipped to the stage viewport
447++ /* Set up the viewport so that it has the same size as the stage (avoid
448++ * distortion), but translated to account for the FBO offset...
449+ */
450+- xexpand = 0.f;
451+- if (priv->x_offset < 0.f)
452+- xexpand = -priv->x_offset;
453+- if (priv->x_offset + texture_width > width)
454+- xexpand = MAX (xexpand, (priv->x_offset + texture_width) - width);
455+-
456+- yexpand = 0.f;
457+- if (priv->y_offset < 0.f)
458+- yexpand = -priv->y_offset;
459+- if (priv->y_offset + texture_height > height)
460+- yexpand = MAX (yexpand, (priv->y_offset + texture_height) - height);
461+-
462+- /* Set the viewport */
463+- cogl_set_viewport (-(priv->x_offset + xexpand), -(priv->y_offset + yexpand),
464+- width + (2 * xexpand), height + (2 * yexpand));
465++ cogl_set_viewport (-priv->fbo_offset_x,
466++ -priv->fbo_offset_y,
467++ stage_width,
468++ stage_height);
469+
470+ /* Copy the stage's projection matrix across to the framebuffer */
471+ _clutter_stage_get_projection_matrix (CLUTTER_STAGE (priv->stage),
472+ &projection);
473+
474+- /* If we've expanded the viewport, make sure to scale the projection
475+- * matrix accordingly (as it's been initialised to work with the
476+- * original viewport and not our expanded one).
477++ /* Now save the global position of the effect (not just of the actor).
478++ * It doesn't appear anyone actually uses this yet, but get_target_rect is
479++ * documented as returning it. So we should...
480+ */
481+- if (xexpand > 0.f || yexpand > 0.f)
482+- {
483+- gfloat new_width, new_height;
484+-
485+- new_width = width + (2 * xexpand);
486+- new_height = height + (2 * yexpand);
487+-
488+- cogl_matrix_scale (&projection,
489+- width / new_width,
490+- height / new_height,
491+- 1);
492+- }
493++ _clutter_util_fully_transform_vertices (&old_modelview,
494++ &projection,
495++ old_viewport,
496++ &local_offset,
497++ &priv->position,
498++ 1);
499+
500+ cogl_set_projection_matrix (&projection);
501+
502+@@ -385,13 +369,14 @@ clutter_offscreen_effect_paint_texture (ClutterOffscreenEffect *effect)
503+
504+ cogl_push_matrix ();
505+
506+- /* Now reset the modelview to put us in stage coordinates so
507+- * we can drawn the result of our offscreen render as a textured
508+- * quad... */
509+-
510+- cogl_matrix_init_identity (&modelview);
511+- _clutter_actor_apply_modelview_transform (priv->stage, &modelview);
512+- cogl_matrix_translate (&modelview, priv->x_offset, priv->y_offset, 0.0f);
513++ /* The current modelview matrix is *almost* perfect already. It's only
514++ * missing a correction for the expanded FBO and offset rendering within...
515++ */
516++ cogl_get_modelview_matrix (&modelview);
517++ cogl_matrix_translate (&modelview,
518++ priv->fbo_offset_x,
519++ priv->fbo_offset_y,
520++ 0.0f);
521+ cogl_set_modelview_matrix (&modelview);
522+
523+ /* paint the target material; this is virtualized for
524+@@ -428,16 +413,11 @@ clutter_offscreen_effect_paint (ClutterEffect *effect,
525+ {
526+ ClutterOffscreenEffect *self = CLUTTER_OFFSCREEN_EFFECT (effect);
527+ ClutterOffscreenEffectPrivate *priv = self->priv;
528+- CoglMatrix matrix;
529+-
530+- cogl_get_modelview_matrix (&matrix);
531+
532+- /* If we've already got a cached image for the same matrix and the
533+- actor hasn't been redrawn then we can just use the cached image
534+- in the fbo */
535+- if (priv->offscreen == NULL ||
536+- (flags & CLUTTER_EFFECT_PAINT_ACTOR_DIRTY) ||
537+- !cogl_matrix_equal (&matrix, &priv->last_matrix_drawn))
538++ /* If we've already got a cached image and the actor hasn't been redrawn
539++ * then we can just use the cached image in the FBO.
540++ */
541++ if (priv->offscreen == NULL || (flags & CLUTTER_EFFECT_PAINT_ACTOR_DIRTY))
542+ {
543+ /* Chain up to the parent paint method which will call the pre and
544+ post paint functions to update the image */
545+@@ -663,8 +643,8 @@ clutter_offscreen_effect_get_target_rect (ClutterOffscreenEffect *effect,
546+ return FALSE;
547+
548+ clutter_rect_init (rect,
549+- priv->x_offset,
550+- priv->y_offset,
551++ priv->position.x,
552++ priv->position.y,
553+ cogl_texture_get_width (priv->texture),
554+ cogl_texture_get_height (priv->texture));
555+
556+diff --git a/clutter/clutter/clutter-paint-volume.c b/clutter/clutter/clutter-paint-volume.c
557+index f340513..836812b 100644
558+--- a/clutter/clutter/clutter-paint-volume.c
559++++ b/clutter/clutter/clutter-paint-volume.c
560+@@ -37,6 +37,7 @@
561+ #include "clutter-paint-volume-private.h"
562+ #include "clutter-private.h"
563+ #include "clutter-stage-private.h"
564++#include "clutter-actor-box-private.h"
565+
566+ G_DEFINE_BOXED_TYPE (ClutterPaintVolume, clutter_paint_volume,
567+ clutter_paint_volume_copy,
568+@@ -1140,8 +1141,6 @@ _clutter_paint_volume_get_stage_paint_box (ClutterPaintVolume *pv,
569+ CoglMatrix modelview;
570+ CoglMatrix projection;
571+ float viewport[4];
572+- float width;
573+- float height;
574+
575+ _clutter_paint_volume_copy_static (pv, &projected_pv);
576+
577+@@ -1181,50 +1180,7 @@ _clutter_paint_volume_get_stage_paint_box (ClutterPaintVolume *pv,
578+ return;
579+ }
580+
581+- /* The aim here is that for a given rectangle defined with floating point
582+- * coordinates we want to determine a stable quantized size in pixels
583+- * that doesn't vary due to the original box's sub-pixel position.
584+- *
585+- * The reason this is important is because effects will use this
586+- * API to determine the size of offscreen framebuffers and so for
587+- * a fixed-size object that may be animated accross the screen we
588+- * want to make sure that the stage paint-box has an equally stable
589+- * size so that effects aren't made to continuously re-allocate
590+- * a corresponding fbo.
591+- *
592+- * The other thing we consider is that the calculation of this box is
593+- * subject to floating point precision issues that might be slightly
594+- * different to the precision issues involved with actually painting the
595+- * actor, which might result in painting slightly leaking outside the
596+- * user's calculated paint-volume. For this we simply aim to pad out the
597+- * paint-volume by at least half a pixel all the way around.
598+- */
599+- width = box->x2 - box->x1;
600+- height = box->y2 - box->y1;
601+- width = CLUTTER_NEARBYINT (width);
602+- height = CLUTTER_NEARBYINT (height);
603+- /* XXX: NB the width/height may now be up to 0.5px too small so we
604+- * must also pad by 0.25px all around to account for this. In total we
605+- * must padd by at least 0.75px around all sides. */
606+-
607+- /* XXX: The furthest that we can overshoot the bottom right corner by
608+- * here is 1.75px in total if you consider that the 0.75 padding could
609+- * just cross an integer boundary and so ceil will effectively add 1.
610+- */
611+- box->x2 = ceilf (box->x2 + 0.75);
612+- box->y2 = ceilf (box->y2 + 0.75);
613+-
614+- /* Now we redefine the top-left relative to the bottom right based on the
615+- * rounded width/height determined above + a constant so that the overall
616+- * size of the box will be stable and not dependant on the box's
617+- * position.
618+- *
619+- * Adding 3px to the width/height will ensure we cover the maximum of
620+- * 1.75px padding on the bottom/right and still ensure we have > 0.75px
621+- * padding on the top/left.
622+- */
623+- box->x1 = box->x2 - width - 3;
624+- box->y1 = box->y2 - height - 3;
625++ _clutter_actor_box_enlarge_for_effects (box);
626+
627+ clutter_paint_volume_free (&projected_pv);
628+ }
629+diff --git a/clutter/tests/conform/Makefile.am b/clutter/tests/conform/Makefile.am
630+index 9cef08b..afa9dad 100644
631+--- a/clutter/tests/conform/Makefile.am
632++++ b/clutter/tests/conform/Makefile.am
633+@@ -25,7 +25,6 @@ actor_tests = \
634+ actor-iter \
635+ actor-layout \
636+ actor-meta \
637+- actor-offscreen-limit-max-size \
638+ actor-offscreen-redirect \
639+ actor-paint-opacity \
640+ actor-pick \
641+diff --git a/clutter/tests/conform/actor-offscreen-limit-max-size.c b/clutter/tests/conform/actor-offscreen-limit-max-size.c
642+deleted file mode 100644
643+index 943c7d8..0000000
644+--- a/clutter/tests/conform/actor-offscreen-limit-max-size.c
645++++ /dev/null
646+@@ -1,119 +0,0 @@
647+-#define CLUTTER_ENABLE_EXPERIMENTAL_API
648+-#include <clutter/clutter.h>
649+-
650+-#define STAGE_WIDTH (300)
651+-#define STAGE_HEIGHT (300)
652+-
653+-typedef struct
654+-{
655+- ClutterActor *stage;
656+-
657+- ClutterActor *actor_group1;
658+- ClutterEffect *blur_effect1;
659+-
660+- ClutterActor *actor_group2;
661+- ClutterEffect *blur_effect2;
662+-} Data;
663+-
664+-static void
665+-check_results (ClutterStage *stage, gpointer user_data)
666+-{
667+- Data *data = user_data;
668+- gfloat width, height;
669+- ClutterRect rect;
670+-
671+- clutter_offscreen_effect_get_target_rect (CLUTTER_OFFSCREEN_EFFECT (data->blur_effect1),
672+- &rect);
673+-
674+- width = clutter_rect_get_width (&rect);
675+- height = clutter_rect_get_height (&rect);
676+-
677+- if (g_test_verbose ())
678+- g_print ("Checking effect1 size: %.2f x %.2f\n",
679+- clutter_rect_get_width (&rect),
680+- clutter_rect_get_height (&rect));
681+-
682+- g_assert_cmpint (width, <, STAGE_WIDTH);
683+- g_assert_cmpint (height, <, STAGE_HEIGHT);
684+-
685+- clutter_offscreen_effect_get_target_rect (CLUTTER_OFFSCREEN_EFFECT (data->blur_effect2),
686+- &rect);
687+-
688+- width = clutter_rect_get_width (&rect);
689+- height = clutter_rect_get_height (&rect);
690+-
691+- if (g_test_verbose ())
692+- g_print ("Checking effect2 size: %.2f x %.2f\n", width, height);
693+-
694+- g_assert_cmpint (width, ==, STAGE_WIDTH);
695+- g_assert_cmpint (height, ==, STAGE_HEIGHT);
696+-
697+-
698+- clutter_main_quit ();
699+-}
700+-
701+-static ClutterActor *
702+-create_actor (gfloat x, gfloat y,
703+- gfloat width, gfloat height,
704+- const ClutterColor *color)
705+-{
706+- return g_object_new (CLUTTER_TYPE_ACTOR,
707+- "x", x,
708+- "y", y,
709+- "width", width,
710+- "height", height,
711+- "background-color", color,
712+- NULL);
713+-}
714+-
715+-static void
716+-actor_offscreen_limit_max_size (void)
717+-{
718+- Data data;
719+-
720+- if (!cogl_features_available (COGL_FEATURE_OFFSCREEN))
721+- return;
722+-
723+- data.stage = clutter_test_get_stage ();
724+- g_signal_connect (data.stage, "after-paint",
725+- G_CALLBACK (check_results), &data);
726+- clutter_actor_set_size (data.stage, STAGE_WIDTH, STAGE_HEIGHT);
727+-
728+- data.actor_group1 = clutter_actor_new ();
729+- clutter_actor_add_child (data.stage, data.actor_group1);
730+- data.blur_effect1 = clutter_blur_effect_new ();
731+- clutter_actor_add_effect (data.actor_group1, data.blur_effect1);
732+- clutter_actor_add_child (data.actor_group1,
733+- create_actor (10, 10,
734+- 100, 100,
735+- CLUTTER_COLOR_Blue));
736+- clutter_actor_add_child (data.actor_group1,
737+- create_actor (100, 100,
738+- 100, 100,
739+- CLUTTER_COLOR_Gray));
740+-
741+- data.actor_group2 = clutter_actor_new ();
742+- clutter_actor_add_child (data.stage, data.actor_group2);
743+- data.blur_effect2 = clutter_blur_effect_new ();
744+- clutter_actor_add_effect (data.actor_group2, data.blur_effect2);
745+- clutter_actor_add_child (data.actor_group2,
746+- create_actor (-10, -10,
747+- 100, 100,
748+- CLUTTER_COLOR_Yellow));
749+- clutter_actor_add_child (data.actor_group2,
750+- create_actor (250, 10,
751+- 100, 100,
752+- CLUTTER_COLOR_ScarletRed));
753+- clutter_actor_add_child (data.actor_group2,
754+- create_actor (10, 250,
755+- 100, 100,
756+- CLUTTER_COLOR_Yellow));
757+-
758+- clutter_actor_show (data.stage);
759+-
760+- clutter_main ();
761+-}
762+-
763+-CLUTTER_TEST_SUITE (
764+- CLUTTER_TEST_UNIT ("/actor/offscreen/limit-max-size", actor_offscreen_limit_max_size)
765+-)
766+diff --git a/clutter/tests/conform/actor-offscreen-redirect.c b/clutter/tests/conform/actor-offscreen-redirect.c
767+index 63d5e6c..9dbb7d2 100644
768+--- a/clutter/tests/conform/actor-offscreen-redirect.c
769++++ b/clutter/tests/conform/actor-offscreen-redirect.c
770+@@ -189,10 +189,11 @@ verify_redraws (gpointer user_data)
771+ clutter_actor_queue_redraw (data->child);
772+ verify_redraw (data, 1);
773+
774+- /* Modifying the transformation on the parent should cause a
775+- redraw */
776++ /* Modifying the transformation on the parent should not cause a redraw,
777++ since the FBO stores pre-transformed rendering that can be reused with
778++ any transformation. */
779+ clutter_actor_set_anchor_point (data->parent_container, 0, 1);
780+- verify_redraw (data, 1);
781++ verify_redraw (data, 0);
782+
783+ /* Redrawing an unrelated actor shouldn't cause a redraw */
784+ clutter_actor_set_position (data->unrelated_actor, 0, 1);
785diff --git a/debian/patches/clutter-x11-Implement-keycode-lookup-from-keysyms-on-virt.patch b/debian/patches/clutter-x11-Implement-keycode-lookup-from-keysyms-on-virt.patch
786deleted file mode 100644
787index ccb4263..0000000
788--- a/debian/patches/clutter-x11-Implement-keycode-lookup-from-keysyms-on-virt.patch
789+++ /dev/null
790@@ -1,316 +0,0 @@
791-From: Carlos Garnacho <carlosg@gnome.org>
792-Date: Fri, 29 Jun 2018 14:31:23 +0200
793-Subject: clutter/x11: Implement keycode lookup from keysyms on virtual key
794- devices
795-
796-Unfortunately XKeysymToKeycode() falls short in that it coalesces keysyms
797-into keycodes pertaining to the first level (i.e. lowercase). Add a
798-ClutterKeymapX11 method (much alike its GdkKeymap counterpart) to look up
799-all matches for the given keysym.
800-
801-Two other helper methods have been added so the virtual device can fetch
802-the current keyboard group, and latch modifiers for key emission. Combining
803-all this, the virtual device is now able to handle keycodes in further
804-levels.
805-
806-Closes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/135
807-
808-(cherry picked from commit 85284acb000ddc70afcf716b6c198b4b5bf5741e)
809-
810-Ubuntu-Bug: https://bugs.launchpad.net/oem-priority/+bug/1730211
811-Applied-Upstream: yes, 3.28.4
812----
813- clutter/clutter/x11/clutter-keymap-x11.c | 178 ++++++++++++++++++++-
814- clutter/clutter/x11/clutter-keymap-x11.h | 8 +
815- .../clutter/x11/clutter-virtual-input-device-x11.c | 22 ++-
816- 3 files changed, 204 insertions(+), 4 deletions(-)
817-
818-diff --git a/clutter/clutter/x11/clutter-keymap-x11.c b/clutter/clutter/x11/clutter-keymap-x11.c
819-index 914e314..c34e676 100644
820---- a/clutter/clutter/x11/clutter-keymap-x11.c
821-+++ b/clutter/clutter/x11/clutter-keymap-x11.c
822-@@ -38,6 +38,14 @@
823-
824- typedef struct _ClutterKeymapX11Class ClutterKeymapX11Class;
825- typedef struct _DirectionCacheEntry DirectionCacheEntry;
826-+typedef struct _ClutterKeymapKey ClutterKeymapKey;
827-+
828-+struct _ClutterKeymapKey
829-+{
830-+ guint keycode;
831-+ guint group;
832-+ guint level;
833-+};
834-
835- struct _DirectionCacheEntry
836- {
837-@@ -59,6 +67,7 @@ struct _ClutterKeymapX11
838-
839- ClutterModifierType num_lock_mask;
840- ClutterModifierType scroll_lock_mask;
841-+ ClutterModifierType level3_shift_mask;
842-
843- PangoDirection current_direction;
844-
845-@@ -69,6 +78,7 @@ struct _ClutterKeymapX11
846- Atom current_group_atom;
847- guint current_cache_serial;
848- DirectionCacheEntry group_direction_cache[4];
849-+ int current_group;
850- #endif
851-
852- guint caps_lock_state : 1;
853-@@ -198,6 +208,9 @@ get_xkb (ClutterKeymapX11 *keymap_x11)
854- if (keymap_x11->scroll_lock_mask == 0)
855- keymap_x11->scroll_lock_mask = XkbKeysymToModifiers (backend_x11->xdpy,
856- XK_Scroll_Lock);
857-+ if (keymap_x11->level3_shift_mask == 0)
858-+ keymap_x11->level3_shift_mask = XkbKeysymToModifiers (backend_x11->xdpy,
859-+ XK_ISO_Level3_Shift);
860-
861- return keymap_x11->xkb_desc;
862- }
863-@@ -469,6 +482,7 @@ static void
864- clutter_keymap_x11_init (ClutterKeymapX11 *keymap)
865- {
866- keymap->current_direction = PANGO_DIRECTION_NEUTRAL;
867-+ keymap->current_group = -1;
868- }
869-
870- static ClutterTranslateReturn
871-@@ -498,7 +512,8 @@ clutter_keymap_x11_translate_event (ClutterEventTranslator *translator,
872- {
873- case XkbStateNotify:
874- CLUTTER_NOTE (EVENT, "Updating keyboard state");
875-- update_direction (keymap_x11, XkbStateGroup (&xkb_event->state));
876-+ keymap_x11->current_group = XkbStateGroup (&xkb_event->state);
877-+ update_direction (keymap_x11, keymap_x11->current_group);
878- update_locked_mods (keymap_x11, xkb_event->state.locked_mods);
879- retval = CLUTTER_TRANSLATE_REMOVE;
880- break;
881-@@ -665,3 +680,164 @@ _clutter_keymap_x11_get_direction (ClutterKeymapX11 *keymap)
882- #endif
883- return PANGO_DIRECTION_NEUTRAL;
884- }
885-+
886-+static gboolean
887-+clutter_keymap_x11_get_entries_for_keyval (ClutterKeymapX11 *keymap_x11,
888-+ guint keyval,
889-+ ClutterKeymapKey **keys,
890-+ gint *n_keys)
891-+{
892-+#ifdef HAVE_XKB
893-+ if (CLUTTER_BACKEND_X11 (keymap_x11->backend)->use_xkb)
894-+ {
895-+ XkbDescRec *xkb = get_xkb (keymap_x11);
896-+ GArray *retval;
897-+ gint keycode;
898-+
899-+ keycode = keymap_x11->min_keycode;
900-+ retval = g_array_new (FALSE, FALSE, sizeof (ClutterKeymapKey));
901-+
902-+ while (keycode <= keymap_x11->max_keycode)
903-+ {
904-+ gint max_shift_levels = XkbKeyGroupsWidth (xkb, keycode);
905-+ gint group = 0;
906-+ gint level = 0;
907-+ gint total_syms = XkbKeyNumSyms (xkb, keycode);
908-+ gint i = 0;
909-+ KeySym *entry;
910-+
911-+ /* entry is an array with all syms for group 0, all
912-+ * syms for group 1, etc. and for each group the
913-+ * shift level syms are in order
914-+ */
915-+ entry = XkbKeySymsPtr (xkb, keycode);
916-+
917-+ while (i < total_syms)
918-+ {
919-+ g_assert (i == (group * max_shift_levels + level));
920-+
921-+ if (entry[i] == keyval)
922-+ {
923-+ ClutterKeymapKey key;
924-+
925-+ key.keycode = keycode;
926-+ key.group = group;
927-+ key.level = level;
928-+
929-+ g_array_append_val (retval, key);
930-+
931-+ g_assert (XkbKeySymEntry (xkb, keycode, level, group) ==
932-+ keyval);
933-+ }
934-+
935-+ ++level;
936-+
937-+ if (level == max_shift_levels)
938-+ {
939-+ level = 0;
940-+ ++group;
941-+ }
942-+
943-+ ++i;
944-+ }
945-+
946-+ ++keycode;
947-+ }
948-+
949-+ if (retval->len > 0)
950-+ {
951-+ *keys = (ClutterKeymapKey*) retval->data;
952-+ *n_keys = retval->len;
953-+ }
954-+ else
955-+ {
956-+ *keys = NULL;
957-+ *n_keys = 0;
958-+ }
959-+
960-+ g_array_free (retval, retval->len > 0 ? FALSE : TRUE);
961-+
962-+ return *n_keys > 0;
963-+ }
964-+ else
965-+#endif
966-+ {
967-+ return FALSE;
968-+ }
969-+}
970-+
971-+void
972-+clutter_keymap_x11_latch_modifiers (ClutterKeymapX11 *keymap_x11,
973-+ uint32_t level,
974-+ gboolean enable)
975-+{
976-+#ifdef HAVE_XKB
977-+ ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (keymap_x11->backend);
978-+ uint32_t modifiers[] = {
979-+ 0,
980-+ ShiftMask,
981-+ keymap_x11->level3_shift_mask,
982-+ keymap_x11->level3_shift_mask | ShiftMask,
983-+ };
984-+ uint32_t value = 0;
985-+
986-+ if (!backend_x11->use_xkb)
987-+ return;
988-+
989-+ level = CLAMP (level, 0, G_N_ELEMENTS (modifiers) - 1);
990-+
991-+ if (enable)
992-+ value = modifiers[level];
993-+ else
994-+ value = 0;
995-+
996-+ XkbLatchModifiers (clutter_x11_get_default_display (),
997-+ XkbUseCoreKbd, modifiers[level],
998-+ value);
999-+#endif
1000-+}
1001-+
1002-+static uint32_t
1003-+clutter_keymap_x11_get_current_group (ClutterKeymapX11 *keymap_x11)
1004-+{
1005-+ ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (keymap_x11->backend);
1006-+ XkbStateRec state_rec;
1007-+
1008-+ if (keymap_x11->current_group >= 0)
1009-+ return keymap_x11->current_group;
1010-+
1011-+ XkbGetState (backend_x11->xdpy, XkbUseCoreKbd, &state_rec);
1012-+ return XkbStateGroup (&state_rec);
1013-+}
1014-+
1015-+gboolean
1016-+clutter_keymap_x11_keycode_for_keyval (ClutterKeymapX11 *keymap_x11,
1017-+ guint keyval,
1018-+ guint *keycode_out,
1019-+ guint *level_out)
1020-+{
1021-+ ClutterKeymapKey *keys;
1022-+ gint i, n_keys, group;
1023-+ gboolean found = FALSE;
1024-+
1025-+ g_return_val_if_fail (keycode_out != NULL, FALSE);
1026-+ g_return_val_if_fail (level_out != NULL, FALSE);
1027-+
1028-+ group = clutter_keymap_x11_get_current_group (keymap_x11);
1029-+
1030-+ if (!clutter_keymap_x11_get_entries_for_keyval (keymap_x11, keyval, &keys, &n_keys))
1031-+ return FALSE;
1032-+
1033-+ for (i = 0; i < n_keys && !found; i++)
1034-+ {
1035-+ if (keys[i].group == group)
1036-+ {
1037-+ *keycode_out = keys[i].keycode;
1038-+ *level_out = keys[i].level;
1039-+ found = TRUE;
1040-+ }
1041-+ }
1042-+
1043-+ g_free (keys);
1044-+ return found;
1045-+}
1046-diff --git a/clutter/clutter/x11/clutter-keymap-x11.h b/clutter/clutter/x11/clutter-keymap-x11.h
1047-index ad673a2..4b5b403 100644
1048---- a/clutter/clutter/x11/clutter-keymap-x11.h
1049-+++ b/clutter/clutter/x11/clutter-keymap-x11.h
1050-@@ -51,6 +51,14 @@ gboolean _clutter_keymap_x11_get_is_modifier (ClutterKeymapX11 *keymap,
1051-
1052- PangoDirection _clutter_keymap_x11_get_direction (ClutterKeymapX11 *keymap);
1053-
1054-+gboolean clutter_keymap_x11_keycode_for_keyval (ClutterKeymapX11 *keymap_x11,
1055-+ guint keyval,
1056-+ guint *keycode_out,
1057-+ guint *level_out);
1058-+void clutter_keymap_x11_latch_modifiers (ClutterKeymapX11 *keymap_x11,
1059-+ uint32_t level,
1060-+ gboolean enable);
1061-+
1062- G_END_DECLS
1063-
1064- #endif /* __CLUTTER_KEYMAP_X11_H__ */
1065-diff --git a/clutter/clutter/x11/clutter-virtual-input-device-x11.c b/clutter/clutter/x11/clutter-virtual-input-device-x11.c
1066-index 416c944..b86ded0 100644
1067---- a/clutter/clutter/x11/clutter-virtual-input-device-x11.c
1068-+++ b/clutter/clutter/x11/clutter-virtual-input-device-x11.c
1069-@@ -32,6 +32,8 @@
1070-
1071- #include "clutter-virtual-input-device.h"
1072- #include "x11/clutter-virtual-input-device-x11.h"
1073-+#include "x11/clutter-backend-x11.h"
1074-+#include "x11/clutter-keymap-x11.h"
1075-
1076- struct _ClutterVirtualInputDeviceX11
1077- {
1078-@@ -135,11 +137,25 @@ clutter_virtual_input_device_x11_notify_keyval (ClutterVirtualInputDevice *virtu
1079- uint32_t keyval,
1080- ClutterKeyState key_state)
1081- {
1082-- KeyCode keycode;
1083-+ ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (clutter_get_default_backend ());
1084-+ ClutterKeymapX11 *keymap = backend_x11->keymap;
1085-+ uint32_t keycode, level;
1086-+
1087-+ if (!clutter_keymap_x11_keycode_for_keyval (keymap, keyval, &keycode, &level))
1088-+ {
1089-+ g_warning ("No keycode found for keyval %x in current group", keyval);
1090-+ return;
1091-+ }
1092-+
1093-+ if (key_state == CLUTTER_KEY_STATE_PRESSED)
1094-+ clutter_keymap_x11_latch_modifiers (keymap, level, TRUE);
1095-
1096-- keycode = XKeysymToKeycode (clutter_x11_get_default_display (), keyval);
1097- XTestFakeKeyEvent (clutter_x11_get_default_display (),
1098-- keycode, key_state == CLUTTER_KEY_STATE_PRESSED, 0);
1099-+ (KeyCode) keycode,
1100-+ key_state == CLUTTER_KEY_STATE_PRESSED, 0);
1101-+
1102-+ if (key_state == CLUTTER_KEY_STATE_RELEASED)
1103-+ clutter_keymap_x11_latch_modifiers (keymap, level, FALSE);
1104- }
1105-
1106- static void
1107diff --git a/debian/patches/core-Return-1-if-meta_window_get_monitor-is-called-on-an-.patch b/debian/patches/core-Return-1-if-meta_window_get_monitor-is-called-on-an-.patch
1108deleted file mode 100644
1109index 171c91a..0000000
1110--- a/debian/patches/core-Return-1-if-meta_window_get_monitor-is-called-on-an-.patch
1111+++ /dev/null
1112@@ -1,39 +0,0 @@
1113-From: Sam Spilsbury <sam@endlessm.com>
1114-Date: Tue, 10 Oct 2017 11:39:40 -0500
1115-Subject: core: Return -1 if meta_window_get_monitor is called on an unmanaged
1116- window
1117-
1118-As opposed to crashing. In this case, letting the caller deal with
1119-it is the best policy, since this is public API.
1120-
1121-Fixes #78834
1122-
1123-Forwarded: yes
1124-Bug: https://bugzilla.gnome.org/show_bug.cgi?id=788834
1125-Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/bionic/+source/gnome-shell/+bug/1724439
1126----
1127- src/core/window.c | 7 ++++++-
1128- 1 file changed, 6 insertions(+), 1 deletion(-)
1129-
1130-diff --git a/src/core/window.c b/src/core/window.c
1131-index cc0813a..f9094a3 100644
1132---- a/src/core/window.c
1133-+++ b/src/core/window.c
1134-@@ -3752,11 +3752,16 @@ maybe_move_attached_dialog (MetaWindow *window,
1135- *
1136- * Gets index of the monitor that this window is on.
1137- *
1138-- * Return Value: The index of the monitor in the screens monitor list
1139-+ * Return Value: The index of the monitor in the screens monitor list, or -1
1140-+ * if the window has been recently unmanaged and does not have
1141-+ * a monitor.
1142- */
1143- int
1144- meta_window_get_monitor (MetaWindow *window)
1145- {
1146-+ if (!window->monitor)
1147-+ return -1;
1148-+
1149- return window->monitor->number;
1150- }
1151-
1152diff --git a/debian/patches/debian/skip-failing-tests-325.patch b/debian/patches/debian/skip-failing-tests-325.patch
1153index a443ddf..54d8f62 100644
1154--- a/debian/patches/debian/skip-failing-tests-325.patch
1155+++ b/debian/patches/debian/skip-failing-tests-325.patch
1156@@ -11,13 +11,13 @@ Applied-upstream: no
1157 1 file changed, 1 deletion(-)
1158
1159 diff --git a/clutter/tests/conform/Makefile.am b/clutter/tests/conform/Makefile.am
1160-index bca10dc..a2b7bee 100644
1161+index 840e120..2bd7f4d 100644
1162 --- a/clutter/tests/conform/Makefile.am
1163 +++ b/clutter/tests/conform/Makefile.am
1164-@@ -26,7 +26,6 @@ actor_tests = \
1165+@@ -25,7 +25,6 @@ actor_tests = \
1166+ actor-iter \
1167 actor-layout \
1168 actor-meta \
1169- actor-offscreen-limit-max-size \
1170 - actor-offscreen-redirect \
1171 actor-paint-opacity \
1172 actor-size \
1173diff --git a/debian/patches/debian/skip-failing-tests.patch b/debian/patches/debian/skip-failing-tests.patch
1174index 68cdca6..205962c 100644
1175--- a/debian/patches/debian/skip-failing-tests.patch
1176+++ b/debian/patches/debian/skip-failing-tests.patch
1177@@ -12,11 +12,11 @@ Applied-upstream: no
1178 1 file changed, 2 deletions(-)
1179
1180 diff --git a/clutter/tests/conform/Makefile.am b/clutter/tests/conform/Makefile.am
1181-index 9cef08b..bca10dc 100644
1182+index afa9dad..840e120 100644
1183 --- a/clutter/tests/conform/Makefile.am
1184 +++ b/clutter/tests/conform/Makefile.am
1185-@@ -28,8 +28,6 @@ actor_tests = \
1186- actor-offscreen-limit-max-size \
1187+@@ -27,8 +27,6 @@ actor_tests = \
1188+ actor-meta \
1189 actor-offscreen-redirect \
1190 actor-paint-opacity \
1191 - actor-pick \
1192diff --git a/debian/patches/gpu-kms-Don-t-crash-if-drmModeGetResources-returns-N.patch b/debian/patches/gpu-kms-Don-t-crash-if-drmModeGetResources-returns-N.patch
1193deleted file mode 100644
1194index 9bc47f9..0000000
1195--- a/debian/patches/gpu-kms-Don-t-crash-if-drmModeGetResources-returns-N.patch
1196+++ /dev/null
1197@@ -1,37 +0,0 @@
1198-From: Aaron Plattner <aplattner@nvidia.com>
1199-Date: Thu, 19 Jul 2018 10:51:34 -0700
1200-Subject: gpu-kms: Don't crash if drmModeGetResources returns NULL
1201-
1202-DRM drivers can be opened by meta_launcher_open_restricted() even if they don't
1203-implement modesetting. However, drmModeGetResources() will return NULL.
1204-
1205-Check whether that happened in meta_gpu_kms_new() and return with an error
1206-instead of crashing.
1207-
1208-Fixes #223.
1209-
1210-Applied-Upstream: https://gitlab.gnome.org/GNOME/mutter/commit/62660bbd15
1211-Bug-GNOME: https://gitlab.gnome.org/GNOME/mutter/issues/223
1212-Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/gnome-shell/+bug/1767956
1213----
1214- src/backends/native/meta-gpu-kms.c | 7 +++++++
1215- 1 file changed, 7 insertions(+)
1216-
1217-diff --git a/src/backends/native/meta-gpu-kms.c b/src/backends/native/meta-gpu-kms.c
1218-index 613a607..259cd71 100644
1219---- a/src/backends/native/meta-gpu-kms.c
1220-+++ b/src/backends/native/meta-gpu-kms.c
1221-@@ -801,6 +801,13 @@ meta_gpu_kms_new (MetaMonitorManagerKms *monitor_manager_kms,
1222- */
1223- drm_resources = drmModeGetResources (kms_fd);
1224-
1225-+ if (!drm_resources)
1226-+ {
1227-+ g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, "No resources");
1228-+ meta_launcher_close_restricted (launcher, kms_fd);
1229-+ return NULL;
1230-+ }
1231-+
1232- n_connectors = drm_resources->count_connectors;
1233-
1234- drmModeFreeResources (drm_resources);
1235diff --git a/debian/patches/monitor-Use-current-monitor-mode-to-check-whether-active.patch b/debian/patches/monitor-Use-current-monitor-mode-to-check-whether-active.patch
1236deleted file mode 100644
1237index 9badb76..0000000
1238--- a/debian/patches/monitor-Use-current-monitor-mode-to-check-whether-active.patch
1239+++ /dev/null
1240@@ -1,84 +0,0 @@
1241-From: =?utf-8?q?Jonas_=C3=85dahl?= <jadahl@gmail.com>
1242-Date: Tue, 31 Jul 2018 13:18:51 +0200
1243-Subject: monitor: Use current monitor mode to check whether active
1244-
1245-For historical reasons meta_monitor_is_active() checked whether it is
1246-active by checking whether the main output have a CRTC assigned and
1247-whether that CRTC has a current mode. At a later point, the MetaMonitor
1248-got its own mode abstraction (MetaMonitorMode), but
1249-meta_monitor_is_active() was never updated to use this.
1250-
1251-An issue with checking the main output's CRTC state is that, if there is
1252-some CRTC mode combination that for some reason isn't properly detected
1253-by the MetaMonitorMode abstraction (e.g. some tiling configuration not
1254-yet handled), meta_monitor_is_active() would return TRUE, even though no
1255-(abstracted) mode was set. This would cause confusion here and there,
1256-leading to NULL pointer dereferences due to the assumption that if a
1257-monitor is active, it has an active mode.
1258-
1259-Instead, change meta_monitor_is_active() to directly check the current
1260-monitor mode, and log a warning if the main output still happen to have
1261-a CRTC with a mode assigned to it. This way, when an not undrestood CRTC
1262-mode combination is encountered, instead of dereferencing NULL pointers,
1263-simply assume the monitor is not active, which means that it will not be
1264-managed or rendered by mutter at all.
1265-
1266-https://gitlab.gnome.org/GNOME/mutter/issues/130
1267-
1268-(cherry picked from commit 4d465eac0806eb1ead375e2852d4a9d6bc24524f)
1269-
1270-Bug-GNOME: https://gitlab.gnome.org/GNOME/mutter/issues/130
1271-Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/gnome-shell/+bug/1723615
1272-Applied-Upstream: 3.28.4, commit:https://gitlab.gnome.org/GNOME/mutter/commit/d0d80780
1273----
1274- src/backends/meta-monitor.c | 22 ++++++++++++++++------
1275- 1 file changed, 16 insertions(+), 6 deletions(-)
1276-
1277-diff --git a/src/backends/meta-monitor.c b/src/backends/meta-monitor.c
1278-index 92c61c0..60f3674 100644
1279---- a/src/backends/meta-monitor.c
1280-+++ b/src/backends/meta-monitor.c
1281-@@ -203,13 +203,9 @@ meta_monitor_get_main_output (MetaMonitor *monitor)
1282- gboolean
1283- meta_monitor_is_active (MetaMonitor *monitor)
1284- {
1285-- MetaOutput *output;
1286-- MetaCrtc *crtc;
1287--
1288-- output = meta_monitor_get_main_output (monitor);
1289-- crtc = meta_output_get_assigned_crtc (output);
1290-+ MetaMonitorPrivate *priv = meta_monitor_get_instance_private (monitor);
1291-
1292-- return crtc && crtc->current_mode;
1293-+ return !!priv->current_mode;
1294- }
1295-
1296- gboolean
1297-@@ -1411,6 +1407,18 @@ meta_monitor_get_current_mode (MetaMonitor *monitor)
1298- return priv->current_mode;
1299- }
1300-
1301-+static gboolean
1302-+is_current_mode_known (MetaMonitor *monitor)
1303-+{
1304-+ MetaOutput *output;
1305-+ MetaCrtc *crtc;
1306-+
1307-+ output = meta_monitor_get_main_output (monitor);
1308-+ crtc = meta_output_get_assigned_crtc (output);
1309-+
1310-+ return meta_monitor_is_active (monitor) == (crtc && crtc->current_mode);
1311-+}
1312-+
1313- void
1314- meta_monitor_derive_current_mode (MetaMonitor *monitor)
1315- {
1316-@@ -1430,6 +1438,8 @@ meta_monitor_derive_current_mode (MetaMonitor *monitor)
1317- }
1318-
1319- priv->current_mode = current_mode;
1320-+
1321-+ g_warn_if_fail (is_current_mode_known (monitor));
1322- }
1323-
1324- void
1325diff --git a/debian/patches/monitor-manager-Filter-out-low-screen-resolutions.patch b/debian/patches/monitor-manager-Filter-out-low-screen-resolutions.patch
1326deleted file mode 100644
1327index f1ae69c..0000000
1328--- a/debian/patches/monitor-manager-Filter-out-low-screen-resolutions.patch
1329+++ /dev/null
1330@@ -1,90 +0,0 @@
1331-From: Andrea Azzarone <azzaronea@gmail.com>
1332-Date: Mon, 16 Jul 2018 18:09:40 +0200
1333-Subject: monitor-manager: Filter out low screen resolutions
1334-
1335-Avoid exporting through org.gnome.Mutter.DisplayConfig.GetCurrentState
1336-excessively-low screen resolutions setting both a minimum width and a minimum
1337-height. GetCurrentState is e.g. used by Gnome Control Center to build a list of
1338-selectable resolutions.
1339-
1340-Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=793223
1341-
1342-(cherry picked from commit 649c26e05a67c52a4f5acf6b4aa3b1217e9bc9c0)
1343-
1344-Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/gnome-control-center/+bug/1772831
1345-Bug-GNOME: https://bugzilla.gnome.org/show_bug.cgi?id=793223
1346-Applied-Upstream: 3.28.4, commit:https://gitlab.gnome.org/GNOME/mutter/commit/0c5e61a2a
1347----
1348- src/backends/meta-monitor-manager.c | 4 ++++
1349- src/backends/meta-monitor.c | 19 +++++++++++++++++--
1350- src/backends/meta-monitor.h | 2 ++
1351- 3 files changed, 23 insertions(+), 2 deletions(-)
1352-
1353-diff --git a/src/backends/meta-monitor-manager.c b/src/backends/meta-monitor-manager.c
1354-index 5bd34ad..c4c1db5 100644
1355---- a/src/backends/meta-monitor-manager.c
1356-+++ b/src/backends/meta-monitor-manager.c
1357-@@ -1323,9 +1323,13 @@ meta_monitor_manager_handle_get_current_state (MetaDBusDisplayConfig *skeleton,
1358- GVariantBuilder mode_properties_builder;
1359- MetaCrtcModeFlag mode_flags;
1360-
1361-+ if (!meta_monitor_mode_should_be_advertised (monitor_mode))
1362-+ continue;
1363-+
1364- mode_id = meta_monitor_mode_get_id (monitor_mode);
1365- meta_monitor_mode_get_resolution (monitor_mode,
1366- &mode_width, &mode_height);
1367-+
1368- refresh_rate = meta_monitor_mode_get_refresh_rate (monitor_mode);
1369-
1370- preferred_scale =
1371-diff --git a/src/backends/meta-monitor.c b/src/backends/meta-monitor.c
1372-index 9833066..92c61c0 100644
1373---- a/src/backends/meta-monitor.c
1374-+++ b/src/backends/meta-monitor.c
1375-@@ -1553,6 +1553,22 @@ meta_monitor_calculate_mode_scale (MetaMonitor *monitor,
1376- return calculate_scale (monitor, monitor_mode);
1377- }
1378-
1379-+static gboolean
1380-+is_logical_size_large_enough (gint width, gint height)
1381-+{
1382-+ return width >= MINIMUM_LOGICAL_WIDTH &&
1383-+ height >= MINIMUM_LOGICAL_HEIGHT;
1384-+}
1385-+
1386-+gboolean
1387-+meta_monitor_mode_should_be_advertised (MetaMonitorMode *monitor_mode)
1388-+{
1389-+ g_return_val_if_fail (monitor_mode != NULL, FALSE);
1390-+
1391-+ return is_logical_size_large_enough (monitor_mode->spec.width,
1392-+ monitor_mode->spec.height);
1393-+}
1394-+
1395- static float
1396- get_closest_scale_factor_for_resolution (float width,
1397- float height,
1398-@@ -1573,8 +1589,7 @@ get_closest_scale_factor_for_resolution (float width,
1399-
1400- if (scale < MINIMUM_SCALE_FACTOR ||
1401- scale > MAXIMUM_SCALE_FACTOR ||
1402-- floorf (scaled_w) < MINIMUM_LOGICAL_WIDTH ||
1403-- floorf (scaled_h) < MINIMUM_LOGICAL_HEIGHT)
1404-+ !is_logical_size_large_enough (floorf (scaled_w), floorf (scaled_h)))
1405- goto out;
1406-
1407- if (floorf (scaled_w) == scaled_w && floorf (scaled_h) == scaled_h)
1408-diff --git a/src/backends/meta-monitor.h b/src/backends/meta-monitor.h
1409-index bc79778..213ff2c 100644
1410---- a/src/backends/meta-monitor.h
1411-+++ b/src/backends/meta-monitor.h
1412-@@ -219,6 +219,8 @@ gboolean meta_monitor_mode_foreach_output (MetaMonitor *monitor,
1413- gpointer user_data,
1414- GError **error);
1415-
1416-+gboolean meta_monitor_mode_should_be_advertised (MetaMonitorMode *monitor_mode);
1417-+
1418- MetaMonitorSpec * meta_monitor_spec_clone (MetaMonitorSpec *monitor_id);
1419-
1420- gboolean meta_monitor_spec_equals (MetaMonitorSpec *monitor_id,
1421diff --git a/debian/patches/native-gpu-Handle-drmModeSetCrtc-failing-gracefully.patch b/debian/patches/native-gpu-Handle-drmModeSetCrtc-failing-gracefully.patch
1422deleted file mode 100644
1423index 650a2d8..0000000
1424--- a/debian/patches/native-gpu-Handle-drmModeSetCrtc-failing-gracefully.patch
1425+++ /dev/null
1426@@ -1,36 +0,0 @@
1427-From: =?utf-8?q?Jonas_=C3=85dahl?= <jadahl@gmail.com>
1428-Date: Tue, 24 Apr 2018 09:26:33 +0000
1429-Subject: native/gpu: Handle drmModeSetCrtc() failing gracefully
1430-
1431-If drmModeSetCrtc() is called with no fb, mode or connectors for some
1432-CRTC it may still fail, and we should handle that gracefully instead of
1433-assuming it failed to set a non-disabled state.
1434-
1435-Closes https://gitlab.gnome.org/GNOME/mutter/issues/70
1436-
1437-
1438-(cherry picked from commit 6e953e2725d5d5b10d14c7bd479bd99f6853addc)
1439-
1440-Bug-GNOME: https://gitlab.gnome.org/GNOME/mutter/issues/70
1441-Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/mutter/+bug/1754949
1442-Applied-Upstream: https://gitlab.gnome.org/GNOME/mutter/commit/44682a2cc555
1443----
1444- src/backends/native/meta-gpu-kms.c | 5 ++++-
1445- 1 file changed, 4 insertions(+), 1 deletion(-)
1446-
1447-diff --git a/src/backends/native/meta-gpu-kms.c b/src/backends/native/meta-gpu-kms.c
1448-index 259cd71..1d1c288 100644
1449---- a/src/backends/native/meta-gpu-kms.c
1450-+++ b/src/backends/native/meta-gpu-kms.c
1451-@@ -143,7 +143,10 @@ meta_gpu_kms_apply_crtc_mode (MetaGpuKms *gpu_kms,
1452- connectors, n_connectors,
1453- mode) != 0)
1454- {
1455-- g_warning ("Failed to set CRTC mode %s: %m", crtc->current_mode->name);
1456-+ if (mode)
1457-+ g_warning ("Failed to set CRTC mode %s: %m", crtc->current_mode->name);
1458-+ else
1459-+ g_warning ("Failed to disable CRTC");
1460- g_free (connectors);
1461- return FALSE;
1462- }
1463diff --git a/debian/patches/renderer-native-Fallback-to-non-planar-API-if-gbm_bo_get_.patch b/debian/patches/renderer-native-Fallback-to-non-planar-API-if-gbm_bo_get_.patch
1464deleted file mode 100644
1465index a25fca3..0000000
1466--- a/debian/patches/renderer-native-Fallback-to-non-planar-API-if-gbm_bo_get_.patch
1467+++ /dev/null
1468@@ -1,63 +0,0 @@
1469-From: =?utf-8?q?Alex_Villac=C3=ADs_Lasso?= <a_villacis@palosanto.com>
1470-Date: Fri, 27 Jul 2018 16:08:52 +0000
1471-Subject: renderer/native: Fallback to non-planar API if
1472- gbm_bo_get_handle_for_plane fails
1473-
1474-Commit c0d9b08ef9bf2be865aad9bf1bc74ba24c655d9f replaced the old GBM API calls
1475-with the multi-plane GBM API. However, the call to gbm_bo_get_handle_for_plane
1476-fails for some DRI drivers (in particular i915). Due to missing error checks,
1477-the subsequent call to drmModeAddFB[2] fails and the screen output locks up.
1478-
1479-This commit adds the missing error checks and falls back to the old GBM API
1480-(non-planar) if necessary.
1481-
1482-v5: test success of gbm_bo_get_handle_for_plane instead of errno
1483-
1484-This commit adopts solution proposed by Daniel van Vugt to check the return
1485-value of gbm_bo_get_handle_for_plane on plane 0 and fall back to old
1486-non-planar method if the call fails. This removes the errno check (for
1487-ENOSYS) that could abort if mesa ever sets a different value.
1488-
1489-Related to: https://gitlab.gnome.org/GNOME/mutter/issues/127
1490-
1491-(cherry picked from commit f7af32a3eaefabbea3ebbda3a93eff98dd105ab9)
1492-
1493-Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/mutter/+bug/1727356
1494-Applied-Upstream: yes, 3.28.4
1495----
1496- src/backends/native/meta-renderer-native.c | 21 ++++++++++++++++-----
1497- 1 file changed, 16 insertions(+), 5 deletions(-)
1498-
1499-diff --git a/src/backends/native/meta-renderer-native.c b/src/backends/native/meta-renderer-native.c
1500-index fc6b223..59003b3 100644
1501---- a/src/backends/native/meta-renderer-native.c
1502-+++ b/src/backends/native/meta-renderer-native.c
1503-@@ -1607,12 +1607,23 @@ gbm_get_next_fb_id (MetaGpuKms *gpu_kms,
1504- return FALSE;
1505- }
1506-
1507-- for (i = 0; i < gbm_bo_get_plane_count (next_bo); i++)
1508-+ if (gbm_bo_get_handle_for_plane (next_bo, 0).s32 == -1)
1509- {
1510-- strides[i] = gbm_bo_get_stride_for_plane (next_bo, i);
1511-- handles[i] = gbm_bo_get_handle_for_plane (next_bo, i).u32;
1512-- offsets[i] = gbm_bo_get_offset (next_bo, i);
1513-- modifiers[i] = gbm_bo_get_modifier (next_bo);
1514-+ /* Failed to fetch handle to plane, falling back to old method */
1515-+ strides[0] = gbm_bo_get_stride (next_bo);
1516-+ handles[0] = gbm_bo_get_handle (next_bo).u32;
1517-+ offsets[0] = 0;
1518-+ modifiers[0] = DRM_FORMAT_MOD_INVALID;
1519-+ }
1520-+ else
1521-+ {
1522-+ for (i = 0; i < gbm_bo_get_plane_count (next_bo); i++)
1523-+ {
1524-+ strides[i] = gbm_bo_get_stride_for_plane (next_bo, i);
1525-+ handles[i] = gbm_bo_get_handle_for_plane (next_bo, i).u32;
1526-+ offsets[i] = gbm_bo_get_offset (next_bo, i);
1527-+ modifiers[i] = gbm_bo_get_modifier (next_bo);
1528-+ }
1529- }
1530-
1531- kms_fd = meta_gpu_kms_get_fd (gpu_kms);
1532diff --git a/debian/patches/series b/debian/patches/series
1533index 5bd9ae6..198db5a 100644
1534--- a/debian/patches/series
1535+++ b/debian/patches/series
1536@@ -1,18 +1,8 @@
1537-gpu-kms-Don-t-crash-if-drmModeGetResources-returns-N.patch
1538-native-gpu-Handle-drmModeSetCrtc-failing-gracefully.patch
1539-monitor-manager-Filter-out-low-screen-resolutions.patch
1540-window-wayland-Always-update-monitor-for-non-user-ops.patch
1541-window-Don-t-refuse-to-move-focus-to-the-grab-window.patch
1542-window-Explicitly-exclude-unmanaging-window-from-focus-ag.patch
1543-monitor-Use-current-monitor-mode-to-check-whether-active.patch
1544 theme-use-gtk_render_icon_suface-to-paint-button-icon.patch
1545 theme-load-icons-as-Gtk-does-with-fallback-and-RTL-suppor.patch
1546 clutter-Smooth-out-master-clock-to-smooth-visuals.patch
1547-core-Return-1-if-meta_window_get_monitor-is-called-on-an-.patch
1548+clutter-Fix-offscreen-effect-painting-of-clones.patch
1549 bgo768531_workaround-startup-notifications.patch
1550-renderer-native-Fallback-to-non-planar-API-if-gbm_bo_get_.patch
1551-clutter-x11-Implement-keycode-lookup-from-keysyms-on-virt.patch
1552-clutter-Do-not-latch-modifiers-on-modifier-keys.patch
1553 debian/synaptics-support.patch
1554 debian/skip-failing-tests.patch
1555 debian/skip-failing-tests-325.patch
1556diff --git a/debian/patches/window-Don-t-refuse-to-move-focus-to-the-grab-window.patch b/debian/patches/window-Don-t-refuse-to-move-focus-to-the-grab-window.patch
1557deleted file mode 100644
1558index ec37087..0000000
1559--- a/debian/patches/window-Don-t-refuse-to-move-focus-to-the-grab-window.patch
1560+++ /dev/null
1561@@ -1,39 +0,0 @@
1562-From: =?utf-8?q?Florian_M=C3=BCllner?= <fmuellner@gnome.org>
1563-Date: Fri, 25 May 2018 18:18:23 +0000
1564-Subject: window: Don't refuse to move focus to the grab window
1565-
1566-We refuse to move focus while a grab operation is in place. While this
1567-generally makes sense, there's no reason why the window that owns the
1568-grab shouldn't be given the regular input focus as well - we pretty
1569-much assume that the grab window is also the focus window anyway.
1570-
1571-In fact there's a strong reason for allowing the focus change here:
1572-If the grab window isn't the focus window, it probably has a modal
1573-transient that is focused instead, and a likely reason for the focus
1574-request is that the transient is being unmanaged and we must move
1575-the focus elsewhere.
1576-
1577-https://gitlab.gnome.org/GNOME/mutter/issues/15
1578-
1579-
1580-(cherry picked from commit 148da24f9510ebd23d750b8224aa0ab3a549e69e)
1581-
1582-Bug-GNOME: https://gitlab.gnome.org/GNOME/mutter/issues/15
1583-Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/gnome-shell/+bug/1422253
1584-Applied-Upstream: 3.28.4, commit:https://gitlab.gnome.org/GNOME/mutter/commit/513cc535
1585----
1586- src/core/window.c | 1 +
1587- 1 file changed, 1 insertion(+)
1588-
1589-diff --git a/src/core/window.c b/src/core/window.c
1590-index 743326c..5b1eb5b 100644
1591---- a/src/core/window.c
1592-+++ b/src/core/window.c
1593-@@ -4620,6 +4620,7 @@ meta_window_focus (MetaWindow *window,
1594- window->desc, window->input, window->take_focus);
1595-
1596- if (window->display->grab_window &&
1597-+ window->display->grab_window != window &&
1598- window->display->grab_window->all_keys_grabbed &&
1599- !window->display->grab_window->unmanaging)
1600- {
1601diff --git a/debian/patches/window-Explicitly-exclude-unmanaging-window-from-focus-ag.patch b/debian/patches/window-Explicitly-exclude-unmanaging-window-from-focus-ag.patch
1602deleted file mode 100644
1603index fa98757..0000000
1604--- a/debian/patches/window-Explicitly-exclude-unmanaging-window-from-focus-ag.patch
1605+++ /dev/null
1606@@ -1,35 +0,0 @@
1607-From: =?utf-8?q?Florian_M=C3=BCllner?= <fmuellner@gnome.org>
1608-Date: Fri, 25 May 2018 21:24:17 +0200
1609-Subject: window: Explicitly exclude unmanaging window from focus again
1610-
1611-Since commit b3b9d9e16 we no longer have to pass the unmanaging window
1612-to make sure we don't try to focus it again, however the parameter also
1613-influences the focus policy by giving ancestors preference over the normal
1614-stack order.
1615-
1616-https://gitlab.gnome.org/GNOME/mutter/issues/15
1617-
1618-(cherry picked from commit d99442d6e6b7c9b383863cc754db609398d4e65b)
1619-
1620-Bug-GNOME: https://gitlab.gnome.org/GNOME/mutter/issues/15
1621-Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/gnome-shell/+bug/1422253
1622-Applied-Upstream: 3.28.4, commit:https://gitlab.gnome.org/GNOME/mutter/commit/137f2223
1623----
1624- src/core/window.c | 4 +++-
1625- 1 file changed, 3 insertions(+), 1 deletion(-)
1626-
1627-diff --git a/src/core/window.c b/src/core/window.c
1628-index 5b1eb5b..cc0813a 100644
1629---- a/src/core/window.c
1630-+++ b/src/core/window.c
1631-@@ -1469,7 +1469,9 @@ meta_window_unmanage (MetaWindow *window,
1632- meta_topic (META_DEBUG_FOCUS,
1633- "Focusing default window since we're unmanaging %s\n",
1634- window->desc);
1635-- meta_workspace_focus_default_window (window->screen->active_workspace, NULL, timestamp);
1636-+ meta_workspace_focus_default_window (window->screen->active_workspace,
1637-+ window,
1638-+ timestamp);
1639- }
1640- else
1641- {
1642diff --git a/debian/patches/window-wayland-Always-update-monitor-for-non-user-ops.patch b/debian/patches/window-wayland-Always-update-monitor-for-non-user-ops.patch
1643deleted file mode 100644
1644index ce279ed..0000000
1645--- a/debian/patches/window-wayland-Always-update-monitor-for-non-user-ops.patch
1646+++ /dev/null
1647@@ -1,44 +0,0 @@
1648-From: Olivier Fourdan <ofourdan@redhat.com>
1649-Date: Mon, 18 Jun 2018 12:39:11 +0200
1650-Subject: window/wayland: Always update monitor for non-user ops
1651-
1652-meta_window_wayland_update_main_monitor() would skip the monitor update
1653-if the difference in scale between the old and the new monitor would
1654-cause another monitor change.
1655-
1656-While this is suitable when the monitor change results from a user
1657-interactively moving the surface between monitors of different scales,
1658-this can leave dangling pointers to freed monitors when this is
1659-triggered by a change of monitor configuration.
1660-
1661-Make sure we update the monitor unconditionally if not from a user
1662-operation.
1663-
1664-Closes: https://gitlab.gnome.org/GNOME/mutter/issues/189
1665-
1666-(cherry picked from commit a3da4b8d5bd217c0262fd9361036877d155a300f)
1667-
1668-Bug-GNOME: https://gitlab.gnome.org/GNOME/mutter/issues/189
1669-Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/gnome-shell/+bug/1784398
1670-Applied-Upstream: 3.28.4, commit:https://gitlab.gnome.org/GNOME/mutter/commit/d74a04606
1671----
1672- src/wayland/meta-window-wayland.c | 6 ++++++
1673- 1 file changed, 6 insertions(+)
1674-
1675-diff --git a/src/wayland/meta-window-wayland.c b/src/wayland/meta-window-wayland.c
1676-index 705bc49..8bafb25 100644
1677---- a/src/wayland/meta-window-wayland.c
1678-+++ b/src/wayland/meta-window-wayland.c
1679-@@ -413,6 +413,12 @@ meta_window_wayland_update_main_monitor (MetaWindow *window,
1680- return;
1681- }
1682-
1683-+ if (!user_op)
1684-+ {
1685-+ window->monitor = to;
1686-+ return;
1687-+ }
1688-+
1689- from_scale = meta_logical_monitor_get_scale (from);
1690- to_scale = meta_logical_monitor_get_scale (to);
1691-

Subscribers

People subscribed via source and target branches