diff -Nru mutter-3.36.1/clutter/clutter/clutter-actor.c mutter-3.36.2/clutter/clutter/clutter-actor.c --- mutter-3.36.1/clutter/clutter/clutter-actor.c 2020-03-30 19:29:39.051890900 +0000 +++ mutter-3.36.2/clutter/clutter/clutter-actor.c 2020-04-29 20:22:32.270455400 +0000 @@ -2410,6 +2410,7 @@ g_return_val_if_fail (CLUTTER_IS_ACTOR (self), FALSE); if (CLUTTER_ACTOR_IS_MAPPED (self) && + clutter_actor_has_allocation (self) && (_clutter_context_get_pick_mode () == CLUTTER_PICK_ALL || CLUTTER_ACTOR_IS_REACTIVE (self))) return TRUE; @@ -4193,7 +4194,9 @@ clutter_paint_node_unref (dummy); /* XXX:2.0 - Call the paint() virtual directly */ - if (g_signal_has_handler_pending (self, actor_signals[PAINT], + if (!(clutter_paint_context_get_paint_flags (paint_context) & + CLUTTER_PAINT_FLAG_NO_PAINT_SIGNAL) && + g_signal_has_handler_pending (self, actor_signals[PAINT], 0, TRUE)) g_signal_emit (self, actor_signals[PAINT], 0, paint_context); else diff -Nru mutter-3.36.1/clutter/clutter/clutter-click-action.c mutter-3.36.2/clutter/clutter/clutter-click-action.c --- mutter-3.36.1/clutter/clutter/clutter-click-action.c 2020-03-30 19:29:39.066890500 +0000 +++ mutter-3.36.2/clutter/clutter/clutter-click-action.c 2020-04-29 20:22:32.276455200 +0000 @@ -346,6 +346,12 @@ ClutterModifierType modifier_state; gboolean has_button = TRUE; + if (!clutter_actor_meta_get_enabled (CLUTTER_ACTOR_META (action))) + { + clutter_click_action_release (action); + return CLUTTER_EVENT_PROPAGATE; + } + actor = clutter_actor_meta_get_actor (CLUTTER_ACTOR_META (action)); switch (clutter_event_type (event)) diff -Nru mutter-3.36.1/clutter/clutter/clutter-master-clock-default.c mutter-3.36.2/clutter/clutter/clutter-master-clock-default.c --- mutter-3.36.1/clutter/clutter/clutter-master-clock-default.c 2020-03-30 19:29:39.084890100 +0000 +++ mutter-3.36.2/clutter/clutter/clutter-master-clock-default.c 2020-04-29 20:22:32.289454700 +0000 @@ -190,6 +190,26 @@ } } +static int64_t +master_clock_get_next_presentation_time (ClutterMasterClockDefault *master_clock) +{ + ClutterStageManager *stage_manager = clutter_stage_manager_get_default (); + const GSList *stages, *l; + int64_t earliest = -1; + + stages = clutter_stage_manager_peek_stages (stage_manager); + + for (l = stages; l != NULL; l = l->next) + { + gint64 t = _clutter_stage_get_next_presentation_time (l->data); + + if (earliest == -1 || (t != -1 && t < earliest)) + earliest = t; + } + + return earliest; +} + static void master_clock_schedule_stage_updates (ClutterMasterClockDefault *master_clock) { @@ -466,7 +486,11 @@ COGL_TRACE_BEGIN (ClutterMasterClockTick, "Master Clock (tick)"); /* Get the time to use for this frame */ - master_clock->cur_tick = g_source_get_time (source); + master_clock->cur_tick = master_clock_get_next_presentation_time (master_clock); + + /* On the first frame the backend might not have an answer */ + if (master_clock->cur_tick <= 0) + master_clock->cur_tick = g_source_get_time (source); #ifdef CLUTTER_ENABLE_DEBUG master_clock->remaining_budget = master_clock->frame_budget; diff -Nru mutter-3.36.1/clutter/clutter/clutter-mutter.h mutter-3.36.2/clutter/clutter/clutter-mutter.h --- mutter-3.36.1/clutter/clutter/clutter-mutter.h 2020-03-30 19:29:39.084890100 +0000 +++ mutter-3.36.2/clutter/clutter/clutter-mutter.h 2020-04-29 20:22:32.289454700 +0000 @@ -30,6 +30,7 @@ #include "clutter-input-device-private.h" #include "clutter-input-pointer-a11y-private.h" #include "clutter-macros.h" +#include "clutter-paint-context-private.h" #include "clutter-private.h" #include "clutter-stage-private.h" #include "clutter-stage-view.h" @@ -49,6 +50,23 @@ uint8_t *data); CLUTTER_EXPORT +void clutter_stage_paint_to_framebuffer (ClutterStage *stage, + CoglFramebuffer *framebuffer, + const cairo_rectangle_int_t *rect, + float scale, + ClutterPaintFlag paint_flags); + +CLUTTER_EXPORT +gboolean clutter_stage_paint_to_buffer (ClutterStage *stage, + const cairo_rectangle_int_t *rect, + float scale, + uint8_t *data, + int stride, + CoglPixelFormat format, + ClutterPaintFlag paint_flags, + GError **error); + +CLUTTER_EXPORT void clutter_stage_freeze_updates (ClutterStage *stage); CLUTTER_EXPORT diff -Nru mutter-3.36.1/clutter/clutter/clutter-paint-context.c mutter-3.36.2/clutter/clutter/clutter-paint-context.c --- mutter-3.36.1/clutter/clutter/clutter-paint-context.c 2020-03-30 19:29:39.085890000 +0000 +++ mutter-3.36.2/clutter/clutter/clutter-paint-context.c 2020-04-29 20:22:32.290454600 +0000 @@ -23,6 +23,8 @@ { grefcount ref_count; + ClutterPaintFlag paint_flags; + GList *framebuffers; ClutterStageView *view; @@ -36,7 +38,8 @@ ClutterPaintContext * clutter_paint_context_new_for_view (ClutterStageView *view, - const cairo_region_t *redraw_clip) + const cairo_region_t *redraw_clip, + ClutterPaintFlag paint_flags) { ClutterPaintContext *paint_context; CoglFramebuffer *framebuffer; @@ -45,6 +48,7 @@ g_ref_count_init (&paint_context->ref_count); paint_context->view = view; paint_context->redraw_clip = cairo_region_copy (redraw_clip); + paint_context->paint_flags = paint_flags; framebuffer = clutter_stage_view_get_framebuffer (view); clutter_paint_context_push_framebuffer (paint_context, framebuffer); @@ -62,6 +66,8 @@ paint_context = g_new0 (ClutterPaintContext, 1); g_ref_count_init (&paint_context->ref_count); + paint_context->paint_flags = (CLUTTER_PAINT_FLAG_NO_CURSORS | + CLUTTER_PAINT_FLAG_NO_PAINT_SIGNAL); clutter_paint_context_push_framebuffer (paint_context, framebuffer); @@ -170,3 +176,12 @@ return !paint_context->view; } + +/** + * clutter_paint_context_get_paint_flags: (skip) + */ +ClutterPaintFlag +clutter_paint_context_get_paint_flags (ClutterPaintContext *paint_context) +{ + return paint_context->paint_flags; +} diff -Nru mutter-3.36.1/clutter/clutter/clutter-paint-context-private.h mutter-3.36.2/clutter/clutter/clutter-paint-context-private.h --- mutter-3.36.1/clutter/clutter/clutter-paint-context-private.h 2020-03-30 19:29:39.085890000 +0000 +++ mutter-3.36.2/clutter/clutter/clutter-paint-context-private.h 2020-04-29 20:22:32.290454600 +0000 @@ -20,11 +20,22 @@ #include "clutter-paint-context.h" +typedef enum _ClutterPaintFlag +{ + CLUTTER_PAINT_FLAG_NONE = 0, + CLUTTER_PAINT_FLAG_NO_CURSORS = 1 << 0, + CLUTTER_PAINT_FLAG_NO_PAINT_SIGNAL = 1 << 0, +} ClutterPaintFlag; + ClutterPaintContext * clutter_paint_context_new_for_view (ClutterStageView *view, - const cairo_region_t *redraw_clip); + const cairo_region_t *redraw_clip, + ClutterPaintFlag paint_flags); gboolean clutter_paint_context_is_drawing_off_stage (ClutterPaintContext *paint_context); CoglFramebuffer * clutter_paint_context_get_base_framebuffer (ClutterPaintContext *paint_context); +CLUTTER_EXPORT +ClutterPaintFlag clutter_paint_context_get_paint_flags (ClutterPaintContext *paint_context); + #endif /* CLUTTER_PAINT_CONTEXT_PRIVATE_H */ diff -Nru mutter-3.36.1/clutter/clutter/clutter-stage.c mutter-3.36.2/clutter/clutter/clutter-stage.c --- mutter-3.36.1/clutter/clutter/clutter-stage.c 2020-03-30 19:29:39.093890000 +0000 +++ mutter-3.36.2/clutter/clutter/clutter-stage.c 2020-04-29 20:22:32.299454500 +0000 @@ -934,7 +934,8 @@ ClutterPaintContext *paint_context; cairo_rectangle_int_t clip_rect; - paint_context = clutter_paint_context_new_for_view (view, redraw_clip); + paint_context = clutter_paint_context_new_for_view (view, redraw_clip, + CLUTTER_PAINT_FLAG_NONE); cairo_region_get_extents (redraw_clip, &clip_rect); setup_view_for_pick_or_paint (stage, view, &clip_rect); @@ -1320,15 +1321,9 @@ { ClutterStagePrivate *priv = stage->priv; - if (g_hash_table_contains (priv->pending_relayouts, stage)) - return; - if (g_hash_table_size (priv->pending_relayouts) == 0) _clutter_stage_schedule_update (stage); - if (actor == (ClutterActor *) stage) - g_hash_table_remove_all (priv->pending_relayouts); - g_hash_table_add (priv->pending_relayouts, g_object_ref (actor)); priv->pending_relayouts_version++; } @@ -3751,6 +3746,21 @@ _clutter_stage_window_clear_update_time (stage_window); } +int64_t +_clutter_stage_get_next_presentation_time (ClutterStage *stage) +{ + ClutterStageWindow *stage_window; + + if (CLUTTER_ACTOR_IN_DESTRUCTION (stage)) + return 0; + + stage_window = _clutter_stage_get_window (stage); + if (stage_window == NULL) + return 0; + + return _clutter_stage_window_get_next_presentation_time (stage_window); +} + ClutterPaintVolume * _clutter_stage_paint_volume_stack_allocate (ClutterStage *stage) { @@ -4463,58 +4473,119 @@ return TRUE; } -static void -capture_view_into (ClutterStage *stage, - gboolean paint, - ClutterStageView *view, - cairo_rectangle_int_t *rect, - uint8_t *data, - int stride) +/** + * clutter_stage_paint_to_framebuffer: (skip) + */ +void +clutter_stage_paint_to_framebuffer (ClutterStage *stage, + CoglFramebuffer *framebuffer, + const cairo_rectangle_int_t *rect, + float scale, + ClutterPaintFlag paint_flags) { + ClutterStagePrivate *priv = stage->priv; + ClutterPaintContext *paint_context; + cairo_region_t *redraw_clip; + + redraw_clip = cairo_region_create_rectangle (rect); + paint_context = clutter_paint_context_new_for_framebuffer (framebuffer); + cairo_region_destroy (redraw_clip); + + cogl_framebuffer_push_matrix (framebuffer); + cogl_framebuffer_set_projection_matrix (framebuffer, &priv->projection); + cogl_framebuffer_set_viewport (framebuffer, + -(rect->x * scale), + -(rect->y * scale), + priv->viewport[2] * scale, + priv->viewport[3] * scale); + clutter_actor_paint (CLUTTER_ACTOR (stage), paint_context); + cogl_framebuffer_pop_matrix (framebuffer); + + clutter_paint_context_destroy (paint_context); +} + +/** + * clutter_stage_paint_to_buffer: (skip) + */ +gboolean +clutter_stage_paint_to_buffer (ClutterStage *stage, + const cairo_rectangle_int_t *rect, + float scale, + uint8_t *data, + int stride, + CoglPixelFormat format, + ClutterPaintFlag paint_flags, + GError **error) +{ + ClutterBackend *clutter_backend = clutter_get_default_backend (); + CoglContext *cogl_context = + clutter_backend_get_cogl_context (clutter_backend); + int texture_width, texture_height; + CoglTexture2D *texture; + CoglOffscreen *offscreen; CoglFramebuffer *framebuffer; - ClutterBackend *backend; - CoglContext *context; CoglBitmap *bitmap; - cairo_rectangle_int_t view_layout; - float view_scale; - float texture_width; - float texture_height; - g_return_if_fail (CLUTTER_IS_STAGE (stage)); + texture_width = (int) ceilf (rect->width * scale); + texture_height = (int) ceilf (rect->height * scale); + texture = cogl_texture_2d_new_with_size (cogl_context, + texture_width, + texture_height); + if (!texture) + { + g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, + "Failed to create %dx%d texture", + texture_width, texture_height); + return FALSE; + } - framebuffer = clutter_stage_view_get_framebuffer (view); + offscreen = cogl_offscreen_new_with_texture (COGL_TEXTURE (texture)); + framebuffer = COGL_FRAMEBUFFER (offscreen); - if (paint) - { - cairo_region_t *region; + cogl_object_unref (texture); - _clutter_stage_maybe_setup_viewport (stage, view); - region = cairo_region_create_rectangle (rect); - clutter_stage_do_paint_view (stage, view, region); - cairo_region_destroy (region); - } + if (!cogl_framebuffer_allocate (framebuffer, error)) + return FALSE; - view_scale = clutter_stage_view_get_scale (view); - texture_width = roundf (rect->width * view_scale); - texture_height = roundf (rect->height * view_scale); + clutter_stage_paint_to_framebuffer (stage, framebuffer, + rect, scale, paint_flags); - backend = clutter_get_default_backend (); - context = clutter_backend_get_cogl_context (backend); - bitmap = cogl_bitmap_new_for_data (context, + bitmap = cogl_bitmap_new_for_data (cogl_context, texture_width, texture_height, - CLUTTER_CAIRO_FORMAT_ARGB32, + format, stride, data); - clutter_stage_view_get_layout (view, &view_layout); - cogl_framebuffer_read_pixels_into_bitmap (framebuffer, - roundf ((rect->x - view_layout.x) * view_scale), - roundf ((rect->y - view_layout.y) * view_scale), + 0, 0, COGL_READ_PIXELS_COLOR_BUFFER, bitmap); cogl_object_unref (bitmap); + cogl_object_unref (framebuffer); + + return TRUE; +} + +static void +capture_view_into (ClutterStage *stage, + gboolean paint, + ClutterStageView *view, + cairo_rectangle_int_t *rect, + uint8_t *data, + int stride) +{ + g_autoptr (GError) error = NULL; + float view_scale; + + g_return_if_fail (CLUTTER_IS_STAGE (stage)); + + view_scale = clutter_stage_view_get_scale (view); + if (!clutter_stage_paint_to_buffer (stage, rect, view_scale, data, stride, + CLUTTER_CAIRO_FORMAT_ARGB32, + CLUTTER_PAINT_FLAG_NO_CURSORS, + &error)) + g_warning ("Failed to capture stage: %s", error->message); } void diff -Nru mutter-3.36.1/clutter/clutter/clutter-stage-private.h mutter-3.36.2/clutter/clutter/clutter-stage-private.h --- mutter-3.36.1/clutter/clutter/clutter-stage-private.h 2020-03-30 19:29:39.092889800 +0000 +++ mutter-3.36.2/clutter/clutter/clutter-stage-private.h 2020-04-29 20:22:32.297454600 +0000 @@ -78,6 +78,7 @@ gint64 _clutter_stage_get_update_time (ClutterStage *stage); void _clutter_stage_clear_update_time (ClutterStage *stage); gboolean _clutter_stage_has_full_redraw_queued (ClutterStage *stage); +int64_t _clutter_stage_get_next_presentation_time (ClutterStage *stage); void clutter_stage_log_pick (ClutterStage *stage, const graphene_point_t *vertices, diff -Nru mutter-3.36.1/clutter/clutter/clutter-stage-window.c mutter-3.36.2/clutter/clutter/clutter-stage-window.c --- mutter-3.36.1/clutter/clutter/clutter-stage-window.c 2020-03-30 19:29:39.092889800 +0000 +++ mutter-3.36.2/clutter/clutter/clutter-stage-window.c 2020-04-29 20:22:32.298454500 +0000 @@ -178,6 +178,22 @@ iface->clear_update_time (window); } +int64_t +_clutter_stage_window_get_next_presentation_time (ClutterStageWindow *window) +{ + ClutterStageWindowInterface *iface; + + g_return_val_if_fail (CLUTTER_IS_STAGE_WINDOW (window), 0); + + iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window); + + /* If not implemented then just revert to the old behaviour... */ + if (iface->get_next_presentation_time == NULL) + return _clutter_stage_window_get_update_time (window); + + return iface->get_next_presentation_time (window); +} + void _clutter_stage_window_set_accept_focus (ClutterStageWindow *window, gboolean accept_focus) diff -Nru mutter-3.36.1/clutter/clutter/clutter-stage-window.h mutter-3.36.2/clutter/clutter/clutter-stage-window.h --- mutter-3.36.1/clutter/clutter/clutter-stage-window.h 2020-03-30 19:29:39.093890000 +0000 +++ mutter-3.36.2/clutter/clutter/clutter-stage-window.h 2020-04-29 20:22:32.298454500 +0000 @@ -61,6 +61,8 @@ GList *(* get_views) (ClutterStageWindow *stage_window); int64_t (* get_frame_counter) (ClutterStageWindow *stage_window); void (* finish_frame) (ClutterStageWindow *stage_window); + + int64_t (* get_next_presentation_time) (ClutterStageWindow *stage_window); }; ClutterActor * _clutter_stage_window_get_wrapper (ClutterStageWindow *window); @@ -101,6 +103,8 @@ int64_t _clutter_stage_window_get_frame_counter (ClutterStageWindow *window); +int64_t _clutter_stage_window_get_next_presentation_time (ClutterStageWindow *window); + G_END_DECLS #endif /* __CLUTTER_STAGE_WINDOW_H__ */ diff -Nru mutter-3.36.1/clutter/clutter/cogl/clutter-stage-cogl.c mutter-3.36.2/clutter/clutter/cogl/clutter-stage-cogl.c --- mutter-3.36.1/clutter/clutter/cogl/clutter-stage-cogl.c 2020-03-30 19:29:39.098889800 +0000 +++ mutter-3.36.2/clutter/clutter/cogl/clutter-stage-cogl.c 2020-04-29 20:22:32.302454500 +0000 @@ -235,7 +235,12 @@ stage_cogl->update_time = next_presentation_time - max_render_time_allowed; if (stage_cogl->update_time == stage_cogl->last_update_time) - stage_cogl->update_time = stage_cogl->last_update_time + refresh_interval; + { + stage_cogl->update_time += refresh_interval; + next_presentation_time += refresh_interval; + } + + stage_cogl->next_presentation_time = next_presentation_time; } static gint64 @@ -256,6 +261,29 @@ stage_cogl->last_update_time = stage_cogl->update_time; stage_cogl->update_time = -1; + stage_cogl->next_presentation_time = -1; +} + +static int64_t +clutter_stage_cogl_get_next_presentation_time (ClutterStageWindow *stage_window) +{ + ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_window); + int64_t now = g_get_monotonic_time (); + + if (stage_cogl->next_presentation_time > 0 && + stage_cogl->next_presentation_time <= now) + { + CLUTTER_NOTE (BACKEND, + "Missed some frames. Something blocked for over " + "%" G_GINT64_FORMAT "ms.", + (now - stage_cogl->next_presentation_time) / 1000); + + stage_cogl->update_time = -1; + clutter_stage_cogl_schedule_update (stage_window, + stage_cogl->last_sync_delay); + } + + return stage_cogl->next_presentation_time; } static ClutterActor * @@ -375,15 +403,11 @@ swap_framebuffer (ClutterStageWindow *stage_window, ClutterStageView *view, cairo_region_t *swap_region, - gboolean swap_with_damage, - cairo_region_t *queued_redraw_clip) + gboolean swap_with_damage) { CoglFramebuffer *framebuffer = clutter_stage_view_get_onscreen (view); int *damage, n_rects, i; - if (G_UNLIKELY ((clutter_paint_debug_flags & CLUTTER_DEBUG_PAINT_DAMAGE_REGION))) - paint_damage_region (stage_window, view, swap_region, queued_redraw_clip); - n_rects = cairo_region_num_rectangles (swap_region); damage = g_newa (int, n_rects * 4); for (i = 0; i < n_rects; i++) @@ -620,7 +644,7 @@ gboolean swap_with_damage; ClutterActor *wrapper; cairo_region_t *redraw_clip; - cairo_region_t *queued_redraw_clip; + cairo_region_t *queued_redraw_clip = NULL; cairo_region_t *fb_clip_region; cairo_region_t *swap_region; cairo_rectangle_int_t redraw_rect; @@ -644,6 +668,8 @@ has_buffer_age = cogl_is_onscreen (fb) && is_buffer_age_enabled (); redraw_clip = clutter_stage_view_take_redraw_clip (view); + if (G_UNLIKELY (clutter_paint_debug_flags & CLUTTER_DEBUG_PAINT_DAMAGE_REGION)) + queued_redraw_clip = cairo_region_copy (redraw_clip); /* NB: a NULL redraw clip == full stage redraw */ if (!redraw_clip) @@ -711,8 +737,6 @@ redraw_clip = cairo_region_create_rectangle (&view_rect); } - queued_redraw_clip = cairo_region_copy (redraw_clip); - if (may_use_clipped_redraw && G_LIKELY (!(clutter_paint_debug_flags & CLUTTER_DEBUG_DISABLE_CLIPPED_REDRAWS))) use_clipped_redraw = TRUE; @@ -922,7 +946,6 @@ } g_clear_pointer (&redraw_clip, cairo_region_destroy); - g_clear_pointer (&queued_redraw_clip, cairo_region_destroy); g_clear_pointer (&fb_clip_region, cairo_region_destroy); if (do_swap_buffer) @@ -943,11 +966,17 @@ swap_region = transformed_swap_region; } + if (queued_redraw_clip) + { + paint_damage_region (stage_window, view, + swap_region, queued_redraw_clip); + cairo_region_destroy (queued_redraw_clip); + } + res = swap_framebuffer (stage_window, view, swap_region, - swap_with_damage, - queued_redraw_clip); + swap_with_damage); cairo_region_destroy (swap_region); @@ -955,6 +984,7 @@ } else { + g_clear_pointer (&queued_redraw_clip, cairo_region_destroy); return FALSE; } } @@ -1008,6 +1038,7 @@ iface->schedule_update = clutter_stage_cogl_schedule_update; iface->get_update_time = clutter_stage_cogl_get_update_time; iface->clear_update_time = clutter_stage_cogl_clear_update_time; + iface->get_next_presentation_time = clutter_stage_cogl_get_next_presentation_time; iface->redraw = clutter_stage_cogl_redraw; } @@ -1053,6 +1084,7 @@ stage->refresh_rate = 0.0; stage->update_time = -1; + stage->next_presentation_time = -1; } static void diff -Nru mutter-3.36.1/clutter/clutter/cogl/clutter-stage-cogl.h mutter-3.36.2/clutter/clutter/cogl/clutter-stage-cogl.h --- mutter-3.36.1/clutter/clutter/cogl/clutter-stage-cogl.h 2020-03-30 19:29:39.098889800 +0000 +++ mutter-3.36.2/clutter/clutter/cogl/clutter-stage-cogl.h 2020-04-29 20:22:32.302454500 +0000 @@ -48,6 +48,7 @@ gint64 last_presentation_time; gint64 update_time; int64_t last_update_time; + int64_t next_presentation_time; /* We only enable clipped redraws after 2 frames, since we've seen * a lot of drivers can struggle to get going and may output some diff -Nru mutter-3.36.1/cogl/cogl/cogl-texture-2d.c mutter-3.36.2/cogl/cogl/cogl-texture-2d.c --- mutter-3.36.1/cogl/cogl/cogl-texture-2d.c 2020-03-30 19:29:39.136889000 +0000 +++ mutter-3.36.2/cogl/cogl/cogl-texture-2d.c 2020-04-29 20:22:32.336453400 +0000 @@ -121,6 +121,9 @@ { CoglTextureLoader *loader; + g_return_val_if_fail (width >= 1, NULL); + g_return_val_if_fail (height >= 1, NULL); + loader = _cogl_texture_create_loader (); loader->src_type = COGL_TEXTURE_SOURCE_TYPE_SIZED; loader->src.sized.width = width; diff -Nru mutter-3.36.1/cogl/cogl/driver/gl/cogl-framebuffer-gl.c mutter-3.36.2/cogl/cogl/driver/gl/cogl-framebuffer-gl.c --- mutter-3.36.1/cogl/cogl/driver/gl/cogl-framebuffer-gl.c 2020-03-30 19:29:39.142888800 +0000 +++ mutter-3.36.2/cogl/cogl/driver/gl/cogl-framebuffer-gl.c 2020-04-29 20:22:32.342453200 +0000 @@ -132,8 +132,8 @@ { float gl_viewport_y; - g_assert (framebuffer->viewport_width >=0 && - framebuffer->viewport_height >=0); + g_return_if_fail (framebuffer->viewport_width >= 0); + g_return_if_fail (framebuffer->viewport_height >= 0); /* Convert the Cogl viewport y offset to an OpenGL viewport y offset * NB: OpenGL defines its window and viewport origins to be bottom diff -Nru mutter-3.36.1/debian/changelog mutter-3.36.2/debian/changelog --- mutter-3.36.1/debian/changelog 2020-04-17 01:08:01.000000000 +0000 +++ mutter-3.36.2/debian/changelog 2020-05-07 01:22:16.000000000 +0000 @@ -1,3 +1,86 @@ +mutter (3.36.2-1ubuntu1~20.04.1) focal; urgency=medium + + * Backport to focal (LP: #1877209) + * debian/gbp.conf: Set branch to ubuntu/focal + * debian/control: Update VCS references to focal branch + * debian/rules: Revert groovy/debian build changes as per dh 13 + + -- Marco Trevisan (Treviño) Thu, 07 May 2020 03:22:16 +0200 + +mutter (3.36.2-1ubuntu1) groovy; urgency=medium + + * Merge with debian, including new upstream release: + - Fix super key not working with secondary layout (LP: #1871913) + * xrandr-scaling: Fix compiler warnings (LP: #1874207) + * xrandr-scaling: Take care of global UI scale when restoring from config + (LP: #1825593) + * Remaining changes with debian: + - debian/control: + + Update VCS flags to point to ubuntu salsa branch + - debian/gbp.conf: update branch to point to ubuntu/master + - debian/patches/x11-Add-support-for-fractional-scaling-using-Randr.patch: + + X11: Add support for fractional scaling using Randr + + -- Marco Trevisan (Treviño) Thu, 07 May 2020 02:43:19 +0200 + +mutter (3.36.2-1) unstable; urgency=medium + + * Team upload + + [ Simon McVittie ] + * New upstream stable release + - Fix FTBFS with Wayland disabled (non-Linux kernels) + - X11 copy/paste/selection fixes (LP: #1852183) + - Fix freeze with some DisplayLink devices + - Fix a memory leak + - Synchronize shadows to server-side decorations + - Fix overview key on X11 when using multiple keyboard layouts + - Fix painting the redraw clip with the damage region + - Fix capturing with multiple stage views + - Fix screencasting of non-maximized windows (LP: #1873942) + - Various misc fixes and cleanups (LP: #1874818) + - Update translation: de + + [ Marco Trevisan (Treviño) ] + * debian/libmutter-6-0.symbols: Update + * debian/rules: Ignore build failures on riscv64 + + -- Simon McVittie Fri, 01 May 2020 11:26:55 +0100 + +mutter (3.36.1+git20200419-1) unstable; urgency=medium + + * Team upload + + [ Simon McVittie ] + * New upstream snapshot from gnome-3-36 branch (3.36.1-42-gda9eb4718) + - Fix trackball button scrolling + - Fix tiled (MST) displays + - Copy/paste fixes, particularly for large images and incremental + transfers + - Fall back to closed laptop lid configuration if no other available + (LP: #1793496) + + [ Jeremy Bicha ] + * Drop obsolete dh_strip dbgsym migration rule + * Bump debhelper-compat to 13 + - dh_missing --fail-missing is the default + - dh_auto_test has several default improvements + - dh_autoreconf isn't needed with meson + * debian/watch: Only watch for stable releases + + -- Simon McVittie Tue, 21 Apr 2020 13:46:42 +0100 + +mutter (3.36.1-4) unstable; urgency=medium + + * Team upload + * Merge changelog from unstable + * Upload to unstable (starts transition: #954422) + * Update to upstream gnome-3-36 branch, commit 3.36.1-17-g9a2471db4 + - Fix caps-lock state becoming confused on VT switch + * d/gbp.conf: Follow upstream/3.36.x branch + + -- Simon McVittie Fri, 10 Apr 2020 17:56:10 +0100 + mutter (3.36.1-3ubuntu3) focal; urgency=medium * Ignore test failures on riscv64, like s390x, to unblock @@ -37,6 +120,16 @@ -- Marco Trevisan (Treviño) Thu, 09 Apr 2020 14:40:58 +0200 +mutter (3.34.4-1) unstable; urgency=medium + + * Team upload + * d/gbp.conf: Follow debian/unstable branch + * New upstream release + * d/patches: Apply post-release fixes up to 3.34.4-5-g2709a4ffb + * Standards-Version: 4.5.0 (no changes required) + + -- Simon McVittie Tue, 25 Feb 2020 16:26:10 +0000 + mutter (3.36.1-3) experimental; urgency=medium * Team upload diff -Nru mutter-3.36.1/debian/control mutter-3.36.2/debian/control --- mutter-3.36.1/debian/control 2020-04-17 01:08:01.000000000 +0000 +++ mutter-3.36.2/debian/control 2020-05-07 01:22:16.000000000 +0000 @@ -79,8 +79,8 @@ Standards-Version: 4.5.0 XS-Debian-Vcs-Git: https://salsa.debian.org/gnome-team/mutter.git XS-Debian-Vcs-Browser: https://salsa.debian.org/gnome-team/mutter -Vcs-Git: https://salsa.debian.org/gnome-team/mutter.git -b ubuntu/master -Vcs-Browser: https://salsa.debian.org/gnome-team/mutter/tree/ubuntu/master +Vcs-Git: https://salsa.debian.org/gnome-team/mutter.git -b ubuntu/focal +Vcs-Browser: https://salsa.debian.org/gnome-team/mutter/tree/ubuntu/focal Package: mutter Architecture: any diff -Nru mutter-3.36.1/debian/control.in mutter-3.36.2/debian/control.in --- mutter-3.36.1/debian/control.in 2020-04-16 20:04:59.000000000 +0000 +++ mutter-3.36.2/debian/control.in 2020-05-07 01:22:16.000000000 +0000 @@ -75,8 +75,8 @@ Standards-Version: 4.5.0 XS-Debian-Vcs-Git: https://salsa.debian.org/gnome-team/mutter.git XS-Debian-Vcs-Browser: https://salsa.debian.org/gnome-team/mutter -Vcs-Git: https://salsa.debian.org/gnome-team/mutter.git -b ubuntu/master -Vcs-Browser: https://salsa.debian.org/gnome-team/mutter/tree/ubuntu/master +Vcs-Git: https://salsa.debian.org/gnome-team/mutter.git -b ubuntu/focal +Vcs-Browser: https://salsa.debian.org/gnome-team/mutter/tree/ubuntu/focal Package: mutter Architecture: any diff -Nru mutter-3.36.1/debian/gbp.conf mutter-3.36.2/debian/gbp.conf --- mutter-3.36.1/debian/gbp.conf 2020-04-16 20:04:59.000000000 +0000 +++ mutter-3.36.2/debian/gbp.conf 2020-05-07 01:22:16.000000000 +0000 @@ -1,8 +1,8 @@ [DEFAULT] pristine-tar = True -debian-branch = ubuntu/master +debian-branch = ubuntu/focal debian-tag=ubuntu/%(version)s -upstream-branch = upstream/latest +upstream-branch = upstream/3.36.x upstream-vcs-tag = %(version)s [buildpackage] diff -Nru mutter-3.36.1/debian/libmutter-6-0.symbols mutter-3.36.2/debian/libmutter-6-0.symbols --- mutter-3.36.1/debian/libmutter-6-0.symbols 2020-04-16 20:04:59.000000000 +0000 +++ mutter-3.36.2/debian/libmutter-6-0.symbols 2020-05-07 01:22:16.000000000 +0000 @@ -1595,6 +1595,7 @@ clutter_page_turn_effect_set_radius@Base 3.29.4 clutter_paint_context_destroy@Base 3.35.90 clutter_paint_context_get_framebuffer@Base 3.35.90 + clutter_paint_context_get_paint_flags@Base 3.36.2 clutter_paint_context_get_redraw_clip@Base 3.35.92 clutter_paint_context_get_stage_view@Base 3.35.90 clutter_paint_context_get_type@Base 3.35.90 @@ -1834,6 +1835,8 @@ clutter_stage_manager_list_stages@Base 3.29.4 clutter_stage_manager_peek_stages@Base 3.29.4 clutter_stage_new@Base 3.29.4 + clutter_stage_paint_to_buffer@Base 3.36.2 + clutter_stage_paint_to_framebuffer@Base 3.36.2 clutter_stage_queue_redraw@Base 3.29.4 clutter_stage_read_pixels@Base 3.29.4 clutter_stage_set_accept_focus@Base 3.29.4 diff -Nru mutter-3.36.1/debian/patches/backends-native-Translate-coordinates-of-absolute-motion-.patch mutter-3.36.2/debian/patches/backends-native-Translate-coordinates-of-absolute-motion-.patch --- mutter-3.36.1/debian/patches/backends-native-Translate-coordinates-of-absolute-motion-.patch 2020-04-16 20:04:59.000000000 +0000 +++ mutter-3.36.2/debian/patches/backends-native-Translate-coordinates-of-absolute-motion-.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,30 +0,0 @@ -From: Jonas Troeger -Date: Tue, 31 Mar 2020 22:11:37 +0200 -Subject: backends/native: Translate coordinates of absolute motion events - -The motion events of tablets for example need to be mapped on the -selected screen area if the input device is configured to use only a -part of the active logical monitor. -To achieve this behavior each motion event is transformed using the -transformation matrix set for the input device. - -Bug: https://gitlab.gnome.org/GNOME/mutter/-/issues/1118 -Origin: upstream, 3.36.2 ---- - src/backends/native/meta-seat-native.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/src/backends/native/meta-seat-native.c b/src/backends/native/meta-seat-native.c -index 7e0feab..9c25d4a 100644 ---- a/src/backends/native/meta-seat-native.c -+++ b/src/backends/native/meta-seat-native.c -@@ -424,6 +424,9 @@ new_absolute_motion_event (MetaSeatNative *seat, - meta_xkb_translate_state (event, seat->xkb, seat->button_state); - event->motion.x = x; - event->motion.y = y; -+ meta_input_device_native_translate_coordinates (input_device, stage, -+ &event->motion.x, -+ &event->motion.y); - event->motion.axes = axes; - clutter_event_set_device (event, seat->core_pointer); - clutter_event_set_source_device (event, input_device); diff -Nru mutter-3.36.1/debian/patches/backends-x11-Fix-access-to-WacomDevice.patch mutter-3.36.2/debian/patches/backends-x11-Fix-access-to-WacomDevice.patch --- mutter-3.36.1/debian/patches/backends-x11-Fix-access-to-WacomDevice.patch 2020-04-16 20:04:59.000000000 +0000 +++ mutter-3.36.2/debian/patches/backends-x11-Fix-access-to-WacomDevice.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,72 +0,0 @@ -From: Carlos Garnacho -Date: Tue, 7 Apr 2020 16:57:59 +0000 -Subject: backends/x11: Fix access to WacomDevice - -At some point we crossed the streams... In a short timespan we had -1f00aba92c32 merged, pushing WacomDevice to a common parent object, -and dcaa45fc0c199 implementing device grouping for X11. - -The latter did not rely on the former, and just happened to -merge/compile without issues, but would promptly trigger a crash -whenever the API would be used. - -Drop all traces of the WacomDevice internal to MetaInputDeviceX11. - -https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1183 - -(cherry picked from commit f0718c7d95820a38a54222ff362c76c2f7e0ec58) - -Origin: upstream, 3.36.2 ---- - src/backends/x11/meta-input-device-x11.c | 21 +++++++++++++-------- - 1 file changed, 13 insertions(+), 8 deletions(-) - -diff --git a/src/backends/x11/meta-input-device-x11.c b/src/backends/x11/meta-input-device-x11.c -index 2406c34..6e41ffd 100644 ---- a/src/backends/x11/meta-input-device-x11.c -+++ b/src/backends/x11/meta-input-device-x11.c -@@ -38,7 +38,6 @@ struct _MetaInputDeviceX11 - float current_y; - - #ifdef HAVE_LIBWACOM -- WacomDevice *wacom_device; - GArray *group_modes; - #endif - }; -@@ -93,13 +92,16 @@ meta_input_device_x11_is_grouped (ClutterInputDevice *device, - ClutterInputDevice *other_device) - { - #ifdef HAVE_LIBWACOM -- MetaInputDeviceX11 *device_x11 = META_INPUT_DEVICE_X11 (device); -- MetaInputDeviceX11 *other_device_x11 = META_INPUT_DEVICE_X11 (other_device); -+ WacomDevice *wacom_device, *other_wacom_device; - -- if (device_x11->wacom_device && -- other_device_x11->wacom_device && -- libwacom_compare (device_x11->wacom_device, -- other_device_x11->wacom_device, -+ wacom_device = -+ meta_input_device_get_wacom_device (META_INPUT_DEVICE (device)); -+ other_wacom_device = -+ meta_input_device_get_wacom_device (META_INPUT_DEVICE (other_device)); -+ -+ if (wacom_device && other_wacom_device && -+ libwacom_compare (wacom_device, -+ other_wacom_device, - WCOMPARE_NORMAL) == 0) - return TRUE; - #endif -@@ -413,9 +415,12 @@ pad_switch_mode (ClutterInputDevice *device, - { - MetaInputDeviceX11 *device_x11 = META_INPUT_DEVICE_X11 (device); - uint32_t n_buttons, n_modes, button_group, next_mode, i; -+ WacomDevice *wacom_device; - GList *switch_buttons = NULL; - -- n_buttons = libwacom_get_num_buttons (device_x11->wacom_device); -+ wacom_device = -+ meta_input_device_get_wacom_device (META_INPUT_DEVICE (device)); -+ n_buttons = libwacom_get_num_buttons (wacom_device); - - for (i = 0; i < n_buttons; i++) - { diff -Nru mutter-3.36.1/debian/patches/clutter-actor-Fix-pick-when-actor-is-not-allocated.patch mutter-3.36.2/debian/patches/clutter-actor-Fix-pick-when-actor-is-not-allocated.patch --- mutter-3.36.1/debian/patches/clutter-actor-Fix-pick-when-actor-is-not-allocated.patch 2020-04-16 20:04:59.000000000 +0000 +++ mutter-3.36.2/debian/patches/clutter-actor-Fix-pick-when-actor-is-not-allocated.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,30 +0,0 @@ -From: Andre Moreira Magalhaes -Date: Tue, 31 Mar 2020 21:11:19 +0000 -Subject: clutter/actor: Fix pick when actor is not allocated - -When selecting the pick regions for an actor we were not considering -whether the actor was allocated and that was causing issues where the -preferred width/height of the actor was used when deciding whether -the actor should be considered as a pick target. - -Check if the actor has a valid allocation, in addition to being mapped -and being in pick mode, in clutter_actor_should_pick_paint(). - -Forwarded: https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1169 -Applied-upstream: 3.36.2, commit:82f3bdd14e0081dff60e9fed51376fc4cbf8b201 ---- - clutter/clutter/clutter-actor.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c -index 56eaad6..b82d847 100644 ---- a/clutter/clutter/clutter-actor.c -+++ b/clutter/clutter/clutter-actor.c -@@ -2410,6 +2410,7 @@ clutter_actor_should_pick_paint (ClutterActor *self) - g_return_val_if_fail (CLUTTER_IS_ACTOR (self), FALSE); - - if (CLUTTER_ACTOR_IS_MAPPED (self) && -+ clutter_actor_has_allocation (self) && - (_clutter_context_get_pick_mode () == CLUTTER_PICK_ALL || - CLUTTER_ACTOR_IS_REACTIVE (self))) - return TRUE; diff -Nru mutter-3.36.1/debian/patches/clutter-click-action-Do-not-process-captured-event-if-act.patch mutter-3.36.2/debian/patches/clutter-click-action-Do-not-process-captured-event-if-act.patch --- mutter-3.36.1/debian/patches/clutter-click-action-Do-not-process-captured-event-if-act.patch 2020-04-16 20:04:59.000000000 +0000 +++ mutter-3.36.2/debian/patches/clutter-click-action-Do-not-process-captured-event-if-act.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ -From: Andre Moreira Magalhaes -Date: Thu, 2 Apr 2020 16:12:43 +0000 -Subject: clutter/click-action: Do not process captured event if action is - disabled - -Disabling a click action after a button-press but before a -button-release is captured makes ClutterClickAction connect to -captured-event and never disconnect. - -This change fixes it by making sure the captured-event is only -processed if the action is still enabled, otherwise releasing -the action (reset state) and propagating the event. - -Forwarded: https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1170 -Applied-upstream: 3.36.2, commit:95c1baf3d18fe8e50de402b7af4c29d9ae993d19 ---- - clutter/clutter/clutter-click-action.c | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/clutter/clutter/clutter-click-action.c b/clutter/clutter/clutter-click-action.c -index 6b523b0..cb35d72 100644 ---- a/clutter/clutter/clutter-click-action.c -+++ b/clutter/clutter/clutter-click-action.c -@@ -346,6 +346,12 @@ on_captured_event (ClutterActor *stage, - ClutterModifierType modifier_state; - gboolean has_button = TRUE; - -+ if (!clutter_actor_meta_get_enabled (CLUTTER_ACTOR_META (action))) -+ { -+ clutter_click_action_release (action); -+ return CLUTTER_EVENT_PROPAGATE; -+ } -+ - actor = clutter_actor_meta_get_actor (CLUTTER_ACTOR_META (action)); - - switch (clutter_event_type (event)) diff -Nru mutter-3.36.1/debian/patches/clutter-master-clock-default-Sync-timelines-to-hardware-v.patch mutter-3.36.2/debian/patches/clutter-master-clock-default-Sync-timelines-to-hardware-v.patch --- mutter-3.36.1/debian/patches/clutter-master-clock-default-Sync-timelines-to-hardware-v.patch 2020-04-16 20:04:59.000000000 +0000 +++ mutter-3.36.2/debian/patches/clutter-master-clock-default-Sync-timelines-to-hardware-v.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,71 +0,0 @@ -From: Daniel van Vugt -Date: Tue, 13 Aug 2019 18:03:26 +0800 -Subject: clutter/master-clock-default: Sync timelines to hardware vsync - -Previously clutter timelines advanced according to `g_source_get_time`. -But that meant the spatial stepping of animations was visibly sensitive to -any irregularities in the main loop. It also represented a time older [1] -than the intended presentation time of each frame. - -Now we instead use `master_clock_get_next_presentation_time`. This ensures -we get the smoothness of hardware vsync as well as being closer to the -actual presentation time. - -This means, for example, backends like Xorg that move the hardware cursor -independently of repaints will have their animations more closely matching -the hardware cursor position. So the cursor appears to stick more closely -when dragging windows or on the lock screen etc. - -[1] "older" = (refresh_interval - sync_delay) = ~14ms for 60Hz - -Bug: https://gitlab.gnome.org/GNOME/mutter/issues/25 -Forwarded: https://gitlab.gnome.org/GNOME/mutter/merge_requests/724 -Applied-upstream: 3.36.2, commit:6f094bd399f4197e7036d8306337b4b0ee72ca65 ---- - clutter/clutter/clutter-master-clock-default.c | 26 +++++++++++++++++++++++++- - 1 file changed, 25 insertions(+), 1 deletion(-) - -diff --git a/clutter/clutter/clutter-master-clock-default.c b/clutter/clutter/clutter-master-clock-default.c -index 8d50ab8..ac55f1b 100644 ---- a/clutter/clutter/clutter-master-clock-default.c -+++ b/clutter/clutter/clutter-master-clock-default.c -@@ -190,6 +190,26 @@ master_clock_get_swap_wait_time (ClutterMasterClockDefault *master_clock) - } - } - -+static int64_t -+master_clock_get_next_presentation_time (ClutterMasterClockDefault *master_clock) -+{ -+ ClutterStageManager *stage_manager = clutter_stage_manager_get_default (); -+ const GSList *stages, *l; -+ int64_t earliest = -1; -+ -+ stages = clutter_stage_manager_peek_stages (stage_manager); -+ -+ for (l = stages; l != NULL; l = l->next) -+ { -+ gint64 t = _clutter_stage_get_next_presentation_time (l->data); -+ -+ if (earliest == -1 || (t != -1 && t < earliest)) -+ earliest = t; -+ } -+ -+ return earliest; -+} -+ - static void - master_clock_schedule_stage_updates (ClutterMasterClockDefault *master_clock) - { -@@ -466,7 +486,11 @@ clutter_clock_dispatch (GSource *source, - COGL_TRACE_BEGIN (ClutterMasterClockTick, "Master Clock (tick)"); - - /* Get the time to use for this frame */ -- master_clock->cur_tick = g_source_get_time (source); -+ master_clock->cur_tick = master_clock_get_next_presentation_time (master_clock); -+ -+ /* On the first frame the backend might not have an answer */ -+ if (master_clock->cur_tick <= 0) -+ master_clock->cur_tick = g_source_get_time (source); - - #ifdef CLUTTER_ENABLE_DEBUG - master_clock->remaining_budget = master_clock->frame_budget; diff -Nru mutter-3.36.1/debian/patches/clutter-stage-Add-API-to-get_next_presentation_time.patch mutter-3.36.2/debian/patches/clutter-stage-Add-API-to-get_next_presentation_time.patch --- mutter-3.36.1/debian/patches/clutter-stage-Add-API-to-get_next_presentation_time.patch 2020-04-16 20:04:59.000000000 +0000 +++ mutter-3.36.2/debian/patches/clutter-stage-Add-API-to-get_next_presentation_time.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,178 +0,0 @@ -From: Daniel van Vugt -Date: Tue, 13 Aug 2019 17:33:19 +0800 -Subject: clutter/stage: Add API to get_next_presentation_time - -Forwarded: https://gitlab.gnome.org/GNOME/mutter/merge_requests/724 -Applied-upstream: 3.36.2, commit:2c805524b49150793fe97908cb309d9b8c52f8ad ---- - clutter/clutter/clutter-stage-private.h | 1 + - clutter/clutter/clutter-stage-window.c | 16 ++++++++++++++++ - clutter/clutter/clutter-stage-window.h | 4 ++++ - clutter/clutter/clutter-stage.c | 15 +++++++++++++++ - clutter/clutter/cogl/clutter-stage-cogl.c | 32 ++++++++++++++++++++++++++++++- - clutter/clutter/cogl/clutter-stage-cogl.h | 1 + - 6 files changed, 68 insertions(+), 1 deletion(-) - -diff --git a/clutter/clutter/clutter-stage-private.h b/clutter/clutter/clutter-stage-private.h -index c8c1ef3..a8abd05 100644 ---- a/clutter/clutter/clutter-stage-private.h -+++ b/clutter/clutter/clutter-stage-private.h -@@ -78,6 +78,7 @@ void _clutter_stage_schedule_update (ClutterStage *stage); - gint64 _clutter_stage_get_update_time (ClutterStage *stage); - void _clutter_stage_clear_update_time (ClutterStage *stage); - gboolean _clutter_stage_has_full_redraw_queued (ClutterStage *stage); -+int64_t _clutter_stage_get_next_presentation_time (ClutterStage *stage); - - void clutter_stage_log_pick (ClutterStage *stage, - const graphene_point_t *vertices, -diff --git a/clutter/clutter/clutter-stage-window.c b/clutter/clutter/clutter-stage-window.c -index 3c80124..a3782a1 100644 ---- a/clutter/clutter/clutter-stage-window.c -+++ b/clutter/clutter/clutter-stage-window.c -@@ -178,6 +178,22 @@ _clutter_stage_window_clear_update_time (ClutterStageWindow *window) - iface->clear_update_time (window); - } - -+int64_t -+_clutter_stage_window_get_next_presentation_time (ClutterStageWindow *window) -+{ -+ ClutterStageWindowInterface *iface; -+ -+ g_return_val_if_fail (CLUTTER_IS_STAGE_WINDOW (window), 0); -+ -+ iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window); -+ -+ /* If not implemented then just revert to the old behaviour... */ -+ if (iface->get_next_presentation_time == NULL) -+ return _clutter_stage_window_get_update_time (window); -+ -+ return iface->get_next_presentation_time (window); -+} -+ - void - _clutter_stage_window_set_accept_focus (ClutterStageWindow *window, - gboolean accept_focus) -diff --git a/clutter/clutter/clutter-stage-window.h b/clutter/clutter/clutter-stage-window.h -index eb52941..78d15b7 100644 ---- a/clutter/clutter/clutter-stage-window.h -+++ b/clutter/clutter/clutter-stage-window.h -@@ -61,6 +61,8 @@ struct _ClutterStageWindowInterface - GList *(* get_views) (ClutterStageWindow *stage_window); - int64_t (* get_frame_counter) (ClutterStageWindow *stage_window); - void (* finish_frame) (ClutterStageWindow *stage_window); -+ -+ int64_t (* get_next_presentation_time) (ClutterStageWindow *stage_window); - }; - - ClutterActor * _clutter_stage_window_get_wrapper (ClutterStageWindow *window); -@@ -101,6 +103,8 @@ void _clutter_stage_window_finish_frame (ClutterStageWin - - int64_t _clutter_stage_window_get_frame_counter (ClutterStageWindow *window); - -+int64_t _clutter_stage_window_get_next_presentation_time (ClutterStageWindow *window); -+ - G_END_DECLS - - #endif /* __CLUTTER_STAGE_WINDOW_H__ */ -diff --git a/clutter/clutter/clutter-stage.c b/clutter/clutter/clutter-stage.c -index 07ba9df..fb73a02 100644 ---- a/clutter/clutter/clutter-stage.c -+++ b/clutter/clutter/clutter-stage.c -@@ -3751,6 +3751,21 @@ _clutter_stage_clear_update_time (ClutterStage *stage) - _clutter_stage_window_clear_update_time (stage_window); - } - -+int64_t -+_clutter_stage_get_next_presentation_time (ClutterStage *stage) -+{ -+ ClutterStageWindow *stage_window; -+ -+ if (CLUTTER_ACTOR_IN_DESTRUCTION (stage)) -+ return 0; -+ -+ stage_window = _clutter_stage_get_window (stage); -+ if (stage_window == NULL) -+ return 0; -+ -+ return _clutter_stage_window_get_next_presentation_time (stage_window); -+} -+ - ClutterPaintVolume * - _clutter_stage_paint_volume_stack_allocate (ClutterStage *stage) - { -diff --git a/clutter/clutter/cogl/clutter-stage-cogl.c b/clutter/clutter/cogl/clutter-stage-cogl.c -index d48e976..28b3345 100644 ---- a/clutter/clutter/cogl/clutter-stage-cogl.c -+++ b/clutter/clutter/cogl/clutter-stage-cogl.c -@@ -235,7 +235,12 @@ clutter_stage_cogl_schedule_update (ClutterStageWindow *stage_window, - stage_cogl->update_time = next_presentation_time - max_render_time_allowed; - - if (stage_cogl->update_time == stage_cogl->last_update_time) -- stage_cogl->update_time = stage_cogl->last_update_time + refresh_interval; -+ { -+ stage_cogl->update_time += refresh_interval; -+ next_presentation_time += refresh_interval; -+ } -+ -+ stage_cogl->next_presentation_time = next_presentation_time; - } - - static gint64 -@@ -256,6 +261,29 @@ clutter_stage_cogl_clear_update_time (ClutterStageWindow *stage_window) - - stage_cogl->last_update_time = stage_cogl->update_time; - stage_cogl->update_time = -1; -+ stage_cogl->next_presentation_time = -1; -+} -+ -+static int64_t -+clutter_stage_cogl_get_next_presentation_time (ClutterStageWindow *stage_window) -+{ -+ ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_window); -+ int64_t now = g_get_monotonic_time (); -+ -+ if (stage_cogl->next_presentation_time > 0 && -+ stage_cogl->next_presentation_time <= now) -+ { -+ CLUTTER_NOTE (BACKEND, -+ "Missed some frames. Something blocked for over " -+ "%" G_GINT64_FORMAT "ms.", -+ (now - stage_cogl->next_presentation_time) / 1000); -+ -+ stage_cogl->update_time = -1; -+ clutter_stage_cogl_schedule_update (stage_window, -+ stage_cogl->last_sync_delay); -+ } -+ -+ return stage_cogl->next_presentation_time; - } - - static ClutterActor * -@@ -1008,6 +1036,7 @@ clutter_stage_window_iface_init (ClutterStageWindowInterface *iface) - iface->schedule_update = clutter_stage_cogl_schedule_update; - iface->get_update_time = clutter_stage_cogl_get_update_time; - iface->clear_update_time = clutter_stage_cogl_clear_update_time; -+ iface->get_next_presentation_time = clutter_stage_cogl_get_next_presentation_time; - iface->redraw = clutter_stage_cogl_redraw; - } - -@@ -1053,6 +1082,7 @@ _clutter_stage_cogl_init (ClutterStageCogl *stage) - stage->refresh_rate = 0.0; - - stage->update_time = -1; -+ stage->next_presentation_time = -1; - } - - static void -diff --git a/clutter/clutter/cogl/clutter-stage-cogl.h b/clutter/clutter/cogl/clutter-stage-cogl.h -index 1eaa02e..634f856 100644 ---- a/clutter/clutter/cogl/clutter-stage-cogl.h -+++ b/clutter/clutter/cogl/clutter-stage-cogl.h -@@ -48,6 +48,7 @@ struct _ClutterStageCogl - gint64 last_presentation_time; - gint64 update_time; - int64_t last_update_time; -+ int64_t next_presentation_time; - - /* We only enable clipped redraws after 2 frames, since we've seen - * a lot of drivers can struggle to get going and may output some diff -Nru mutter-3.36.1/debian/patches/clutter-stage-Don-t-assume-stage-relayouts-reallocate-eve.patch mutter-3.36.2/debian/patches/clutter-stage-Don-t-assume-stage-relayouts-reallocate-eve.patch --- mutter-3.36.1/debian/patches/clutter-stage-Don-t-assume-stage-relayouts-reallocate-eve.patch 2020-04-16 20:04:59.000000000 +0000 +++ mutter-3.36.2/debian/patches/clutter-stage-Don-t-assume-stage-relayouts-reallocate-eve.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,67 +0,0 @@ -From: =?utf-8?q?Jonas_Dre=C3=9Fler?= -Date: Fri, 3 Apr 2020 08:40:46 +0000 -Subject: clutter/stage: Don't assume stage relayouts reallocate everything - -With the introduction of "shallow" relayouts, we are now able to enter -allocation cycles not only at the stage but also deeper down the -hierarchy if we know an actors allocation isn't affected by its children -since the NO_LAYOUT flag is set. - -Now that means when queuing relayouts it's possible that -`priv->needs_allocation` gets set to TRUE for some actors down the -hierarchy, but not for actors higher up in the hierarchy. An actor tree -where that happens could look like that: - -stage -> container -> container2 (NO_LAYOUT) -> textActor - -With that tree, if the "textActor" queues a relayout, "container2" will -be added to the relayout hashtable of the stage and the actors "stage" -and "container" will have `priv->needs_allocation` set to FALSE. - -Now if another relayout on the stage actor is queued, -`clutter_stage_queue_actor_relayout()` currently removes all the other -hashtable entries in favour of the stage entry, (wrongly) assuming that -will allocate everything. It doesn't allocate everything because in the -example above "container" has `priv->needs_allocation` set to FALSE, -which makes clutter_actor_allocate() return early before allocating its -children, so in the end "container2" will never get a new allocation. - -To fix this, stop flushing the relayout hashtable when queuing a -stage-relayout and still add new entries to the hashtable if a stage -relayout is already queued to make sure we still go through all the -previously queued "shallow" relayouts. That shouldn't hurt performance, -too, because as soon as an actor got allocated once, it doesn't need an -allocation anymore and should bail out in clutter_actor_allocate() as -long as it's absolute position didn't change. - -Fixes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2538 - -https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1173 - -(cherry picked from commit e74c2e42cf3dc744aaa53cb5a683138425cda9b6) - -Origin: upstream, 3.36.2 ---- - clutter/clutter/clutter-stage.c | 6 ------ - 1 file changed, 6 deletions(-) - -diff --git a/clutter/clutter/clutter-stage.c b/clutter/clutter/clutter-stage.c -index fb73a02..4587786 100644 ---- a/clutter/clutter/clutter-stage.c -+++ b/clutter/clutter/clutter-stage.c -@@ -1320,15 +1320,9 @@ clutter_stage_queue_actor_relayout (ClutterStage *stage, - { - ClutterStagePrivate *priv = stage->priv; - -- if (g_hash_table_contains (priv->pending_relayouts, stage)) -- return; -- - if (g_hash_table_size (priv->pending_relayouts) == 0) - _clutter_stage_schedule_update (stage); - -- if (actor == (ClutterActor *) stage) -- g_hash_table_remove_all (priv->pending_relayouts); -- - g_hash_table_add (priv->pending_relayouts, g_object_ref (actor)); - priv->pending_relayouts_version++; - } diff -Nru mutter-3.36.1/debian/patches/cogl-Defend-against-empty-or-unallocated-framebuffers.patch mutter-3.36.2/debian/patches/cogl-Defend-against-empty-or-unallocated-framebuffers.patch --- mutter-3.36.1/debian/patches/cogl-Defend-against-empty-or-unallocated-framebuffers.patch 2020-04-16 20:04:59.000000000 +0000 +++ mutter-3.36.2/debian/patches/cogl-Defend-against-empty-or-unallocated-framebuffers.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,37 +0,0 @@ -From: Simon McVittie -Date: Thu, 2 Apr 2020 19:30:59 +0100 -Subject: cogl: Defend against empty or unallocated framebuffers - -It isn't immediately obvious that this is impossible, because there's some -"action at a distance" going on with framebuffers that have their size -set lazily, after their textures get allocated; so let's make this a -critical warning rather than crashing. - -In particular, this works around a crash when gnome-shell tries to blur a -background that hasn't yet had any space allocated for it - which it seems -is really an actor layout bug, but more robustness seems good to have. - -Workaround for . - -Forwarded: https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1172 -Signed-off-by: Simon McVittie -Applied-upstream: origin, 3.36.2, commit:e339a57ddf87de42e8171a935a7617cd2acf7ef6 ---- - cogl/cogl/driver/gl/cogl-framebuffer-gl.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/cogl/cogl/driver/gl/cogl-framebuffer-gl.c b/cogl/cogl/driver/gl/cogl-framebuffer-gl.c -index 2848d71..e4d215e 100644 ---- a/cogl/cogl/driver/gl/cogl-framebuffer-gl.c -+++ b/cogl/cogl/driver/gl/cogl-framebuffer-gl.c -@@ -132,8 +132,8 @@ _cogl_framebuffer_gl_flush_viewport_state (CoglFramebuffer *framebuffer) - { - float gl_viewport_y; - -- g_assert (framebuffer->viewport_width >=0 && -- framebuffer->viewport_height >=0); -+ g_return_if_fail (framebuffer->viewport_width >= 0); -+ g_return_if_fail (framebuffer->viewport_height >= 0); - - /* Convert the Cogl viewport y offset to an OpenGL viewport y offset - * NB: OpenGL defines its window and viewport origins to be bottom diff -Nru mutter-3.36.1/debian/patches/cogl-Don-t-allow-creating-sized-textures-with-0-pixels.patch mutter-3.36.2/debian/patches/cogl-Don-t-allow-creating-sized-textures-with-0-pixels.patch --- mutter-3.36.1/debian/patches/cogl-Don-t-allow-creating-sized-textures-with-0-pixels.patch 2020-04-16 20:04:59.000000000 +0000 +++ mutter-3.36.2/debian/patches/cogl-Don-t-allow-creating-sized-textures-with-0-pixels.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ -From: Simon McVittie -Date: Thu, 2 Apr 2020 19:30:14 +0100 -Subject: cogl: Don't allow creating sized textures with 0 pixels - -A texture with no pixels isn't a useful thing to have, and breaks -assumptions elsewhere. For example, CoglFramebuffer assumes that after -a texture has been allocated, it will have width and height both greater -than 0. - -In particular, this works around a crash when gnome-shell tries to blur a -background that hasn't yet had any space allocated for it - which it seems -is really an actor layout bug, but more robustness seems good to have. - -Workaround for . - -Forwarded: https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1172 -Signed-off-by: Simon McVittie -Applied-upstream: 3.36.2, commit:e3b2b90c72f72f9bf4a99add15829bf275fbe1a7 ---- - cogl/cogl/cogl-texture-2d.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/cogl/cogl/cogl-texture-2d.c b/cogl/cogl/cogl-texture-2d.c -index 21a3c3f..a99cbb3 100644 ---- a/cogl/cogl/cogl-texture-2d.c -+++ b/cogl/cogl/cogl-texture-2d.c -@@ -121,6 +121,9 @@ cogl_texture_2d_new_with_size (CoglContext *ctx, - { - CoglTextureLoader *loader; - -+ g_return_val_if_fail (width >= 1, NULL); -+ g_return_val_if_fail (height >= 1, NULL); -+ - loader = _cogl_texture_create_loader (); - loader->src_type = COGL_TEXTURE_SOURCE_TYPE_SIZED; - loader->src.sized.width = width; diff -Nru mutter-3.36.1/debian/patches/debian/tests-Tag-closed-transient-no-input-tests-as-flaky.patch mutter-3.36.2/debian/patches/debian/tests-Tag-closed-transient-no-input-tests-as-flaky.patch --- mutter-3.36.1/debian/patches/debian/tests-Tag-closed-transient-no-input-tests-as-flaky.patch 2020-04-16 20:04:59.000000000 +0000 +++ mutter-3.36.2/debian/patches/debian/tests-Tag-closed-transient-no-input-tests-as-flaky.patch 2020-05-07 01:22:16.000000000 +0000 @@ -1,5 +1,5 @@ From: Iain Lane -Date: Wed, 14 Aug 2019 16:08:48 +0100 +Date: Wed, 14 Aug 2019 17:08:48 +0200 Subject: tests: Tag 'closed-transient-no-input' tests as flaky Then test runners can run these ones non-fatally. diff -Nru mutter-3.36.1/debian/patches/meson-add-back-default_driver-option.patch mutter-3.36.2/debian/patches/meson-add-back-default_driver-option.patch --- mutter-3.36.1/debian/patches/meson-add-back-default_driver-option.patch 2020-04-16 20:04:59.000000000 +0000 +++ mutter-3.36.2/debian/patches/meson-add-back-default_driver-option.patch 2020-05-07 01:22:16.000000000 +0000 @@ -44,7 +44,7 @@ input: 'cogl-config.h.meson', output: 'cogl-config.h', diff --git a/meson.build b/meson.build -index 3b8d519..ec20965 100644 +index ed9cc88..fb35bc8 100644 --- a/meson.build +++ b/meson.build @@ -222,6 +222,8 @@ if have_wayland_eglstream diff -Nru mutter-3.36.1/debian/patches/monitor-config-manager-Fallback-to-closed-laptop-lid-conf.patch mutter-3.36.2/debian/patches/monitor-config-manager-Fallback-to-closed-laptop-lid-conf.patch --- mutter-3.36.1/debian/patches/monitor-config-manager-Fallback-to-closed-laptop-lid-conf.patch 2020-04-16 20:04:59.000000000 +0000 +++ mutter-3.36.2/debian/patches/monitor-config-manager-Fallback-to-closed-laptop-lid-conf.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,69 +0,0 @@ -From: =?utf-8?b?Ik1hcmNvIFRyZXZpc2FuIChUcmV2acOxbyki?= -Date: Thu, 16 Apr 2020 00:28:05 +0200 -Subject: monitor-config-manager: Fallback to closed laptop lid configuration - -When closing the lid of a laptop, we reconfigure all the monitors in order -to update the CRTCs and (if enabled) the global UI scaling factor. - -To do this, we try first to reuse the current configuration for the usable -monitors, but if we have only monitor enabled and this one is on the laptop -lid we just end up creating a new configuration where the primary monitor is -the laptop one (as per find_primary_monitor() in MetaMonitorConfigManager), -but ignoring the user parameters. - -In case the user selected a different resolution / scaling compared to the -default one, while the laptop lid is closed we might change the monitors -layout, causing applications to rescale or reposition. - -To avoid this, when creating the monitors configuration from the current -current state, in case we have only one monitor available and that one is -the laptop panel, let's just reuse this configuration. - -https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1200 ---- - src/backends/meta-monitor-config-manager.c | 18 +++++++++++++++--- - 1 file changed, 15 insertions(+), 3 deletions(-) - -diff --git a/src/backends/meta-monitor-config-manager.c b/src/backends/meta-monitor-config-manager.c -index 5739ca1..6e31432 100644 ---- a/src/backends/meta-monitor-config-manager.c -+++ b/src/backends/meta-monitor-config-manager.c -@@ -443,23 +443,35 @@ MetaMonitorsConfigKey * - meta_create_monitors_config_key_for_current_state (MetaMonitorManager *monitor_manager) - { - MetaMonitorsConfigKey *config_key; -+ MetaMonitorSpec *laptop_monitor_spec; - GList *l; - GList *monitor_specs; - -+ laptop_monitor_spec = NULL; - monitor_specs = NULL; - for (l = monitor_manager->monitors; l; l = l->next) - { - MetaMonitor *monitor = l->data; - MetaMonitorSpec *monitor_spec; - -- if (meta_monitor_is_laptop_panel (monitor) && -- is_lid_closed (monitor_manager)) -- continue; -+ if (meta_monitor_is_laptop_panel (monitor)) -+ { -+ laptop_monitor_spec = meta_monitor_get_spec (monitor); -+ -+ if (is_lid_closed (monitor_manager)) -+ continue; -+ } - - monitor_spec = meta_monitor_spec_clone (meta_monitor_get_spec (monitor)); - monitor_specs = g_list_prepend (monitor_specs, monitor_spec); - } - -+ if (!monitor_specs && laptop_monitor_spec) -+ { -+ monitor_specs = -+ g_list_prepend (NULL, meta_monitor_spec_clone (laptop_monitor_spec)); -+ } -+ - if (!monitor_specs) - return NULL; - diff -Nru mutter-3.36.1/debian/patches/series mutter-3.36.2/debian/patches/series --- mutter-3.36.1/debian/patches/series 2020-04-16 20:04:59.000000000 +0000 +++ mutter-3.36.2/debian/patches/series 2020-05-07 01:22:16.000000000 +0000 @@ -1,20 +1,3 @@ -clutter-actor-Fix-pick-when-actor-is-not-allocated.patch -tests-actor-pick-Remove-tabs.patch -tests-actor-pick-Allocate-actor-before-picking.patch -clutter-click-action-Do-not-process-captured-event-if-act.patch -clutter-stage-Add-API-to-get_next_presentation_time.patch -clutter-master-clock-default-Sync-timelines-to-hardware-v.patch -cogl-Don-t-allow-creating-sized-textures-with-0-pixels.patch -cogl-Defend-against-empty-or-unallocated-framebuffers.patch -window-actor-Set-viewport-when-blitting-to-screencast-fb.patch -Update-Slovak-translation.patch -x11-fix-compilation-if-libwacom-false.patch -window-Check-aliveness-a-bit-less-aggressively.patch -clutter-stage-Don-t-assume-stage-relayouts-reallocate-eve.patch -backends-x11-Fix-access-to-WacomDevice.patch -backends-native-Translate-coordinates-of-absolute-motion-.patch -wayland-xdnd-Add-error-traps-around-Xdnd-IPC.patch -monitor-config-manager-Fallback-to-closed-laptop-lid-conf.patch theme-use-gtk_render_icon_suface-to-paint-button-icon.patch theme-load-icons-as-Gtk-does-with-fallback-and-RTL-suppor.patch meson-add-back-default_driver-option.patch diff -Nru mutter-3.36.1/debian/patches/tests-actor-pick-Allocate-actor-before-picking.patch mutter-3.36.2/debian/patches/tests-actor-pick-Allocate-actor-before-picking.patch --- mutter-3.36.1/debian/patches/tests-actor-pick-Allocate-actor-before-picking.patch 2020-04-16 20:04:59.000000000 +0000 +++ mutter-3.36.2/debian/patches/tests-actor-pick-Allocate-actor-before-picking.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,44 +0,0 @@ -From: Georges Basile Stavracas Neto -Date: Tue, 31 Mar 2020 22:01:53 +0000 -Subject: tests/actor-pick: Allocate actor before picking - -Picking now only happens on allocated actors, but the -callback in the actor-pick test is not waiting for the -stage to run an allocation cycle. Ideally, we'd wait -for this cycle, but for now, forcing an allocation works -as well. - -Allocate the overlay actor in the actor-pick test. - -Forwarded: https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1169 -Applied-upstream: 3.36.2, commit:6f9b5edd4deeb412e644122ce2f15b3d593bd07a ---- - src/tests/clutter/conform/actor-pick.c | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/src/tests/clutter/conform/actor-pick.c b/src/tests/clutter/conform/actor-pick.c -index 53ac8ec..dcee964 100644 ---- a/src/tests/clutter/conform/actor-pick.c -+++ b/src/tests/clutter/conform/actor-pick.c -@@ -67,6 +67,9 @@ on_timeout (gpointer data) - } - else if (test_num == 2) - { -+ ClutterActorBox over_actor_box = -+ CLUTTER_ACTOR_BOX_INIT (0, 0, STAGE_WIDTH, STAGE_HEIGHT); -+ - /* Make the actor visible but set a clip so that only some - of the actors are accessible */ - clutter_actor_show (over_actor); -@@ -76,6 +79,11 @@ on_timeout (gpointer data) - state->actor_width * (ACTORS_X - 4), - state->actor_height * (ACTORS_Y - 4)); - -+ /* Only allocated actors can be picked, so force an allocation -+ * of the overlay actor here. -+ */ -+ clutter_actor_allocate (over_actor, &over_actor_box, 0); -+ - if (g_test_verbose ()) - g_print ("Clipped covering actor:\n"); - } diff -Nru mutter-3.36.1/debian/patches/tests-actor-pick-Remove-tabs.patch mutter-3.36.2/debian/patches/tests-actor-pick-Remove-tabs.patch --- mutter-3.36.1/debian/patches/tests-actor-pick-Remove-tabs.patch 2020-04-16 20:04:59.000000000 +0000 +++ mutter-3.36.2/debian/patches/tests-actor-pick-Remove-tabs.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,43 +0,0 @@ -From: Georges Basile Stavracas Neto -Date: Tue, 31 Mar 2020 21:58:44 +0000 -Subject: tests/actor-pick: Remove tabs - -They're evil. - -Forwarded: https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1169 -Applied-upstream: 3.36.2, commit:31809e121424ec6609e947ab2d6bde6ae792b539 ---- - src/tests/clutter/conform/actor-pick.c | 12 ++++++------ - 1 file changed, 6 insertions(+), 6 deletions(-) - -diff --git a/src/tests/clutter/conform/actor-pick.c b/src/tests/clutter/conform/actor-pick.c -index 09c5bf7..53ac8ec 100644 ---- a/src/tests/clutter/conform/actor-pick.c -+++ b/src/tests/clutter/conform/actor-pick.c -@@ -175,10 +175,10 @@ actor_pick (void) - for (y = 0; y < ACTORS_Y; y++) - for (x = 0; x < ACTORS_X; x++) - { -- ClutterColor color = { x * 255 / (ACTORS_X - 1), -- y * 255 / (ACTORS_Y - 1), -- 128, 255 }; -- ClutterActor *rect = clutter_rectangle_new_with_color (&color); -+ ClutterColor color = { x * 255 / (ACTORS_X - 1), -+ y * 255 / (ACTORS_Y - 1), -+ 128, 255 }; -+ ClutterActor *rect = clutter_rectangle_new_with_color (&color); - - clutter_actor_set_position (rect, - x * state.actor_width, -@@ -187,9 +187,9 @@ actor_pick (void) - state.actor_width, - state.actor_height); - -- clutter_actor_add_child (state.stage, rect); -+ clutter_actor_add_child (state.stage, rect); - -- state.actors[y * ACTORS_X + x] = rect; -+ state.actors[y * ACTORS_X + x] = rect; - } - - clutter_actor_show (state.stage); diff -Nru mutter-3.36.1/debian/patches/Update-Slovak-translation.patch mutter-3.36.2/debian/patches/Update-Slovak-translation.patch --- mutter-3.36.1/debian/patches/Update-Slovak-translation.patch 2020-04-16 20:04:59.000000000 +0000 +++ mutter-3.36.2/debian/patches/Update-Slovak-translation.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,348 +0,0 @@ -From: =?utf-8?q?Du=C5=A1an_Kazik?= -Date: Sun, 5 Apr 2020 20:22:08 +0000 -Subject: Update Slovak translation - -Origin: upstream, 3.36.2, commit:b0709504ea22cdbd51225f9c0bf497d12351b37f ---- - po/sk.po | 167 +++++++++++++++++++++++++++++++++++++++++---------------------- - 1 file changed, 108 insertions(+), 59 deletions(-) - -diff --git a/po/sk.po b/po/sk.po -index 89e6859..d22e1a2 100644 ---- a/po/sk.po -+++ b/po/sk.po -@@ -13,8 +13,8 @@ msgid "" - msgstr "" - "Project-Id-Version: mutter\n" - "Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/mutter/issues\n" --"POT-Creation-Date: 2018-02-06 04:14+0000\n" --"PO-Revision-Date: 2018-03-17 21:52+0100\n" -+"POT-Creation-Date: 2020-03-30 20:11+0000\n" -+"PO-Revision-Date: 2020-04-05 22:21+0200\n" - "Last-Translator: Dušan Kazik \n" - "Language-Team: Slovak \n" - "Language: sk\n" -@@ -22,7 +22,7 @@ msgstr "" - "Content-Type: text/plain; charset=UTF-8\n" - "Content-Transfer-Encoding: 8bit\n" - "Plural-Forms: nplurals=3; plural=(n==1) ? 1 : (n>=2 && n<=4) ? 2 : 0;\n" --"X-Generator: Poedit 2.0.6\n" -+"X-Generator: Poedit 2.3\n" - - #: data/50-mutter-navigation.xml:6 - msgid "Navigation" -@@ -468,29 +468,47 @@ msgid "" - "proof. Currently possible keywords: • “scale-monitor-framebuffer” — makes " - "mutter default to layout logical monitors in a logical pixel coordinate " - "space, while scaling monitor framebuffers instead of window content, to " --"manage HiDPI monitors. Does not require a restart. • “remote-desktop” — " --"enables remote desktop support. To support remote desktop with screen " --"sharing, “screen-cast” must also be enabled. • “screen-cast” — enables " --"screen cast support." -+"manage HiDPI monitors. Does not require a restart. • “rt-scheduler” — makes " -+"mutter request a low priority real-time scheduling. The executable or user " -+"must have CAP_SYS_NICE. Requires a restart. • “autostart-xwayland” — " -+"initializes Xwayland lazily if there are X11 clients. Requires restart." -+msgstr "" -+ -+#: data/org.gnome.mutter.gschema.xml.in:134 -+msgid "Modifier to use to locate the pointer" -+msgstr "Modifikátor použitý na lokalizovanie ukazovateľa" -+ -+#: data/org.gnome.mutter.gschema.xml.in:135 -+msgid "This key will initiate the “locate pointer” action." -+msgstr "" -+ -+#: data/org.gnome.mutter.gschema.xml.in:142 -+msgid "Timeout for check-alive ping" -+msgstr "" -+ -+#: data/org.gnome.mutter.gschema.xml.in:143 -+msgid "" -+"Number of milliseconds a client has to respond to a ping request in order to " -+"not be detected as frozen. Using 0 will disable the alive check completely." - msgstr "" - - # summary --#: data/org.gnome.mutter.gschema.xml.in:145 -+#: data/org.gnome.mutter.gschema.xml.in:165 - msgid "Select window from tab popup" - msgstr "Vybrať okno z rozbaľovacej ponuky tabulátora" - - # summary --#: data/org.gnome.mutter.gschema.xml.in:150 -+#: data/org.gnome.mutter.gschema.xml.in:170 - msgid "Cancel tab popup" - msgstr "Zrušit rozbaľovaciu ponuku tabulátora" - - # PK: predpokladam ze to prepisane medzi tlacidlami - # description --#: data/org.gnome.mutter.gschema.xml.in:155 -+#: data/org.gnome.mutter.gschema.xml.in:175 - msgid "Switch monitor configurations" - msgstr "Prepnúť nastavenia monitorov" - --#: data/org.gnome.mutter.gschema.xml.in:160 -+#: data/org.gnome.mutter.gschema.xml.in:180 - msgid "Rotates the built-in monitor configuration" - msgstr "Otočí nastavenie vstavaného monitora" - -@@ -554,23 +572,27 @@ msgid "Re-enable shortcuts" - msgstr "Znovu povoliť klávesové skratky" - - #: data/org.gnome.mutter.wayland.gschema.xml.in:64 --msgid "Allow grabs with Xwayland" -+msgid "Allow X11 grabs to lock keyboard focus with Xwayland" - msgstr "" - - #: data/org.gnome.mutter.wayland.gschema.xml.in:65 - msgid "" --"Allow keyboard grabs issued by X11 applications running in Xwayland to be " --"taken into account. For a X11 grab to be taken into account under Wayland, " --"the client must also either send a specific X11 ClientMessage to the root " --"window or be among the applications white-listed in key “xwayland-grab-" --"access-rules”." -+"Allow all keyboard events to be routed to X11 “override redirect” windows " -+"with a grab when running in Xwayland. This option is to support X11 clients " -+"which map an “override redirect” window (which do not receive keyboard " -+"focus) and issue a keyboard grab to force all keyboard events to that " -+"window. This option is seldom used and has no effect on regular X11 windows " -+"which can receive keyboard focus under normal circumstances. For a X11 grab " -+"to be taken into account under Wayland, the client must also either send a " -+"specific X11 ClientMessage to the root window or be among the applications " -+"white-listed in key “xwayland-grab-access-rules”." - msgstr "" - --#: data/org.gnome.mutter.wayland.gschema.xml.in:77 -+#: data/org.gnome.mutter.wayland.gschema.xml.in:84 - msgid "Xwayland applications allowed to issue keyboard grabs" - msgstr "" - --#: data/org.gnome.mutter.wayland.gschema.xml.in:78 -+#: data/org.gnome.mutter.wayland.gschema.xml.in:85 - msgid "" - "List the resource names or resource class of X11 windows either allowed or " - "not allowed to issue X11 keyboard grabs under Xwayland. The resource name or " -@@ -587,7 +609,7 @@ msgstr "" - #. TRANSLATORS: This string refers to a button that switches between - #. * different modes. - #. --#: src/backends/meta-input-settings.c:2260 -+#: src/backends/meta-input-settings.c:2631 - #, c-format - msgid "Mode Switch (Group %d)" - msgstr "Prepínač režimu (skupina č. %d)" -@@ -597,53 +619,61 @@ msgstr "Prepínač režimu (skupina č. %d)" - #. TRANSLATORS: This string refers to an action, cycles drawing tablets' - #. * mapping through the available outputs. - #. --#: src/backends/meta-input-settings.c:2283 -+#: src/backends/meta-input-settings.c:2654 - msgid "Switch monitor" - msgstr "Prepnúť monitor" - --#: src/backends/meta-input-settings.c:2285 -+#: src/backends/meta-input-settings.c:2656 - msgid "Show on-screen help" - msgstr "Zobraziť pomocníka na obrazovke" - --#: src/backends/meta-monitor-manager.c:900 -+#: src/backends/meta-monitor.c:226 - msgid "Built-in display" - msgstr "Vstavaný displej" - --#: src/backends/meta-monitor-manager.c:923 -+#: src/backends/meta-monitor.c:255 - msgid "Unknown" - msgstr "Neznámy" - --#: src/backends/meta-monitor-manager.c:925 -+#: src/backends/meta-monitor.c:257 - msgid "Unknown Display" - msgstr "Neznámy displej" - --#. TRANSLATORS: this is a monitor vendor name, followed by a --#. * size in inches, like 'Dell 15"' --#. --#: src/backends/meta-monitor-manager.c:933 -+#: src/backends/meta-monitor.c:265 - #, c-format -+#| msgid "%s %s" -+msgctxt "" -+"This is a monitor vendor name, followed by a size in inches, like 'Dell 15\"'" - msgid "%s %s" - msgstr "%s %s" - -+#: src/backends/meta-monitor.c:273 -+#, c-format -+#| msgid "%s %s" -+msgctxt "" -+"This is a monitor vendor name followed by product/model name where size in " -+"inches could not be calculated, e.g. Dell U2414H" -+msgid "%s %s" -+msgstr "%s %s" -+ -+#. Translators: this string will appear in Sysprof -+#: src/backends/meta-profiler.c:79 -+msgid "Compositor" -+msgstr "Kompozítor" -+ - #. This probably means that a non-WM compositor like xcompmgr is running; - #. * we have no way to get it to exit --#: src/compositor/compositor.c:481 -+#: src/compositor/compositor.c:533 - #, c-format - msgid "" - "Another compositing manager is already running on screen %i on display “%s”." - msgstr "" - "Pre obrazovku č. %i na displeji „%s“ je spustený už iný správca rozloženia." - --#: src/core/bell.c:194 -+#: src/core/bell.c:192 - msgid "Bell event" - msgstr "Udalosť zvončeka" - --# X window system preloz, napr. system na spravu okien X --#: src/core/display.c:608 --#, c-format --msgid "Failed to open X Window System display “%s”\n" --msgstr "Zlyhalo otvorenie displeja systému na správu okien X „%s“\n" -- - # cmd desc - #: src/core/main.c:190 - msgid "Disable connection to session manager" -@@ -683,41 +713,45 @@ msgstr "Spustí ako kompozitor protokolu wayland" - msgid "Run as a nested compositor" - msgstr "Spustí ako kompozitor s vnoreným režimom" - --#: src/core/main.c:240 -+#: src/core/main.c:238 -+msgid "Run wayland compositor without starting Xwayland" -+msgstr "" -+ -+#: src/core/main.c:246 - msgid "Run as a full display server, rather than nested" - msgstr "Spustí ako plnohodnotný zobrazovací server, namiesto vnoreného režimu" - --#: src/core/main.c:246 -+#: src/core/main.c:252 - msgid "Run with X11 backend" - msgstr "Spustí s obslužným programom X11" - - # %s is a window title - #. Translators: %s is a window title --#: src/core/meta-close-dialog-default.c:147 -+#: src/core/meta-close-dialog-default.c:151 - #, c-format - msgid "“%s” is not responding." - msgstr "„%s“ neodpovedá." - --#: src/core/meta-close-dialog-default.c:149 -+#: src/core/meta-close-dialog-default.c:153 - msgid "Application is not responding." - msgstr "Aplikácia neodpovedá." - --#: src/core/meta-close-dialog-default.c:154 -+#: src/core/meta-close-dialog-default.c:158 - msgid "" - "You may choose to wait a short while for it to continue or force the " - "application to quit entirely." - msgstr "" - "Môžete chvíľu počkať na pokračovanie aplikácie, alebo ju môžete ukončiť." - --#: src/core/meta-close-dialog-default.c:161 -+#: src/core/meta-close-dialog-default.c:165 - msgid "_Force Quit" - msgstr "_Vynútiť ukončenie" - --#: src/core/meta-close-dialog-default.c:161 -+#: src/core/meta-close-dialog-default.c:165 - msgid "_Wait" - msgstr "_Počkať" - --#: src/core/mutter.c:39 -+#: src/core/mutter.c:38 - #, c-format - msgid "" - "mutter %s\n" -@@ -733,21 +767,30 @@ msgstr "" - "Záruka sa NEPOSKYTUJE; ani na PREDAJNOSŤ alebo VHODNOSŤ PRE URČITÝ ÚČEL.\n" - - # cmd desc --#: src/core/mutter.c:53 -+#: src/core/mutter.c:52 - msgid "Print version" - msgstr "Zobrazí verziu" - - # cmd desc --#: src/core/mutter.c:59 -+#: src/core/mutter.c:58 - msgid "Mutter plugin to use" - msgstr "Použije zásuvný modul Mutter" - --#: src/core/prefs.c:1997 -+#: src/core/prefs.c:1911 - #, c-format - msgid "Workspace %d" - msgstr "Pracovný priestor č. %d" - --#: src/core/screen.c:583 -+#: src/core/util.c:122 -+msgid "Mutter was compiled without support for verbose mode\n" -+msgstr "Mutter bol skompilovaný bez výpisu podrobností pri behu\n" -+ -+#: src/wayland/meta-wayland-tablet-pad.c:568 -+#, c-format -+msgid "Mode Switch: Mode %d" -+msgstr "Prepínač režimu: Režim č. %d" -+ -+#: src/x11/meta-x11-display.c:676 - #, c-format - msgid "" - "Display “%s” already has a window manager; try using the --replace option to " -@@ -756,21 +799,27 @@ msgstr "" - "Displej „%s“ už má správcu okien. Skúste použiť prepínač --replace, aby sa " - "aktuálny správca nahradil." - --#: src/core/screen.c:668 -+#: src/x11/meta-x11-display.c:1089 -+msgid "Failed to initialize GDK\n" -+msgstr "Zlyhala inicializácia GDK\n" -+ -+# X window system preloz, napr. system na spravu okien X -+#: src/x11/meta-x11-display.c:1113 -+#, c-format -+msgid "Failed to open X Window System display “%s”\n" -+msgstr "Zlyhalo otvorenie displeja systému na správu okien X „%s“\n" -+ -+#: src/x11/meta-x11-display.c:1196 - #, c-format - msgid "Screen %d on display “%s” is invalid\n" - msgstr "Obrazovka č. %d na displeji „%s“ nie je platná\n" - --#: src/core/util.c:120 --msgid "Mutter was compiled without support for verbose mode\n" --msgstr "Mutter bol skompilovaný bez výpisu podrobností pri behu\n" -- --#: src/wayland/meta-wayland-tablet-pad.c:563 -+#: src/x11/meta-x11-selection-input-stream.c:460 - #, c-format --msgid "Mode Switch: Mode %d" --msgstr "Prepínač režimu: Režim č. %d" -+msgid "Format %s not supported" -+msgstr "Formát %s nie je podporovaný" - --#: src/x11/session.c:1818 -+#: src/x11/session.c:1821 - msgid "" - "These windows do not support “save current setup” and will have to be " - "restarted manually next time you log in." -@@ -779,7 +828,7 @@ msgstr "" - "prihlásení ich budete musieť znovu spustiť ručne." - - # window title; wm_client_machine --#: src/x11/window-props.c:559 -+#: src/x11/window-props.c:569 - #, c-format - msgid "%s (on %s)" - msgstr "%s (na %s)" diff -Nru mutter-3.36.1/debian/patches/wayland-xdnd-Add-error-traps-around-Xdnd-IPC.patch mutter-3.36.2/debian/patches/wayland-xdnd-Add-error-traps-around-Xdnd-IPC.patch --- mutter-3.36.1/debian/patches/wayland-xdnd-Add-error-traps-around-Xdnd-IPC.patch 2020-04-16 20:04:59.000000000 +0000 +++ mutter-3.36.2/debian/patches/wayland-xdnd-Add-error-traps-around-Xdnd-IPC.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,105 +0,0 @@ -From: Carlos Garnacho -Date: Tue, 7 Apr 2020 19:16:16 +0200 -Subject: wayland/xdnd: Add error traps around Xdnd* IPC - -Make all of them spew criticals, except for XdndLeave as it's feasible -to expect the window we are sending the event to did disappear in the -way (eg. if the window is destroyed while the DnD operation is ongoing -and the pointer is over the window). - -Bug: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2590 -Forwarded: https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1184 -Origin: upstream, 3.36.2 ---- - src/wayland/meta-xwayland-dnd.c | 24 ++++++++++++++++++++++++ - 1 file changed, 24 insertions(+) - -diff --git a/src/wayland/meta-xwayland-dnd.c b/src/wayland/meta-xwayland-dnd.c -index 6b75362..ea81d71 100644 ---- a/src/wayland/meta-xwayland-dnd.c -+++ b/src/wayland/meta-xwayland-dnd.c -@@ -145,6 +145,8 @@ xdnd_send_enter (MetaXWaylandDnd *dnd, - gchar **p; - struct wl_array *source_mime_types; - -+ meta_x11_error_trap_push (x11_display); -+ - data_source = compositor->seat->data_device.dnd_data_source; - xev.xclient.type = ClientMessage; - xev.xclient.message_type = xdnd_atoms[ATOM_DND_ENTER]; -@@ -189,6 +191,9 @@ xdnd_send_enter (MetaXWaylandDnd *dnd, - } - - XSendEvent (xdisplay, dest, False, NoEventMask, &xev); -+ -+ if (meta_x11_error_trap_pop_with_return (x11_display) != Success) -+ g_critical ("Error sending XdndEnter"); - } - - static void -@@ -205,7 +210,9 @@ xdnd_send_leave (MetaXWaylandDnd *dnd, - xev.xclient.window = dest; - xev.xclient.data.l[0] = x11_display->selection.xwindow; - -+ meta_x11_error_trap_push (x11_display); - XSendEvent (xdisplay, dest, False, NoEventMask, &xev); -+ meta_x11_error_trap_pop (x11_display); - } - - static void -@@ -241,7 +248,11 @@ xdnd_send_position (MetaXWaylandDnd *dnd, - xev.xclient.data.l[3] = time; - xev.xclient.data.l[4] = action_to_atom (action); - -+ meta_x11_error_trap_push (x11_display); - XSendEvent (xdisplay, dest, False, NoEventMask, &xev); -+ -+ if (meta_x11_error_trap_pop_with_return (x11_display) != Success) -+ g_critical ("Error sending XdndPosition"); - } - - static void -@@ -261,7 +272,11 @@ xdnd_send_drop (MetaXWaylandDnd *dnd, - xev.xclient.data.l[0] = x11_display->selection.xwindow; - xev.xclient.data.l[2] = time; - -+ meta_x11_error_trap_push (x11_display); - XSendEvent (xdisplay, dest, False, NoEventMask, &xev); -+ -+ if (meta_x11_error_trap_pop_with_return (x11_display) != Success) -+ g_critical ("Error sending XdndDrop"); - } - - static void -@@ -289,7 +304,11 @@ xdnd_send_finished (MetaXWaylandDnd *dnd, - xev.xclient.data.l[2] = action_to_atom (action); - } - -+ meta_x11_error_trap_push (x11_display); - XSendEvent (xdisplay, dest, False, NoEventMask, &xev); -+ -+ if (meta_x11_error_trap_pop_with_return (x11_display) != Success) -+ g_critical ("Error sending XdndFinished"); - } - - static void -@@ -297,6 +316,7 @@ xdnd_send_status (MetaXWaylandDnd *dnd, - Window dest, - uint32_t action) - { -+ MetaX11Display *x11_display = meta_get_display ()->x11_display; - Display *xdisplay = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()); - XEvent xev = { 0 }; - -@@ -312,7 +332,11 @@ xdnd_send_status (MetaXWaylandDnd *dnd, - if (xev.xclient.data.l[4]) - xev.xclient.data.l[1] |= 1 << 0; /* Bit 1: dest accepts the drop */ - -+ meta_x11_error_trap_push (x11_display); - XSendEvent (xdisplay, dest, False, NoEventMask, &xev); -+ -+ if (meta_x11_error_trap_pop_with_return (x11_display) != Success) -+ g_critical ("Error sending Xdndstatus"); - } - - static void diff -Nru mutter-3.36.1/debian/patches/window-actor-Set-viewport-when-blitting-to-screencast-fb.patch mutter-3.36.2/debian/patches/window-actor-Set-viewport-when-blitting-to-screencast-fb.patch --- mutter-3.36.1/debian/patches/window-actor-Set-viewport-when-blitting-to-screencast-fb.patch 2020-04-16 20:04:59.000000000 +0000 +++ mutter-3.36.2/debian/patches/window-actor-Set-viewport-when-blitting-to-screencast-fb.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ -From: =?utf-8?q?Jonas_=C3=85dahl?= -Date: Fri, 3 Apr 2020 15:12:58 +0000 -Subject: window-actor: Set viewport when blitting to screencast fb - -This fixes an issue where a non-maximized screen casted window would be -stretched to fill the whole screen cast stream, instead of just the crop -that corresponds to the current window size. - -https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1174 - -(cherry picked from commit a6f94696e2e8ade9e800f3b37092a5f40e22cf38) - -Origin: upstream, 3.36.2, commit:7e94311e2eb78c5fbaf8df047bebc92bd501aeb8 ---- - src/compositor/meta-window-actor.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/src/compositor/meta-window-actor.c b/src/compositor/meta-window-actor.c -index 92355a9..31e0cb6 100644 ---- a/src/compositor/meta-window-actor.c -+++ b/src/compositor/meta-window-actor.c -@@ -1300,6 +1300,7 @@ meta_window_actor_blit_to_framebuffer (MetaScreenCastWindow *screen_cast_window, - cogl_color_init_from_4ub (&clear_color, 0, 0, 0, 0); - cogl_framebuffer_clear (framebuffer, COGL_BUFFER_BIT_COLOR, &clear_color); - cogl_framebuffer_orthographic (framebuffer, 0, 0, width, height, 0, 1.0); -+ cogl_framebuffer_set_viewport (framebuffer, 0, 0, width, height); - - meta_rectangle_scale_double (bounds, resource_scale, - META_ROUNDING_STRATEGY_GROW, diff -Nru mutter-3.36.1/debian/patches/window-Check-aliveness-a-bit-less-aggressively.patch mutter-3.36.2/debian/patches/window-Check-aliveness-a-bit-less-aggressively.patch --- mutter-3.36.1/debian/patches/window-Check-aliveness-a-bit-less-aggressively.patch 2020-04-16 20:04:59.000000000 +0000 +++ mutter-3.36.2/debian/patches/window-Check-aliveness-a-bit-less-aggressively.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,70 +0,0 @@ -From: =?utf-8?q?Jonas_=C3=85dahl?= -Date: Tue, 7 Apr 2020 08:39:10 +0000 -Subject: window: Check aliveness a bit less aggressively - -Currently we check whether a window is alive everytime it's focused. -This means that an application that doesn't respond to the check-alive -event during startup always showing the "application froze" dialog, -without the user ever trying to interact with it. - -An example where this tends to to happen is with games, and for this -particular scenario, it's purely an annoyance, as I never tried to -interact with the game window in the first place, so I don't care that -it's not responding - it's loading. - -To avoid these unnecessary particular "app-is-frozen" popups, remove the -alive check from the focus function, and instead move it back to the -"meta_window_activate_full()" call. To also trigger it slightly more -often, also add it to the path that triggers the window focus when a -user actively clicks on the window. - -This means that we currently check whether a window is alive on: - - * Any time the window is activated. This means e.g. alt-tab or - selecting the window in the overview. - * The user clicks on the window. - -Note that the second only works for an already focused window on -Wayland, as on X11, we don't refocus it. This particular case isn't -changed with this commit, as we didn't call meta_window_focus() to begin -with here. - -https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1182 - -(cherry picked from commit 8df3b21a51b0e8dcea4a4376426880e4f3c4f837) - -Origin: upstream, 3.36.2 ---- - src/core/window.c | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/src/core/window.c b/src/core/window.c -index 3356fc7..ea721f7 100644 ---- a/src/core/window.c -+++ b/src/core/window.c -@@ -3751,6 +3751,8 @@ meta_window_activate_full (MetaWindow *window, - meta_window_focus (window, timestamp); - else - meta_workspace_activate_with_focus (window->workspace, window, timestamp); -+ -+ meta_window_check_alive (window, timestamp); - } - - /* This function exists since most of the functionality in window_activate -@@ -4790,8 +4792,6 @@ meta_window_focus (MetaWindow *window, - return; - } - -- meta_window_check_alive (window, timestamp); -- - META_WINDOW_GET_CLASS (window)->focus (window, timestamp); - - if (window->display->event_route == META_EVENT_ROUTE_NORMAL) -@@ -8349,6 +8349,7 @@ meta_window_handle_ungrabbed_event (MetaWindow *window, - "Focusing %s due to button %u press (display.c)\n", - window->desc, button); - meta_window_focus (window, event->any.time); -+ meta_window_check_alive (window, event->any.time); - } - else - /* However, do allow terminals to lose focus due to new diff -Nru mutter-3.36.1/debian/patches/x11-Add-support-for-fractional-scaling-using-Randr.patch mutter-3.36.2/debian/patches/x11-Add-support-for-fractional-scaling-using-Randr.patch --- mutter-3.36.1/debian/patches/x11-Add-support-for-fractional-scaling-using-Randr.patch 2020-04-16 20:04:59.000000000 +0000 +++ mutter-3.36.2/debian/patches/x11-Add-support-for-fractional-scaling-using-Randr.patch 2020-05-07 01:22:16.000000000 +0000 @@ -12,12 +12,13 @@ data/org.gnome.mutter.gschema.xml.in | 4 + data/org.gnome.mutter.x11.gschema.xml.in | 30 ++ src/backends/meta-crtc.h | 1 + - src/backends/meta-monitor-config-manager.c | 141 +++++- + src/backends/meta-monitor-config-manager.c | 147 +++++- + src/backends/meta-monitor-config-manager.h | 1 + src/backends/meta-monitor-config-migration.c | 15 +- - src/backends/meta-monitor-config-store.c | 1 + + src/backends/meta-monitor-config-store.c | 17 + src/backends/meta-monitor-manager-dummy.c | 24 +- src/backends/meta-monitor-manager-private.h | 34 +- - src/backends/meta-monitor-manager.c | 362 +++++++++++++-- + src/backends/meta-monitor-manager.c | 382 ++++++++++++++-- src/backends/meta-monitor.c | 60 ++- src/backends/meta-monitor.h | 6 +- src/backends/meta-settings-private.h | 9 + @@ -38,7 +39,7 @@ src/core/window.c | 19 + src/org.gnome.Mutter.DisplayConfig.xml | 5 + src/tests/meta-monitor-manager-test.c | 13 +- - 30 files changed, 1652 insertions(+), 270 deletions(-) + 31 files changed, 1694 insertions(+), 271 deletions(-) create mode 100644 data/org.gnome.mutter.x11.gschema.xml.in create mode 100644 src/core/meta-selection-source-memory-pool-private.h create mode 100644 src/core/meta-selection-source-memory-pool.c @@ -125,12 +126,12 @@ MetaCrtcConfig *config; diff --git a/src/backends/meta-monitor-config-manager.c b/src/backends/meta-monitor-config-manager.c -index 6e31432..b70f2eb 100644 +index 6a7c807..f4f657b 100644 --- a/src/backends/meta-monitor-config-manager.c +++ b/src/backends/meta-monitor-config-manager.c -@@ -205,6 +205,18 @@ assign_monitor_crtc (MetaMonitor *monitor, - crtc_transform)) - crtc_transform = META_MONITOR_TRANSFORM_NORMAL; +@@ -208,6 +208,18 @@ assign_monitor_crtc (MetaMonitor *monitor, + else + crtc_hw_transform = META_MONITOR_TRANSFORM_NORMAL; + scale = data->logical_monitor_config->scale; + if (!meta_monitor_manager_is_scale_supported (data->monitor_manager, @@ -147,15 +148,24 @@ meta_monitor_calculate_crtc_pos (monitor, mode, output, crtc_transform, &crtc_x, &crtc_y); -@@ -244,6 +256,7 @@ assign_monitor_crtc (MetaMonitor *monitor, - .crtc = crtc, +@@ -222,6 +234,8 @@ assign_monitor_crtc (MetaMonitor *monitor, + case META_LOGICAL_MONITOR_LAYOUT_MODE_PHYSICAL: + scale = 1.0; + break; ++ case META_LOGICAL_MONITOR_LAYOUT_MODE_GLOBAL_UI_LOGICAL: ++ break; + } + + crtc_mode = monitor_crtc_mode->crtc_mode; +@@ -248,6 +262,7 @@ assign_monitor_crtc (MetaMonitor *monitor, .mode = crtc_mode, .layout = crtc_layout, + .transform = crtc_hw_transform, + .scale = scale, - .transform = crtc_transform, .outputs = g_ptr_array_new () }; -@@ -525,7 +538,11 @@ meta_monitor_config_manager_get_stored (MetaMonitorConfigManager *config_manager + g_ptr_array_add (crtc_info->outputs, output); +@@ -528,7 +543,11 @@ meta_monitor_config_manager_get_stored (MetaMonitorConfigManager *config_manager typedef enum _MonitorMatchRule { MONITOR_MATCH_ALL = 0, @@ -168,7 +178,7 @@ } MonitorMatchRule; static MetaMonitor * -@@ -659,11 +676,68 @@ get_monitor_transform (MetaMonitorManager *monitor_manager, +@@ -662,11 +681,68 @@ get_monitor_transform (MetaMonitorManager *monitor_manager, } } @@ -237,7 +247,7 @@ MetaLogicalMonitorConfig *primary_logical_monitor_config, MetaLogicalMonitorLayoutMode layout_mode) { -@@ -683,6 +757,7 @@ create_preferred_logical_monitor_config (MetaMonitorManager *monitor_ma +@@ -686,6 +762,7 @@ create_preferred_logical_monitor_config (MetaMonitorManager *monitor_ma scale = primary_logical_monitor_config->scale; else scale = meta_monitor_manager_calculate_monitor_mode_scale (monitor_manager, @@ -245,7 +255,7 @@ monitor, mode); -@@ -692,6 +767,13 @@ create_preferred_logical_monitor_config (MetaMonitorManager *monitor_ma +@@ -695,6 +772,13 @@ create_preferred_logical_monitor_config (MetaMonitorManager *monitor_ma width = (int) roundf (width / scale); height = (int) roundf (height / scale); break; @@ -259,7 +269,7 @@ case META_LOGICAL_MONITOR_LAYOUT_MODE_PHYSICAL: break; } -@@ -730,6 +812,7 @@ meta_monitor_config_manager_create_linear (MetaMonitorConfigManager *config_mana +@@ -733,6 +817,7 @@ meta_monitor_config_manager_create_linear (MetaMonitorConfigManager *config_mana MetaMonitor *primary_monitor; MetaLogicalMonitorLayoutMode layout_mode; MetaLogicalMonitorConfig *primary_logical_monitor_config; @@ -267,7 +277,7 @@ int x; GList *monitors; GList *l; -@@ -740,10 +823,16 @@ meta_monitor_config_manager_create_linear (MetaMonitorConfigManager *config_mana +@@ -743,10 +828,16 @@ meta_monitor_config_manager_create_linear (MetaMonitorConfigManager *config_mana layout_mode = meta_monitor_manager_get_default_layout_mode (monitor_manager); @@ -284,7 +294,7 @@ NULL, layout_mode); primary_logical_monitor_config->is_primary = TRUE; -@@ -768,6 +857,7 @@ meta_monitor_config_manager_create_linear (MetaMonitorConfigManager *config_mana +@@ -771,6 +862,7 @@ meta_monitor_config_manager_create_linear (MetaMonitorConfigManager *config_mana create_preferred_logical_monitor_config (monitor_manager, monitor, x, 0, @@ -292,7 +302,7 @@ primary_logical_monitor_config, layout_mode); logical_monitor_configs = g_list_append (logical_monitor_configs, -@@ -790,6 +880,7 @@ meta_monitor_config_manager_create_fallback (MetaMonitorConfigManager *config_ma +@@ -793,6 +885,7 @@ meta_monitor_config_manager_create_fallback (MetaMonitorConfigManager *config_ma GList *logical_monitor_configs; MetaLogicalMonitorLayoutMode layout_mode; MetaLogicalMonitorConfig *primary_logical_monitor_config; @@ -300,7 +310,7 @@ primary_monitor = find_primary_monitor (monitor_manager); if (!primary_monitor) -@@ -797,10 +888,16 @@ meta_monitor_config_manager_create_fallback (MetaMonitorConfigManager *config_ma +@@ -800,10 +893,16 @@ meta_monitor_config_manager_create_fallback (MetaMonitorConfigManager *config_ma layout_mode = meta_monitor_manager_get_default_layout_mode (monitor_manager); @@ -317,7 +327,7 @@ NULL, layout_mode); primary_logical_monitor_config->is_primary = TRUE; -@@ -823,6 +920,7 @@ meta_monitor_config_manager_create_suggested (MetaMonitorConfigManager *config_m +@@ -826,6 +925,7 @@ meta_monitor_config_manager_create_suggested (MetaMonitorConfigManager *config_m GList *logical_monitor_configs; GList *region; int x, y; @@ -325,7 +335,7 @@ GList *monitors; GList *l; -@@ -835,10 +933,16 @@ meta_monitor_config_manager_create_suggested (MetaMonitorConfigManager *config_m +@@ -838,10 +938,16 @@ meta_monitor_config_manager_create_suggested (MetaMonitorConfigManager *config_m layout_mode = meta_monitor_manager_get_default_layout_mode (monitor_manager); @@ -342,7 +352,7 @@ NULL, layout_mode); primary_logical_monitor_config->is_primary = TRUE; -@@ -862,6 +966,7 @@ meta_monitor_config_manager_create_suggested (MetaMonitorConfigManager *config_m +@@ -865,6 +971,7 @@ meta_monitor_config_manager_create_suggested (MetaMonitorConfigManager *config_m create_preferred_logical_monitor_config (monitor_manager, monitor, x, y, @@ -350,7 +360,7 @@ primary_logical_monitor_config, layout_mode); logical_monitor_configs = g_list_append (logical_monitor_configs, -@@ -880,6 +985,21 @@ meta_monitor_config_manager_create_suggested (MetaMonitorConfigManager *config_m +@@ -883,6 +990,21 @@ meta_monitor_config_manager_create_suggested (MetaMonitorConfigManager *config_m region = g_list_prepend (region, &logical_monitor_config->layout); } @@ -372,7 +382,7 @@ g_list_free (region); if (!logical_monitor_configs) -@@ -1134,7 +1254,9 @@ create_for_switch_config_all_mirror (MetaMonitorConfigManager *config_manager) +@@ -1137,7 +1259,9 @@ create_for_switch_config_all_mirror (MetaMonitorConfigManager *config_manager) if (!mode) continue; @@ -383,7 +393,7 @@ best_scale = MAX (best_scale, scale); monitor_configs = g_list_prepend (monitor_configs, create_monitor_config (monitor, mode)); } -@@ -1165,12 +1287,18 @@ create_for_switch_config_external (MetaMonitorConfigManager *config_manager) +@@ -1168,12 +1292,18 @@ create_for_switch_config_external (MetaMonitorConfigManager *config_manager) MetaMonitorManager *monitor_manager = config_manager->monitor_manager; GList *logical_monitor_configs = NULL; int x = 0; @@ -402,7 +412,7 @@ monitors = meta_monitor_manager_get_monitors (monitor_manager); for (l = monitors; l; l = l->next) { -@@ -1184,6 +1312,7 @@ create_for_switch_config_external (MetaMonitorConfigManager *config_manager) +@@ -1187,6 +1317,7 @@ create_for_switch_config_external (MetaMonitorConfigManager *config_manager) create_preferred_logical_monitor_config (monitor_manager, monitor, x, 0, @@ -410,7 +420,7 @@ NULL, layout_mode); logical_monitor_configs = g_list_append (logical_monitor_configs, -@@ -1209,6 +1338,7 @@ create_for_switch_config_builtin (MetaMonitorConfigManager *config_manager) +@@ -1212,6 +1343,7 @@ create_for_switch_config_builtin (MetaMonitorConfigManager *config_manager) GList *logical_monitor_configs; MetaLogicalMonitorConfig *primary_logical_monitor_config; MetaMonitor *monitor; @@ -418,7 +428,7 @@ monitor = meta_monitor_manager_get_laptop_panel (monitor_manager); if (!monitor) -@@ -1216,10 +1346,16 @@ create_for_switch_config_builtin (MetaMonitorConfigManager *config_manager) +@@ -1219,10 +1351,16 @@ create_for_switch_config_builtin (MetaMonitorConfigManager *config_manager) layout_mode = meta_monitor_manager_get_default_layout_mode (monitor_manager); @@ -435,14 +445,37 @@ NULL, layout_mode); primary_logical_monitor_config->is_primary = TRUE; -@@ -1660,6 +1796,7 @@ meta_verify_logical_monitor_config (MetaLogicalMonitorConfig *logical_monitor +@@ -1626,6 +1764,7 @@ gboolean + meta_verify_logical_monitor_config (MetaLogicalMonitorConfig *logical_monitor_config, + MetaLogicalMonitorLayoutMode layout_mode, + MetaMonitorManager *monitor_manager, ++ float max_scale, + GError **error) + { + GList *l; +@@ -1662,6 +1801,10 @@ meta_verify_logical_monitor_config (MetaLogicalMonitorConfig *logical_monitor + switch (layout_mode) { - case META_LOGICAL_MONITOR_LAYOUT_MODE_LOGICAL: + case META_LOGICAL_MONITOR_LAYOUT_MODE_GLOBAL_UI_LOGICAL: ++ expected_mode_width /= ceilf (max_scale); ++ expected_mode_height /= ceilf (max_scale); ++ /* fall through! */ + case META_LOGICAL_MONITOR_LAYOUT_MODE_LOGICAL: expected_mode_width = roundf (expected_mode_width * logical_monitor_config->scale); - expected_mode_height = roundf (expected_mode_height * +diff --git a/src/backends/meta-monitor-config-manager.h b/src/backends/meta-monitor-config-manager.h +index 3875e04..ebb6cc5 100644 +--- a/src/backends/meta-monitor-config-manager.h ++++ b/src/backends/meta-monitor-config-manager.h +@@ -191,6 +191,7 @@ META_EXPORT_TEST + gboolean meta_verify_logical_monitor_config (MetaLogicalMonitorConfig *logical_monitor_config, + MetaLogicalMonitorLayoutMode layout_mode, + MetaMonitorManager *monitor_manager, ++ float max_scale, + GError **error); + + META_EXPORT_TEST diff --git a/src/backends/meta-monitor-config-migration.c b/src/backends/meta-monitor-config-migration.c index d619dc4..69c426c 100644 --- a/src/backends/meta-monitor-config-migration.c @@ -486,17 +519,66 @@ if (!meta_verify_monitors_config (config, monitor_manager, error)) diff --git a/src/backends/meta-monitor-config-store.c b/src/backends/meta-monitor-config-store.c -index 770bef7..c8a0e9b 100644 +index 770bef7..16cfc13 100644 --- a/src/backends/meta-monitor-config-store.c +++ b/src/backends/meta-monitor-config-store.c -@@ -534,6 +534,7 @@ derive_logical_monitor_layout (MetaLogicalMonitorConfig *logical_monitor_conf +@@ -496,6 +496,7 @@ handle_start_element (GMarkupParseContext *context, + static gboolean + derive_logical_monitor_layout (MetaLogicalMonitorConfig *logical_monitor_config, + MetaLogicalMonitorLayoutMode layout_mode, ++ float max_scale, + GError **error) + { + MetaMonitorConfig *monitor_config; +@@ -533,6 +534,10 @@ derive_logical_monitor_layout (MetaLogicalMonitorConfig *logical_monitor_conf + switch (layout_mode) { - case META_LOGICAL_MONITOR_LAYOUT_MODE_LOGICAL: + case META_LOGICAL_MONITOR_LAYOUT_MODE_GLOBAL_UI_LOGICAL: ++ width *= ceilf (max_scale); ++ height *= ceilf (max_scale); ++ /* fall through! */ + case META_LOGICAL_MONITOR_LAYOUT_MODE_LOGICAL: width = roundf (width / logical_monitor_config->scale); height = roundf (height / logical_monitor_config->scale); - break; +@@ -740,6 +745,7 @@ handle_end_element (GMarkupParseContext *context, + GList *l; + MetaLogicalMonitorLayoutMode layout_mode; + MetaMonitorsConfigFlag config_flags = META_MONITORS_CONFIG_FLAG_NONE; ++ float max_scale = 1.0f; + + g_assert (g_str_equal (element_name, "configuration")); + +@@ -749,18 +755,29 @@ handle_end_element (GMarkupParseContext *context, + layout_mode = + meta_monitor_manager_get_default_layout_mode (store->monitor_manager); + ++ if (layout_mode == META_LOGICAL_MONITOR_LAYOUT_MODE_GLOBAL_UI_LOGICAL) ++ { ++ for (l = parser->current_logical_monitor_configs; l; l = l->next) ++ { ++ MetaLogicalMonitorConfig *logical_monitor_config = l->data; ++ max_scale = MAX (max_scale, logical_monitor_config->scale); ++ } ++ } ++ + for (l = parser->current_logical_monitor_configs; l; l = l->next) + { + MetaLogicalMonitorConfig *logical_monitor_config = l->data; + + if (!derive_logical_monitor_layout (logical_monitor_config, + layout_mode, ++ max_scale, + error)) + return; + + if (!meta_verify_logical_monitor_config (logical_monitor_config, + layout_mode, + store->monitor_manager, ++ max_scale, + error)) + return; + } diff --git a/src/backends/meta-monitor-manager-dummy.c b/src/backends/meta-monitor-manager-dummy.c index 2ddd826..fc29b45 100644 --- a/src/backends/meta-monitor-manager-dummy.c @@ -669,7 +751,7 @@ meta_monitor_manager_get_capabilities (MetaMonitorManager *manager); diff --git a/src/backends/meta-monitor-manager.c b/src/backends/meta-monitor-manager.c -index 3505573..7c77020 100644 +index 3505573..7c3eb8a 100644 --- a/src/backends/meta-monitor-manager.c +++ b/src/backends/meta-monitor-manager.c @@ -111,8 +111,18 @@ static gboolean @@ -791,14 +873,14 @@ + scale)) + return scale; + } -+ + +- if (!monitor) +- return 1.0; + for (l = manager->monitors; l; l = l->next) + { + MetaMonitor *other_monitor = l->data; + float monitor_scale; - -- if (!monitor) -- return 1.0; ++ + if (other_monitor == monitor || !meta_monitor_is_active (other_monitor)) + continue; @@ -1149,7 +1231,20 @@ width = roundf (width / scale); height = roundf (height / scale); break; -@@ -1918,6 +2176,7 @@ is_valid_layout_mode (MetaLogicalMonitorLayoutMode layout_mode) +@@ -1895,9 +2153,11 @@ create_logical_monitor_config_from_variant (MetaMonitorManager *manager + .monitor_configs = monitor_configs + }; + +- if (!meta_verify_logical_monitor_config (logical_monitor_config, ++ if (layout_mode != META_LOGICAL_MONITOR_LAYOUT_MODE_GLOBAL_UI_LOGICAL && ++ !meta_verify_logical_monitor_config (logical_monitor_config, + layout_mode, + manager, ++ 1.0f, + error)) + { + meta_logical_monitor_config_free (logical_monitor_config); +@@ -1918,6 +2178,7 @@ is_valid_layout_mode (MetaLogicalMonitorLayoutMode layout_mode) { case META_LOGICAL_MONITOR_LAYOUT_MODE_LOGICAL: case META_LOGICAL_MONITOR_LAYOUT_MODE_PHYSICAL: @@ -1157,7 +1252,7 @@ return TRUE; } -@@ -1940,6 +2199,7 @@ meta_monitor_manager_handle_apply_monitors_config (MetaDBusDisplayConfig *skelet +@@ -1940,6 +2201,7 @@ meta_monitor_manager_handle_apply_monitors_config (MetaDBusDisplayConfig *skelet MetaMonitorsConfig *config; GList *logical_monitor_configs = NULL; GError *error = NULL; @@ -1165,7 +1260,7 @@ if (serial != manager->serial) { -@@ -2011,10 +2271,26 @@ meta_monitor_manager_handle_apply_monitors_config (MetaDBusDisplayConfig *skelet +@@ -2011,10 +2273,42 @@ meta_monitor_manager_handle_apply_monitors_config (MetaDBusDisplayConfig *skelet return TRUE; } @@ -1182,17 +1277,33 @@ + for (l = logical_monitor_configs; l; l = l->next) + { + MetaLogicalMonitorConfig *logical_monitor_config = l->data; ++ + logical_monitor_config->layout.width = + roundf (logical_monitor_config->layout.width * ui_scale); + logical_monitor_config->layout.height = + roundf (logical_monitor_config->layout.height * ui_scale); ++ ++ if (!meta_verify_logical_monitor_config (logical_monitor_config, ++ manager->layout_mode, ++ manager, ++ ui_scale, ++ &error)) ++ { ++ g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, ++ G_DBUS_ERROR_INVALID_ARGS, ++ "%s", error->message); ++ g_error_free (error); ++ g_list_free_full (logical_monitor_configs, ++ (GDestroyNotify) meta_logical_monitor_config_free); ++ return TRUE; ++ } + } + } + config = meta_monitors_config_new (manager, logical_monitor_configs, layout_mode, -@@ -2452,12 +2728,6 @@ meta_monitor_manager_get_laptop_panel (MetaMonitorManager *manager) +@@ -2452,12 +2746,6 @@ meta_monitor_manager_get_laptop_panel (MetaMonitorManager *manager) return find_monitor (manager, meta_monitor_is_laptop_panel); } @@ -1205,7 +1316,7 @@ MetaMonitor * meta_monitor_manager_get_monitor_from_connector (MetaMonitorManager *manager, const char *connector) -@@ -2633,6 +2903,10 @@ rebuild_monitors (MetaMonitorManager *manager) +@@ -2633,6 +2921,10 @@ rebuild_monitors (MetaMonitorManager *manager) { GList *gpus; GList *l; @@ -1216,7 +1327,7 @@ if (manager->monitors) { -@@ -2650,7 +2924,7 @@ rebuild_monitors (MetaMonitorManager *manager) +@@ -2650,7 +2942,7 @@ rebuild_monitors (MetaMonitorManager *manager) { MetaOutput *output = k->data; @@ -1225,7 +1336,7 @@ { if (is_main_tiled_monitor_output (output)) { -@@ -2856,7 +3130,7 @@ meta_monitor_manager_update_logical_state_derived (MetaMonitorManager *manager, +@@ -2856,7 +3148,7 @@ meta_monitor_manager_update_logical_state_derived (MetaMonitorManager *manager, else manager->current_switch_config = META_MONITOR_SWITCH_CONFIG_UNKNOWN; @@ -1234,7 +1345,7 @@ meta_monitor_manager_rebuild_logical_monitors_derived (manager, config); } -@@ -2865,10 +3139,14 @@ void +@@ -2865,10 +3157,14 @@ void meta_monitor_manager_rebuild_derived (MetaMonitorManager *manager, MetaMonitorsConfig *config) { @@ -1250,7 +1361,7 @@ return; diff --git a/src/backends/meta-monitor.c b/src/backends/meta-monitor.c -index f4d71f0..a643728 100644 +index 07857e0..bd6da5c 100644 --- a/src/backends/meta-monitor.c +++ b/src/backends/meta-monitor.c @@ -703,8 +703,11 @@ meta_monitor_normal_get_suggested_position (MetaMonitor *monitor, @@ -1973,7 +2084,7 @@ int *max_width, int *max_height); diff --git a/src/backends/x11/meta-monitor-manager-xrandr.c b/src/backends/x11/meta-monitor-manager-xrandr.c -index 5c16189..da3225f 100644 +index 5c16189..189a9b7 100644 --- a/src/backends/x11/meta-monitor-manager-xrandr.c +++ b/src/backends/x11/meta-monitor-manager-xrandr.c @@ -63,6 +63,9 @@ @@ -2626,7 +2737,7 @@ meta_monitor_manager_xrandr_get_capabilities (MetaMonitorManager *manager) { - return META_MONITOR_MANAGER_CAPABILITY_GLOBAL_SCALE_REQUIRED; -+ MetaMonitorManagerCapability capabilities; ++ MetaMonitorManagerCapability capabilities = 0; + MetaMonitorManagerXrandr *xrandr_manager = META_MONITOR_MANAGER_XRANDR (manager); + MetaBackend *backend = meta_monitor_manager_get_backend (manager); + MetaSettings *settings = meta_backend_get_settings (backend); @@ -2635,7 +2746,7 @@ + capabilities |= META_MONITOR_MANAGER_CAPABILITY_TILING; + + if (meta_settings_is_experimental_feature_enabled (settings, -+ META_EXPERIMENTAL_FEATURE_X11_RANDR_FRACTIONAL_SCALING) && ++ META_EXPERIMENTAL_FEATURE_X11_RANDR_FRACTIONAL_SCALING) && + xrandr_manager->randr_version >= RANDR_TRANSFORM_MIN_VERSION) + { + capabilities |= META_MONITOR_MANAGER_CAPABILITY_NATIVE_OUTPUT_SCALING | diff -Nru mutter-3.36.1/debian/patches/x11-fix-compilation-if-libwacom-false.patch mutter-3.36.2/debian/patches/x11-fix-compilation-if-libwacom-false.patch --- mutter-3.36.1/debian/patches/x11-fix-compilation-if-libwacom-false.patch 2020-04-16 20:04:59.000000000 +0000 +++ mutter-3.36.2/debian/patches/x11-fix-compilation-if-libwacom-false.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,28 +0,0 @@ -From: Christian Rauch -Date: Tue, 31 Mar 2020 20:28:44 +0000 -Subject: x11: fix compilation if 'libwacom=false' - -https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1168 - -(cherry picked from commit a8f6cada883eda2a34e6478a53e2fb7c392d98b7) - -Origin: upstream, 3.36.2, commit:7baabc7ed0105dbf457fffe48250919849623254 ---- - src/backends/x11/meta-input-device-x11.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/backends/x11/meta-input-device-x11.c b/src/backends/x11/meta-input-device-x11.c -index 480acd8..2406c34 100644 ---- a/src/backends/x11/meta-input-device-x11.c -+++ b/src/backends/x11/meta-input-device-x11.c -@@ -122,9 +122,9 @@ meta_input_device_x11_is_grouped (ClutterInputDevice *device, - static void - meta_input_device_x11_finalize (GObject *object) - { --#ifdef HAVE_LIBWACOM - MetaInputDeviceX11 *device_xi2 = META_INPUT_DEVICE_X11 (object); - -+#ifdef HAVE_LIBWACOM - if (device_xi2->group_modes) - g_array_unref (device_xi2->group_modes); - #endif diff -Nru mutter-3.36.1/debian/rules mutter-3.36.2/debian/rules --- mutter-3.36.1/debian/rules 2020-04-17 01:07:54.000000000 +0000 +++ mutter-3.36.2/debian/rules 2020-05-07 01:22:16.000000000 +0000 @@ -106,6 +106,3 @@ override_dh_shlibdeps: dh_shlibdeps -Llibmutter-6-0 -l/usr/lib/$(DEB_HOST_MULTIARCH)/mutter-6 - -override_dh_strip: - dh_strip --dbgsym-migration='mutter-dbg (<< 3.18.3-2~)' diff -Nru mutter-3.36.1/debian/watch mutter-3.36.2/debian/watch --- mutter-3.36.1/debian/watch 2020-04-16 20:04:59.000000000 +0000 +++ mutter-3.36.2/debian/watch 2020-05-07 01:22:16.000000000 +0000 @@ -1,3 +1,3 @@ version=4 -https://download.gnome.org/sources/@PACKAGE@/([\d\.]+)/ \ - @PACKAGE@@ANY_VERSION@@ARCHIVE_EXT@ +https://download.gnome.org/sources/@PACKAGE@/([\d\.]+[02468])/ \ + @PACKAGE@@ANY_VERSION@\.tar\.xz diff -Nru mutter-3.36.1/meson.build mutter-3.36.2/meson.build --- mutter-3.36.1/meson.build 2020-03-30 19:29:39.159888300 +0000 +++ mutter-3.36.2/meson.build 2020-04-29 20:22:32.356452700 +0000 @@ -1,5 +1,5 @@ project('mutter', 'c', - version: '3.36.1', + version: '3.36.2', meson_version: '>= 0.50.0', license: 'GPLv2+' ) diff -Nru mutter-3.36.1/NEWS mutter-3.36.2/NEWS --- mutter-3.36.1/NEWS 2020-03-30 19:29:39.044891000 +0000 +++ mutter-3.36.2/NEWS 2020-04-29 20:22:32.263455400 +0000 @@ -1,3 +1,30 @@ +3.36.2 +====== +* Sync timelines to hardware vsync [Daniel; !724] +* Fix screencasting non-maximized windows [Jonas; !1174] +* Make window-aliveness checks less aggressive [Jonas; !1182] +* Fix stylus coordinates when using screen rotation [Jonas T.; #1118] +* Preserve keyboard state on VT switch [Olivier; !1185] +* Fix trackball button scrolling [Phillip; #1120] +* Fix tiled monitor support [Jonas Å.; !1199] +* Fix various clipboard issues [Carlos; !1198, !1203, !1204, !1186, !1206] +* Synchronize shadows to server-side decorations [Olivier; !1214] +* Fix overview key on X11 when using multiple keyboard layouts [Olivier; !1219] +* Fix capturing with multiple stage views [Jonas Å.; !1222] +* Fixed crashes [Jonas D., Carlos; !1173, !1183] +* Misc. bug fixes and cleanups [Andre, Georges, Simon, Christian, Carlos, Marco, + Pekka, Laurent, Jonas D.; !1169, !1170, !1172, !1168, !1184, !1200, !1209, + #1074, !1208] + +Contributors: + Marco Trevisan (Treviño), Laurent Bigonville, Jonas Dreßler, Olivier Fourdan, + Carlos Garnacho, Andre Moreira Magalhaes, Simon McVittie, + Georges Basile Stavracas Neto, Pekka Paalanen, Christian Rauch, Jonas Troeger, + Daniel van Vugt, Phillip Wood, Jonas Ådahl + +Translators: + Dušan Kazik [sk], Christian Kirbach [de] + 3.36.1 ====== * Fix hardware cursor on GPU hotplpug [Pekka; !1097] diff -Nru mutter-3.36.1/po/de.po mutter-3.36.2/po/de.po --- mutter-3.36.1/po/de.po 2020-03-30 19:29:39.186887700 +0000 +++ mutter-3.36.2/po/de.po 2020-04-29 20:22:32.368452500 +0000 @@ -13,8 +13,8 @@ msgstr "" "Project-Id-Version: mutter master\n" "Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/mutter/issues\n" -"POT-Creation-Date: 2019-08-06 00:49+0000\n" -"PO-Revision-Date: 2019-09-05 23:42+0200\n" +"POT-Creation-Date: 2020-03-30 20:11+0000\n" +"PO-Revision-Date: 2020-04-06 23:13+0200\n" "Last-Translator: Christian Kirbach \n" "Language-Team: Deutsch \n" "Language: de\n" @@ -22,7 +22,7 @@ "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Generator: Poedit 2.2.1\n" +"X-Generator: Poedit 2.3\n" #: data/50-mutter-navigation.xml:6 msgid "Navigation" @@ -435,20 +435,33 @@ msgid "This key will initiate the “locate pointer” action." msgstr "Diese Taste wird die Aktion »Zeiger finden« auslösen." -#: data/org.gnome.mutter.gschema.xml.in:155 +#: data/org.gnome.mutter.gschema.xml.in:142 +msgid "Timeout for check-alive ping" +msgstr "Reaktionsschwellwert bei Kontaktkontrolle" + +#: data/org.gnome.mutter.gschema.xml.in:143 +msgid "" +"Number of milliseconds a client has to respond to a ping request in order to " +"not be detected as frozen. Using 0 will disable the alive check completely." +msgstr "" +"Zeit in Millisekunden, innerhalb welcher ein Client auf eine " +"Kontaktkontrolle antworten muss, um nicht als abgestürzt zu gelten. »0« " +"bedeutet, dass die Kontaktkontrolle ausgeschaltet wird." + +#: data/org.gnome.mutter.gschema.xml.in:165 msgid "Select window from tab popup" msgstr "Fenster aus Tab-Anzeige auswählen" -#: data/org.gnome.mutter.gschema.xml.in:160 +#: data/org.gnome.mutter.gschema.xml.in:170 msgid "Cancel tab popup" msgstr "Tab-Anzeige abbrechen" -#: data/org.gnome.mutter.gschema.xml.in:165 +#: data/org.gnome.mutter.gschema.xml.in:175 msgid "Switch monitor configurations" msgstr "Bildschirmkonfigurationen wechseln" # Ich denke nicht, dass »rotate« hier die Bildschirmdrehung meint, sondern eher eine Liste aus Konfigurationen rotiert (d.h. umgewälzt) wird. -#: data/org.gnome.mutter.gschema.xml.in:170 +#: data/org.gnome.mutter.gschema.xml.in:180 msgid "Rotates the built-in monitor configuration" msgstr "Wechselt die Konfiguration des eingebauten Bildschirms" @@ -569,7 +582,7 @@ #. TRANSLATORS: This string refers to a button that switches between #. * different modes. #. -#: src/backends/meta-input-settings.c:2531 +#: src/backends/meta-input-settings.c:2631 #, c-format msgid "Mode Switch (Group %d)" msgstr "Moduswechsel (Gruppe %d)" @@ -577,34 +590,34 @@ #. TRANSLATORS: This string refers to an action, cycles drawing tablets' #. * mapping through the available outputs. #. -#: src/backends/meta-input-settings.c:2554 +#: src/backends/meta-input-settings.c:2654 msgid "Switch monitor" msgstr "Bildschirm wechseln" -#: src/backends/meta-input-settings.c:2556 +#: src/backends/meta-input-settings.c:2656 msgid "Show on-screen help" msgstr "Bildschirmhilfe anzeigen" -#: src/backends/meta-monitor.c:223 +#: src/backends/meta-monitor.c:226 msgid "Built-in display" msgstr "Eingebaute Anzeige" -#: src/backends/meta-monitor.c:252 +#: src/backends/meta-monitor.c:255 msgid "Unknown" msgstr "Unbekannt" -#: src/backends/meta-monitor.c:254 +#: src/backends/meta-monitor.c:257 msgid "Unknown Display" msgstr "Unbekannte Anzeige" -#: src/backends/meta-monitor.c:262 +#: src/backends/meta-monitor.c:265 #, c-format msgctxt "" "This is a monitor vendor name, followed by a size in inches, like 'Dell 15\"'" msgid "%s %s" msgstr "%s %s" -#: src/backends/meta-monitor.c:270 +#: src/backends/meta-monitor.c:273 #, c-format msgctxt "" "This is a monitor vendor name followed by product/model name where size in " @@ -614,13 +627,13 @@ # https://de.wikipedia.org/wiki/Composition-Manager #. Translators: this string will appear in Sysprof -#: src/backends/meta-profiler.c:82 +#: src/backends/meta-profiler.c:79 msgid "Compositor" msgstr "Compositor" #. This probably means that a non-WM compositor like xcompmgr is running; #. * we have no way to get it to exit -#: src/compositor/compositor.c:510 +#: src/compositor/compositor.c:533 #, c-format msgid "" "Another compositing manager is already running on screen %i on display “%s”." @@ -632,47 +645,47 @@ msgid "Bell event" msgstr "Klangereignis" -#: src/core/main.c:185 +#: src/core/main.c:190 msgid "Disable connection to session manager" msgstr "Verbindung zur Sitzungsverwaltung deaktivieren" -#: src/core/main.c:191 +#: src/core/main.c:196 msgid "Replace the running window manager" msgstr "Den aktuellen Fensterverwalter ersetzen" -#: src/core/main.c:197 +#: src/core/main.c:202 msgid "Specify session management ID" msgstr "Kennung der Sitzungsverwaltung angeben" -#: src/core/main.c:202 +#: src/core/main.c:207 msgid "X Display to use" msgstr "Zu verwendende X-Anzeige" -#: src/core/main.c:208 +#: src/core/main.c:213 msgid "Initialize session from savefile" msgstr "Sitzung anhand gespeicherter Datei starten" -#: src/core/main.c:214 +#: src/core/main.c:219 msgid "Make X calls synchronous" msgstr "X-Aufrufe abgleichen" -#: src/core/main.c:221 +#: src/core/main.c:226 msgid "Run as a wayland compositor" msgstr "Als Wayland-Compositor ausführen" -#: src/core/main.c:227 +#: src/core/main.c:232 msgid "Run as a nested compositor" msgstr "Als eingebetteten Compositor ausführen" -#: src/core/main.c:233 +#: src/core/main.c:238 msgid "Run wayland compositor without starting Xwayland" msgstr "Wayland-Compositor ausführen, ohne Xwayland zu starten" -#: src/core/main.c:241 +#: src/core/main.c:246 msgid "Run as a full display server, rather than nested" msgstr "Als vollwertigen Display-Server verwenden (nicht eingebettet)" -#: src/core/main.c:247 +#: src/core/main.c:252 msgid "Run with X11 backend" msgstr "Mit X11-Backend ausführen" @@ -728,21 +741,21 @@ msgid "Mutter plugin to use" msgstr "Zu benutzendes Mutter-Plugin" -#: src/core/prefs.c:1849 +#: src/core/prefs.c:1911 #, c-format msgid "Workspace %d" msgstr "Arbeitsfläche %d" -#: src/core/util.c:121 +#: src/core/util.c:122 msgid "Mutter was compiled without support for verbose mode\n" msgstr "Mutter wurde ohne Unterstützung für den redseligen Modus kompiliert\n" -#: src/wayland/meta-wayland-tablet-pad.c:567 +#: src/wayland/meta-wayland-tablet-pad.c:568 #, c-format msgid "Mode Switch: Mode %d" msgstr "Moduswechsel: Modus %d" -#: src/x11/meta-x11-display.c:671 +#: src/x11/meta-x11-display.c:676 #, c-format msgid "" "Display “%s” already has a window manager; try using the --replace option to " @@ -751,21 +764,21 @@ "Bildschirm »%s« hat bereits einen Fensterverwalter. Versuchen Sie die Option " "»--replace«, um den aktuellen Fensterverwalter zu ersetzen." -#: src/x11/meta-x11-display.c:1032 +#: src/x11/meta-x11-display.c:1089 msgid "Failed to initialize GDK\n" msgstr "GDK konnte nicht initialisiert werden\n" -#: src/x11/meta-x11-display.c:1056 +#: src/x11/meta-x11-display.c:1113 #, c-format msgid "Failed to open X Window System display “%s”\n" msgstr "X-Window-Systemanzeige »%s« konnte nicht geöffnet werden\n" -#: src/x11/meta-x11-display.c:1140 +#: src/x11/meta-x11-display.c:1196 #, c-format msgid "Screen %d on display “%s” is invalid\n" msgstr "Bildschirm %d auf Anzeige »%s« ist ungültig\n" -#: src/x11/meta-x11-selection-input-stream.c:445 +#: src/x11/meta-x11-selection-input-stream.c:460 #, c-format msgid "Format %s not supported" msgstr "Format %s wird nicht unterstützt" diff -Nru mutter-3.36.1/po/sk.po mutter-3.36.2/po/sk.po --- mutter-3.36.1/po/sk.po 2020-03-30 19:29:39.246886300 +0000 +++ mutter-3.36.2/po/sk.po 2020-04-29 20:22:32.399451500 +0000 @@ -13,8 +13,8 @@ msgstr "" "Project-Id-Version: mutter\n" "Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/mutter/issues\n" -"POT-Creation-Date: 2018-02-06 04:14+0000\n" -"PO-Revision-Date: 2018-03-17 21:52+0100\n" +"POT-Creation-Date: 2020-03-30 20:11+0000\n" +"PO-Revision-Date: 2020-04-05 22:21+0200\n" "Last-Translator: Dušan Kazik \n" "Language-Team: Slovak \n" "Language: sk\n" @@ -22,7 +22,7 @@ "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n==1) ? 1 : (n>=2 && n<=4) ? 2 : 0;\n" -"X-Generator: Poedit 2.0.6\n" +"X-Generator: Poedit 2.3\n" #: data/50-mutter-navigation.xml:6 msgid "Navigation" @@ -468,29 +468,47 @@ "proof. Currently possible keywords: • “scale-monitor-framebuffer” — makes " "mutter default to layout logical monitors in a logical pixel coordinate " "space, while scaling monitor framebuffers instead of window content, to " -"manage HiDPI monitors. Does not require a restart. • “remote-desktop” — " -"enables remote desktop support. To support remote desktop with screen " -"sharing, “screen-cast” must also be enabled. • “screen-cast” — enables " -"screen cast support." +"manage HiDPI monitors. Does not require a restart. • “rt-scheduler” — makes " +"mutter request a low priority real-time scheduling. The executable or user " +"must have CAP_SYS_NICE. Requires a restart. • “autostart-xwayland” — " +"initializes Xwayland lazily if there are X11 clients. Requires restart." +msgstr "" + +#: data/org.gnome.mutter.gschema.xml.in:134 +msgid "Modifier to use to locate the pointer" +msgstr "Modifikátor použitý na lokalizovanie ukazovateľa" + +#: data/org.gnome.mutter.gschema.xml.in:135 +msgid "This key will initiate the “locate pointer” action." +msgstr "" + +#: data/org.gnome.mutter.gschema.xml.in:142 +msgid "Timeout for check-alive ping" +msgstr "" + +#: data/org.gnome.mutter.gschema.xml.in:143 +msgid "" +"Number of milliseconds a client has to respond to a ping request in order to " +"not be detected as frozen. Using 0 will disable the alive check completely." msgstr "" # summary -#: data/org.gnome.mutter.gschema.xml.in:145 +#: data/org.gnome.mutter.gschema.xml.in:165 msgid "Select window from tab popup" msgstr "Vybrať okno z rozbaľovacej ponuky tabulátora" # summary -#: data/org.gnome.mutter.gschema.xml.in:150 +#: data/org.gnome.mutter.gschema.xml.in:170 msgid "Cancel tab popup" msgstr "Zrušit rozbaľovaciu ponuku tabulátora" # PK: predpokladam ze to prepisane medzi tlacidlami # description -#: data/org.gnome.mutter.gschema.xml.in:155 +#: data/org.gnome.mutter.gschema.xml.in:175 msgid "Switch monitor configurations" msgstr "Prepnúť nastavenia monitorov" -#: data/org.gnome.mutter.gschema.xml.in:160 +#: data/org.gnome.mutter.gschema.xml.in:180 msgid "Rotates the built-in monitor configuration" msgstr "Otočí nastavenie vstavaného monitora" @@ -554,23 +572,27 @@ msgstr "Znovu povoliť klávesové skratky" #: data/org.gnome.mutter.wayland.gschema.xml.in:64 -msgid "Allow grabs with Xwayland" +msgid "Allow X11 grabs to lock keyboard focus with Xwayland" msgstr "" #: data/org.gnome.mutter.wayland.gschema.xml.in:65 msgid "" -"Allow keyboard grabs issued by X11 applications running in Xwayland to be " -"taken into account. For a X11 grab to be taken into account under Wayland, " -"the client must also either send a specific X11 ClientMessage to the root " -"window or be among the applications white-listed in key “xwayland-grab-" -"access-rules”." +"Allow all keyboard events to be routed to X11 “override redirect” windows " +"with a grab when running in Xwayland. This option is to support X11 clients " +"which map an “override redirect” window (which do not receive keyboard " +"focus) and issue a keyboard grab to force all keyboard events to that " +"window. This option is seldom used and has no effect on regular X11 windows " +"which can receive keyboard focus under normal circumstances. For a X11 grab " +"to be taken into account under Wayland, the client must also either send a " +"specific X11 ClientMessage to the root window or be among the applications " +"white-listed in key “xwayland-grab-access-rules”." msgstr "" -#: data/org.gnome.mutter.wayland.gschema.xml.in:77 +#: data/org.gnome.mutter.wayland.gschema.xml.in:84 msgid "Xwayland applications allowed to issue keyboard grabs" msgstr "" -#: data/org.gnome.mutter.wayland.gschema.xml.in:78 +#: data/org.gnome.mutter.wayland.gschema.xml.in:85 msgid "" "List the resource names or resource class of X11 windows either allowed or " "not allowed to issue X11 keyboard grabs under Xwayland. The resource name or " @@ -587,7 +609,7 @@ #. TRANSLATORS: This string refers to a button that switches between #. * different modes. #. -#: src/backends/meta-input-settings.c:2260 +#: src/backends/meta-input-settings.c:2631 #, c-format msgid "Mode Switch (Group %d)" msgstr "Prepínač režimu (skupina č. %d)" @@ -597,53 +619,61 @@ #. TRANSLATORS: This string refers to an action, cycles drawing tablets' #. * mapping through the available outputs. #. -#: src/backends/meta-input-settings.c:2283 +#: src/backends/meta-input-settings.c:2654 msgid "Switch monitor" msgstr "Prepnúť monitor" -#: src/backends/meta-input-settings.c:2285 +#: src/backends/meta-input-settings.c:2656 msgid "Show on-screen help" msgstr "Zobraziť pomocníka na obrazovke" -#: src/backends/meta-monitor-manager.c:900 +#: src/backends/meta-monitor.c:226 msgid "Built-in display" msgstr "Vstavaný displej" -#: src/backends/meta-monitor-manager.c:923 +#: src/backends/meta-monitor.c:255 msgid "Unknown" msgstr "Neznámy" -#: src/backends/meta-monitor-manager.c:925 +#: src/backends/meta-monitor.c:257 msgid "Unknown Display" msgstr "Neznámy displej" -#. TRANSLATORS: this is a monitor vendor name, followed by a -#. * size in inches, like 'Dell 15"' -#. -#: src/backends/meta-monitor-manager.c:933 +#: src/backends/meta-monitor.c:265 #, c-format +#| msgid "%s %s" +msgctxt "" +"This is a monitor vendor name, followed by a size in inches, like 'Dell 15\"'" msgid "%s %s" msgstr "%s %s" +#: src/backends/meta-monitor.c:273 +#, c-format +#| msgid "%s %s" +msgctxt "" +"This is a monitor vendor name followed by product/model name where size in " +"inches could not be calculated, e.g. Dell U2414H" +msgid "%s %s" +msgstr "%s %s" + +#. Translators: this string will appear in Sysprof +#: src/backends/meta-profiler.c:79 +msgid "Compositor" +msgstr "Kompozítor" + #. This probably means that a non-WM compositor like xcompmgr is running; #. * we have no way to get it to exit -#: src/compositor/compositor.c:481 +#: src/compositor/compositor.c:533 #, c-format msgid "" "Another compositing manager is already running on screen %i on display “%s”." msgstr "" "Pre obrazovku č. %i na displeji „%s“ je spustený už iný správca rozloženia." -#: src/core/bell.c:194 +#: src/core/bell.c:192 msgid "Bell event" msgstr "Udalosť zvončeka" -# X window system preloz, napr. system na spravu okien X -#: src/core/display.c:608 -#, c-format -msgid "Failed to open X Window System display “%s”\n" -msgstr "Zlyhalo otvorenie displeja systému na správu okien X „%s“\n" - # cmd desc #: src/core/main.c:190 msgid "Disable connection to session manager" @@ -683,41 +713,45 @@ msgid "Run as a nested compositor" msgstr "Spustí ako kompozitor s vnoreným režimom" -#: src/core/main.c:240 +#: src/core/main.c:238 +msgid "Run wayland compositor without starting Xwayland" +msgstr "" + +#: src/core/main.c:246 msgid "Run as a full display server, rather than nested" msgstr "Spustí ako plnohodnotný zobrazovací server, namiesto vnoreného režimu" -#: src/core/main.c:246 +#: src/core/main.c:252 msgid "Run with X11 backend" msgstr "Spustí s obslužným programom X11" # %s is a window title #. Translators: %s is a window title -#: src/core/meta-close-dialog-default.c:147 +#: src/core/meta-close-dialog-default.c:151 #, c-format msgid "“%s” is not responding." msgstr "„%s“ neodpovedá." -#: src/core/meta-close-dialog-default.c:149 +#: src/core/meta-close-dialog-default.c:153 msgid "Application is not responding." msgstr "Aplikácia neodpovedá." -#: src/core/meta-close-dialog-default.c:154 +#: src/core/meta-close-dialog-default.c:158 msgid "" "You may choose to wait a short while for it to continue or force the " "application to quit entirely." msgstr "" "Môžete chvíľu počkať na pokračovanie aplikácie, alebo ju môžete ukončiť." -#: src/core/meta-close-dialog-default.c:161 +#: src/core/meta-close-dialog-default.c:165 msgid "_Force Quit" msgstr "_Vynútiť ukončenie" -#: src/core/meta-close-dialog-default.c:161 +#: src/core/meta-close-dialog-default.c:165 msgid "_Wait" msgstr "_Počkať" -#: src/core/mutter.c:39 +#: src/core/mutter.c:38 #, c-format msgid "" "mutter %s\n" @@ -733,21 +767,30 @@ "Záruka sa NEPOSKYTUJE; ani na PREDAJNOSŤ alebo VHODNOSŤ PRE URČITÝ ÚČEL.\n" # cmd desc -#: src/core/mutter.c:53 +#: src/core/mutter.c:52 msgid "Print version" msgstr "Zobrazí verziu" # cmd desc -#: src/core/mutter.c:59 +#: src/core/mutter.c:58 msgid "Mutter plugin to use" msgstr "Použije zásuvný modul Mutter" -#: src/core/prefs.c:1997 +#: src/core/prefs.c:1911 #, c-format msgid "Workspace %d" msgstr "Pracovný priestor č. %d" -#: src/core/screen.c:583 +#: src/core/util.c:122 +msgid "Mutter was compiled without support for verbose mode\n" +msgstr "Mutter bol skompilovaný bez výpisu podrobností pri behu\n" + +#: src/wayland/meta-wayland-tablet-pad.c:568 +#, c-format +msgid "Mode Switch: Mode %d" +msgstr "Prepínač režimu: Režim č. %d" + +#: src/x11/meta-x11-display.c:676 #, c-format msgid "" "Display “%s” already has a window manager; try using the --replace option to " @@ -756,21 +799,27 @@ "Displej „%s“ už má správcu okien. Skúste použiť prepínač --replace, aby sa " "aktuálny správca nahradil." -#: src/core/screen.c:668 +#: src/x11/meta-x11-display.c:1089 +msgid "Failed to initialize GDK\n" +msgstr "Zlyhala inicializácia GDK\n" + +# X window system preloz, napr. system na spravu okien X +#: src/x11/meta-x11-display.c:1113 +#, c-format +msgid "Failed to open X Window System display “%s”\n" +msgstr "Zlyhalo otvorenie displeja systému na správu okien X „%s“\n" + +#: src/x11/meta-x11-display.c:1196 #, c-format msgid "Screen %d on display “%s” is invalid\n" msgstr "Obrazovka č. %d na displeji „%s“ nie je platná\n" -#: src/core/util.c:120 -msgid "Mutter was compiled without support for verbose mode\n" -msgstr "Mutter bol skompilovaný bez výpisu podrobností pri behu\n" - -#: src/wayland/meta-wayland-tablet-pad.c:563 +#: src/x11/meta-x11-selection-input-stream.c:460 #, c-format -msgid "Mode Switch: Mode %d" -msgstr "Prepínač režimu: Režim č. %d" +msgid "Format %s not supported" +msgstr "Formát %s nie je podporovaný" -#: src/x11/session.c:1818 +#: src/x11/session.c:1821 msgid "" "These windows do not support “save current setup” and will have to be " "restarted manually next time you log in." @@ -779,7 +828,7 @@ "prihlásení ich budete musieť znovu spustiť ručne." # window title; wm_client_machine -#: src/x11/window-props.c:559 +#: src/x11/window-props.c:569 #, c-format msgid "%s (on %s)" msgstr "%s (na %s)" diff -Nru mutter-3.36.1/src/backends/meta-input-settings.c mutter-3.36.2/src/backends/meta-input-settings.c --- mutter-3.36.1/src/backends/meta-input-settings.c 2020-03-30 19:29:39.265885800 +0000 +++ mutter-3.36.2/src/backends/meta-input-settings.c 2020-04-29 20:22:32.411451000 +0000 @@ -818,7 +818,7 @@ for (l = devices; l; l = l->next) { - device = devices->data; + device = l->data; if (input_settings_class->is_trackball_device (input_settings, device)) input_settings_class->set_scroll_button (input_settings, device, button); diff -Nru mutter-3.36.1/src/backends/meta-monitor.c mutter-3.36.2/src/backends/meta-monitor.c --- mutter-3.36.1/src/backends/meta-monitor.c 2020-03-30 19:29:39.268885900 +0000 +++ mutter-3.36.2/src/backends/meta-monitor.c 2020-04-29 20:22:32.414451100 +0000 @@ -817,19 +817,19 @@ case META_MONITOR_TRANSFORM_270: case META_MONITOR_TRANSFORM_FLIPPED_270: if (other_output->tile_info.loc_v_tile == output->tile_info.loc_v_tile && - other_output->tile_info.loc_h_tile < output->tile_info.loc_h_tile) + other_output->tile_info.loc_h_tile > output->tile_info.loc_h_tile) y += other_output->tile_info.tile_w; if (other_output->tile_info.loc_h_tile == output->tile_info.loc_h_tile && - other_output->tile_info.loc_v_tile < output->tile_info.loc_v_tile) + other_output->tile_info.loc_v_tile > output->tile_info.loc_v_tile) x += other_output->tile_info.tile_h; break; case META_MONITOR_TRANSFORM_90: case META_MONITOR_TRANSFORM_FLIPPED_90: if (other_output->tile_info.loc_v_tile == output->tile_info.loc_v_tile && - other_output->tile_info.loc_h_tile > output->tile_info.loc_h_tile) + other_output->tile_info.loc_h_tile < output->tile_info.loc_h_tile) y += other_output->tile_info.tile_w; if (other_output->tile_info.loc_h_tile == output->tile_info.loc_h_tile && - other_output->tile_info.loc_v_tile > output->tile_info.loc_v_tile) + other_output->tile_info.loc_v_tile < output->tile_info.loc_v_tile) x += other_output->tile_info.tile_h; break; } diff -Nru mutter-3.36.1/src/backends/meta-monitor-config-manager.c mutter-3.36.2/src/backends/meta-monitor-config-manager.c --- mutter-3.36.1/src/backends/meta-monitor-config-manager.c 2020-03-30 19:29:39.266885800 +0000 +++ mutter-3.36.2/src/backends/meta-monitor-config-manager.c 2020-04-29 20:22:32.412451300 +0000 @@ -172,6 +172,7 @@ MetaCrtc *crtc; MetaMonitorTransform transform; MetaMonitorTransform crtc_transform; + MetaMonitorTransform crtc_hw_transform; int crtc_x, crtc_y; float x_offset, y_offset; float scale = 0.0; @@ -200,10 +201,12 @@ transform = data->logical_monitor_config->transform; crtc_transform = meta_monitor_logical_to_crtc_transform (monitor, transform); - if (!meta_monitor_manager_is_transform_handled (data->monitor_manager, - crtc, - crtc_transform)) - crtc_transform = META_MONITOR_TRANSFORM_NORMAL; + if (meta_monitor_manager_is_transform_handled (data->monitor_manager, + crtc, + crtc_transform)) + crtc_hw_transform = crtc_transform; + else + crtc_hw_transform = META_MONITOR_TRANSFORM_NORMAL; meta_monitor_calculate_crtc_pos (monitor, mode, output, crtc_transform, &crtc_x, &crtc_y); @@ -244,7 +247,7 @@ .crtc = crtc, .mode = crtc_mode, .layout = crtc_layout, - .transform = crtc_transform, + .transform = crtc_hw_transform, .outputs = g_ptr_array_new () }; g_ptr_array_add (crtc_info->outputs, output); @@ -443,23 +446,35 @@ meta_create_monitors_config_key_for_current_state (MetaMonitorManager *monitor_manager) { MetaMonitorsConfigKey *config_key; + MetaMonitorSpec *laptop_monitor_spec; GList *l; GList *monitor_specs; + laptop_monitor_spec = NULL; monitor_specs = NULL; for (l = monitor_manager->monitors; l; l = l->next) { MetaMonitor *monitor = l->data; MetaMonitorSpec *monitor_spec; - if (meta_monitor_is_laptop_panel (monitor) && - is_lid_closed (monitor_manager)) - continue; + if (meta_monitor_is_laptop_panel (monitor)) + { + laptop_monitor_spec = meta_monitor_get_spec (monitor); + + if (is_lid_closed (monitor_manager)) + continue; + } monitor_spec = meta_monitor_spec_clone (meta_monitor_get_spec (monitor)); monitor_specs = g_list_prepend (monitor_specs, monitor_spec); } + if (!monitor_specs && laptop_monitor_spec) + { + monitor_specs = + g_list_prepend (NULL, meta_monitor_spec_clone (laptop_monitor_spec)); + } + if (!monitor_specs) return NULL; diff -Nru mutter-3.36.1/src/backends/meta-screen-cast-monitor-stream-src.c mutter-3.36.2/src/backends/meta-screen-cast-monitor-stream-src.c --- mutter-3.36.1/src/backends/meta-screen-cast-monitor-stream-src.c 2020-03-30 19:29:39.270885700 +0000 +++ mutter-3.36.2/src/backends/meta-screen-cast-monitor-stream-src.c 2020-04-29 20:22:32.415451000 +0000 @@ -115,9 +115,10 @@ } static void -stage_painted (MetaStage *stage, - ClutterStageView *view, - gpointer user_data) +stage_painted (MetaStage *stage, + ClutterStageView *view, + ClutterPaintContext *paint_context, + gpointer user_data) { MetaScreenCastStreamSrc *src = META_SCREEN_CAST_STREAM_SRC (user_data); diff -Nru mutter-3.36.1/src/backends/meta-stage.c mutter-3.36.2/src/backends/meta-stage.c --- mutter-3.36.1/src/backends/meta-stage.c 2020-03-30 19:29:39.272885800 +0000 +++ mutter-3.36.2/src/backends/meta-stage.c 2020-04-29 20:22:32.417451000 +0000 @@ -65,7 +65,6 @@ ClutterStage parent; GPtrArray *watchers[N_WATCH_MODES]; - ClutterStageView *current_view; GList *overlays; gboolean is_active; @@ -169,6 +168,7 @@ static void notify_watchers_for_mode (MetaStage *stage, ClutterStageView *view, + ClutterPaintContext *paint_context, MetaStageWatchPhase watch_phase) { GPtrArray *watchers; @@ -183,7 +183,7 @@ if (watch->view && view != watch->view) continue; - watch->callback (stage, view, watch->user_data); + watch->callback (stage, view, paint_context, watch->user_data); } } @@ -192,20 +192,34 @@ ClutterPaintContext *paint_context) { MetaStage *stage = META_STAGE (actor); + ClutterStageView *view; GList *l; CLUTTER_ACTOR_CLASS (meta_stage_parent_class)->paint (actor, paint_context); - notify_watchers_for_mode (stage, stage->current_view, - META_STAGE_WATCH_AFTER_ACTOR_PAINT); + view = clutter_paint_context_get_stage_view (paint_context); + if (view) + { + notify_watchers_for_mode (stage, view, paint_context, + META_STAGE_WATCH_AFTER_ACTOR_PAINT); + } - g_signal_emit (stage, signals[ACTORS_PAINTED], 0); + if (!(clutter_paint_context_get_paint_flags (paint_context) & + CLUTTER_PAINT_FLAG_NO_PAINT_SIGNAL)) + g_signal_emit (stage, signals[ACTORS_PAINTED], 0); - for (l = stage->overlays; l; l = l->next) - meta_overlay_paint (l->data, paint_context); + if (!(clutter_paint_context_get_paint_flags (paint_context) & + CLUTTER_PAINT_FLAG_NO_CURSORS)) + { + for (l = stage->overlays; l; l = l->next) + meta_overlay_paint (l->data, paint_context); + } - notify_watchers_for_mode (stage, stage->current_view, - META_STAGE_WATCH_AFTER_OVERLAY_PAINT); + if (view) + { + notify_watchers_for_mode (stage, view, paint_context, + META_STAGE_WATCH_AFTER_OVERLAY_PAINT); + } } static void @@ -215,13 +229,14 @@ { MetaStage *meta_stage = META_STAGE (stage); - notify_watchers_for_mode (meta_stage, view, META_STAGE_WATCH_BEFORE_PAINT); + notify_watchers_for_mode (meta_stage, view, NULL, + META_STAGE_WATCH_BEFORE_PAINT); - meta_stage->current_view = view; CLUTTER_STAGE_CLASS (meta_stage_parent_class)->paint_view (stage, view, redraw_clip); - notify_watchers_for_mode (meta_stage, view, META_STAGE_WATCH_AFTER_PAINT); + notify_watchers_for_mode (meta_stage, view, NULL, + META_STAGE_WATCH_AFTER_PAINT); } static void diff -Nru mutter-3.36.1/src/backends/meta-stage-private.h mutter-3.36.2/src/backends/meta-stage-private.h --- mutter-3.36.1/src/backends/meta-stage-private.h 2020-03-30 19:29:39.272885800 +0000 +++ mutter-3.36.2/src/backends/meta-stage-private.h 2020-04-29 20:22:32.417451000 +0000 @@ -38,9 +38,10 @@ META_STAGE_WATCH_AFTER_PAINT, } MetaStageWatchPhase; -typedef void (* MetaStageWatchFunc) (MetaStage *stage, - ClutterStageView *view, - gpointer user_data); +typedef void (* MetaStageWatchFunc) (MetaStage *stage, + ClutterStageView *view, + ClutterPaintContext *paint_context, + gpointer user_data); ClutterActor *meta_stage_new (MetaBackend *backend); diff -Nru mutter-3.36.1/src/backends/native/meta-cursor-renderer-native.c mutter-3.36.2/src/backends/native/meta-cursor-renderer-native.c --- mutter-3.36.1/src/backends/native/meta-cursor-renderer-native.c 2020-03-30 19:29:39.274885700 +0000 +++ mutter-3.36.2/src/backends/native/meta-cursor-renderer-native.c 2020-04-29 20:22:32.419451000 +0000 @@ -407,13 +407,14 @@ else scale = 1.0; + transform = meta_logical_monitor_get_transform (data->in_logical_monitor); + transform = meta_monitor_logical_to_crtc_transform (monitor, transform); + meta_monitor_calculate_crtc_pos (monitor, monitor_mode, monitor_crtc_mode->output, - META_MONITOR_TRANSFORM_NORMAL, + transform, &crtc_x, &crtc_y); - transform = meta_logical_monitor_get_transform (data->in_logical_monitor); - transform = meta_monitor_logical_to_crtc_transform (monitor, transform); if (meta_monitor_transform_is_rotated (transform)) { crtc_width = monitor_crtc_mode->crtc_mode->height; diff -Nru mutter-3.36.1/src/backends/native/meta-kms.c mutter-3.36.2/src/backends/native/meta-kms.c --- mutter-3.36.1/src/backends/native/meta-kms.c 2020-03-30 19:29:39.280885500 +0000 +++ mutter-3.36.2/src/backends/native/meta-kms.c 2020-04-29 20:22:32.423451000 +0000 @@ -1,5 +1,6 @@ /* * Copyright (C) 2018 Red Hat + * Copyright 2020 DisplayLink (UK) Ltd. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -383,6 +384,7 @@ simple_impl_source->kms = kms; g_source_set_callback (source, func, user_data, user_data_destroy); + g_source_set_ready_time (source, 0); g_source_attach (source, g_main_context_get_thread_default ()); return source; diff -Nru mutter-3.36.1/src/backends/native/meta-kms-impl-simple.c mutter-3.36.2/src/backends/native/meta-kms-impl-simple.c --- mutter-3.36.1/src/backends/native/meta-kms-impl-simple.c 2020-03-30 19:29:39.278885600 +0000 +++ mutter-3.36.2/src/backends/native/meta-kms-impl-simple.c 2020-04-29 20:22:32.422450800 +0000 @@ -1,6 +1,6 @@ /* * Copyright (C) 2018-2019 Red Hat - * Copyright (C) 2019 DisplayLink (UK) Ltd. + * Copyright (C) 2019-2020 DisplayLink (UK) Ltd. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -660,6 +660,9 @@ meta_kms_page_flip_data_ref (page_flip_data)); } + if (ret != 0) + meta_kms_page_flip_data_unref (page_flip_data); + if (ret == -EBUSY) { CachedModeSet *cached_mode_set; diff -Nru mutter-3.36.1/src/backends/native/meta-renderer-native.c mutter-3.36.2/src/backends/native/meta-renderer-native.c --- mutter-3.36.1/src/backends/native/meta-renderer-native.c 2020-03-30 19:29:39.282885600 +0000 +++ mutter-3.36.2/src/backends/native/meta-renderer-native.c 2020-04-29 20:22:32.425450800 +0000 @@ -3037,6 +3037,7 @@ float scale; int onscreen_width; int onscreen_height; + MetaRectangle view_layout; MetaRendererView *view; GError *error = NULL; @@ -3108,8 +3109,11 @@ else scale = 1.0; + meta_rectangle_from_graphene_rect (&crtc->config->layout, + META_ROUNDING_STRATEGY_ROUND, + &view_layout); view = g_object_new (META_TYPE_RENDERER_VIEW, - "layout", &logical_monitor->rect, + "layout", &view_layout, "scale", scale, "framebuffer", onscreen, "offscreen", offscreen, diff -Nru mutter-3.36.1/src/backends/native/meta-seat-native.c mutter-3.36.2/src/backends/native/meta-seat-native.c --- mutter-3.36.1/src/backends/native/meta-seat-native.c 2020-03-30 19:29:39.283885500 +0000 +++ mutter-3.36.2/src/backends/native/meta-seat-native.c 2020-04-29 20:22:32.425450800 +0000 @@ -424,6 +424,9 @@ meta_xkb_translate_state (event, seat->xkb, seat->button_state); event->motion.x = x; event->motion.y = y; + meta_input_device_native_translate_coordinates (input_device, stage, + &event->motion.x, + &event->motion.y); event->motion.axes = axes; clutter_event_set_device (event, seat->core_pointer); clutter_event_set_source_device (event, input_device); diff -Nru mutter-3.36.1/src/backends/x11/meta-input-device-x11.c mutter-3.36.2/src/backends/x11/meta-input-device-x11.c --- mutter-3.36.1/src/backends/x11/meta-input-device-x11.c 2020-03-30 19:29:39.287885400 +0000 +++ mutter-3.36.2/src/backends/x11/meta-input-device-x11.c 2020-04-29 20:22:32.428450800 +0000 @@ -38,7 +38,6 @@ float current_y; #ifdef HAVE_LIBWACOM - WacomDevice *wacom_device; GArray *group_modes; #endif }; @@ -93,13 +92,16 @@ ClutterInputDevice *other_device) { #ifdef HAVE_LIBWACOM - MetaInputDeviceX11 *device_x11 = META_INPUT_DEVICE_X11 (device); - MetaInputDeviceX11 *other_device_x11 = META_INPUT_DEVICE_X11 (other_device); + WacomDevice *wacom_device, *other_wacom_device; - if (device_x11->wacom_device && - other_device_x11->wacom_device && - libwacom_compare (device_x11->wacom_device, - other_device_x11->wacom_device, + wacom_device = + meta_input_device_get_wacom_device (META_INPUT_DEVICE (device)); + other_wacom_device = + meta_input_device_get_wacom_device (META_INPUT_DEVICE (other_device)); + + if (wacom_device && other_wacom_device && + libwacom_compare (wacom_device, + other_wacom_device, WCOMPARE_NORMAL) == 0) return TRUE; #endif @@ -122,9 +124,9 @@ static void meta_input_device_x11_finalize (GObject *object) { -#ifdef HAVE_LIBWACOM MetaInputDeviceX11 *device_xi2 = META_INPUT_DEVICE_X11 (object); +#ifdef HAVE_LIBWACOM if (device_xi2->group_modes) g_array_unref (device_xi2->group_modes); #endif @@ -413,9 +415,12 @@ { MetaInputDeviceX11 *device_x11 = META_INPUT_DEVICE_X11 (device); uint32_t n_buttons, n_modes, button_group, next_mode, i; + WacomDevice *wacom_device; GList *switch_buttons = NULL; - n_buttons = libwacom_get_num_buttons (device_x11->wacom_device); + wacom_device = + meta_input_device_get_wacom_device (META_INPUT_DEVICE (device)); + n_buttons = libwacom_get_num_buttons (wacom_device); for (i = 0; i < n_buttons; i++) { diff -Nru mutter-3.36.1/src/compositor/compositor.c mutter-3.36.2/src/compositor/compositor.c --- mutter-3.36.1/src/compositor/compositor.c 2020-03-30 19:29:39.292885300 +0000 +++ mutter-3.36.2/src/compositor/compositor.c 2020-04-29 20:22:32.432450500 +0000 @@ -63,7 +63,6 @@ #include "clutter/clutter-mutter.h" #include "cogl/cogl.h" #include "compositor/meta-window-actor-x11.h" -#include "compositor/meta-window-actor-wayland.h" #include "compositor/meta-window-actor-private.h" #include "compositor/meta-window-group-private.h" #include "core/display-private.h" @@ -82,6 +81,7 @@ #include "x11/meta-x11-display-private.h" #ifdef HAVE_WAYLAND +#include "compositor/meta-window-actor-wayland.h" #include "wayland/meta-wayland-private.h" #endif diff -Nru mutter-3.36.1/src/compositor/meta-window-actor.c mutter-3.36.2/src/compositor/meta-window-actor.c --- mutter-3.36.1/src/compositor/meta-window-actor.c 2020-03-30 19:29:39.297885200 +0000 +++ mutter-3.36.2/src/compositor/meta-window-actor.c 2020-04-29 20:22:32.437450400 +0000 @@ -1300,6 +1300,7 @@ cogl_color_init_from_4ub (&clear_color, 0, 0, 0, 0); cogl_framebuffer_clear (framebuffer, COGL_BUFFER_BIT_COLOR, &clear_color); cogl_framebuffer_orthographic (framebuffer, 0, 0, width, height, 0, 1.0); + cogl_framebuffer_set_viewport (framebuffer, 0, 0, width, height); meta_rectangle_scale_double (bounds, resource_scale, META_ROUNDING_STRATEGY_GROW, diff -Nru mutter-3.36.1/src/compositor/meta-window-actor-x11.c mutter-3.36.2/src/compositor/meta-window-actor-x11.c --- mutter-3.36.1/src/compositor/meta-window-actor-x11.c 2020-03-30 19:29:39.297885200 +0000 +++ mutter-3.36.2/src/compositor/meta-window-actor-x11.c 2020-04-29 20:22:32.437450400 +0000 @@ -85,6 +85,8 @@ cairo_region_t *shape_region; /* The region we should clip to when painting the shadow */ cairo_region_t *shadow_clip; + /* The frame region */ + cairo_region_t *frame_bounds; /* Extracted size-invariant shape used for shadows */ MetaWindowShape *shadow_shape; @@ -702,11 +704,8 @@ if (clip_shadow_under_window (actor_x11)) { - cairo_region_t *frame_bounds; - - frame_bounds = meta_window_get_frame_bounds (window); - if (frame_bounds) - cairo_region_subtract (actor_x11->shadow_clip, frame_bounds); + if (actor_x11->frame_bounds) + cairo_region_subtract (actor_x11->shadow_clip, actor_x11->frame_bounds); } } else @@ -1127,6 +1126,17 @@ } static void +update_frame_bounds (MetaWindowActorX11 *actor_x11) +{ + MetaWindow *window = + meta_window_actor_get_meta_window (META_WINDOW_ACTOR (actor_x11)); + + g_clear_pointer (&actor_x11->frame_bounds, cairo_region_destroy); + actor_x11->frame_bounds = + cairo_region_copy (meta_window_get_frame_bounds (window)); +} + +static void update_regions (MetaWindowActorX11 *actor_x11) { if (!actor_x11->needs_reshape) @@ -1197,6 +1207,7 @@ if (!meta_surface_actor_is_visible (surface)) return; + update_frame_bounds (actor_x11); check_needs_reshape (actor_x11); check_needs_shadow (actor_x11); } @@ -1250,15 +1261,13 @@ */ if (!clip && clip_shadow_under_window (actor_x11)) { - cairo_region_t *frame_bounds; cairo_rectangle_int_t bounds; get_shadow_bounds (actor_x11, appears_focused, &bounds); clip = cairo_region_create_rectangle (&bounds); - frame_bounds = meta_window_get_frame_bounds (window); - if (frame_bounds) - cairo_region_subtract (clip, frame_bounds); + if (actor_x11->frame_bounds) + cairo_region_subtract (clip, actor_x11->frame_bounds); } framebuffer = clutter_paint_context_get_framebuffer (paint_context); @@ -1545,6 +1554,7 @@ g_clear_pointer (&actor_x11->shape_region, cairo_region_destroy); g_clear_pointer (&actor_x11->shadow_clip, cairo_region_destroy); + g_clear_pointer (&actor_x11->frame_bounds, cairo_region_destroy); g_clear_pointer (&actor_x11->shadow_class, g_free); g_clear_pointer (&actor_x11->focused_shadow, meta_shadow_unref); diff -Nru mutter-3.36.1/src/core/keybindings.c mutter-3.36.2/src/core/keybindings.c --- mutter-3.36.1/src/core/keybindings.c 2020-03-30 19:29:39.302885000 +0000 +++ mutter-3.36.2/src/core/keybindings.c 2020-04-29 20:22:32.441450400 +0000 @@ -2129,7 +2129,7 @@ return TRUE; } else if (event->type == CLUTTER_KEY_PRESS && - (event->modifier_state & ~(IGNORED_MODIFIERS)) == 0 && + ((event->modifier_state & ~(IGNORED_MODIFIERS)) & CLUTTER_MODIFIER_MASK) == 0 && resolved_key_combo_has_keycode (resolved_key_combo, event->hardware_keycode)) { diff -Nru mutter-3.36.1/src/core/meta-selection.c mutter-3.36.2/src/core/meta-selection.c --- mutter-3.36.1/src/core/meta-selection.c 2020-03-30 19:29:39.305885000 +0000 +++ mutter-3.36.2/src/core/meta-selection.c 2020-04-29 20:22:32.443450200 +0000 @@ -21,6 +21,7 @@ #include "config.h" +#include "core/meta-selection-private.h" #include "meta/meta-selection.h" typedef struct TransferRequest TransferRequest; @@ -50,6 +51,9 @@ G_DEFINE_TYPE (MetaSelection, meta_selection, G_TYPE_OBJECT) +static void read_selection_source_async (GTask *task, + TransferRequest *request); + static void meta_selection_dispose (GObject *object) { @@ -216,6 +220,7 @@ GAsyncResult *result, GTask *task) { + TransferRequest *request; GError *error = NULL; g_output_stream_write_bytes_finish (stream, result, &error); @@ -226,8 +231,17 @@ return; } - g_task_return_boolean (task, TRUE); - g_object_unref (task); + request = g_task_get_task_data (task); + + if (request->len > 0) + { + read_selection_source_async (task, request); + } + else + { + g_task_return_boolean (task, TRUE); + g_object_unref (task); + } } static void @@ -246,8 +260,26 @@ g_object_unref (task); return; } + else if (g_bytes_get_size (bytes) == 0) + { + g_task_return_boolean (task, TRUE); + g_object_unref (task); + return; + } request = g_task_get_task_data (task); + + if (request->len < g_bytes_get_size (bytes)) + { + GBytes *copy; + + /* Trim content */ + copy = g_bytes_new_from_bytes (bytes, 0, request->len); + g_bytes_unref (bytes); + bytes = copy; + } + + request->len -= g_bytes_get_size (bytes); g_output_stream_write_bytes_async (request->ostream, bytes, G_PRIORITY_DEFAULT, @@ -258,6 +290,18 @@ } static void +read_selection_source_async (GTask *task, + TransferRequest *request) +{ + g_input_stream_read_bytes_async (request->istream, + (gsize) request->len, + G_PRIORITY_DEFAULT, + g_task_get_cancellable (task), + (GAsyncReadyCallback) read_cb, + task); +} + +static void source_read_cb (MetaSelectionSource *source, GAsyncResult *result, GTask *task) @@ -290,12 +334,7 @@ } else { - g_input_stream_read_bytes_async (request->istream, - (gsize) request->len, - G_PRIORITY_DEFAULT, - g_task_get_cancellable (task), - (GAsyncReadyCallback) read_cb, - task); + read_selection_source_async (task, request); } } @@ -364,3 +403,13 @@ return g_task_propagate_boolean (G_TASK (result), error); } + +MetaSelectionSource * +meta_selection_get_current_owner (MetaSelection *selection, + MetaSelectionType selection_type) +{ + g_return_val_if_fail (META_IS_SELECTION (selection), NULL); + g_return_val_if_fail (selection_type < META_N_SELECTION_TYPES, NULL); + + return selection->owners[selection_type]; +} diff -Nru mutter-3.36.1/src/core/meta-selection-private.h mutter-3.36.2/src/core/meta-selection-private.h --- mutter-3.36.1/src/core/meta-selection-private.h 1970-01-01 00:00:00.000000000 +0000 +++ mutter-3.36.2/src/core/meta-selection-private.h 2020-04-29 20:22:32.443450200 +0000 @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2020 Red Hat + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + * + * Written by: + * Carlos Garnacho + */ + +#ifndef META_SELECTION_PRIVATE_H +#define META_SELECTION_PRIVATE_H + +#include "meta/meta-selection.h" + +MetaSelectionSource * + meta_selection_get_current_owner (MetaSelection *selection, + MetaSelectionType selection_type); + +#endif /* META_SELECTION_PRIVATE_H */ diff -Nru mutter-3.36.1/src/core/window.c mutter-3.36.2/src/core/window.c --- mutter-3.36.1/src/core/window.c 2020-03-30 19:29:39.310885000 +0000 +++ mutter-3.36.2/src/core/window.c 2020-04-29 20:22:32.447450200 +0000 @@ -3751,6 +3751,8 @@ meta_window_focus (window, timestamp); else meta_workspace_activate_with_focus (window->workspace, window, timestamp); + + meta_window_check_alive (window, timestamp); } /* This function exists since most of the functionality in window_activate @@ -4790,8 +4792,6 @@ return; } - meta_window_check_alive (window, timestamp); - META_WINDOW_GET_CLASS (window)->focus (window, timestamp); if (window->display->event_route == META_EVENT_ROUTE_NORMAL) @@ -8349,6 +8349,7 @@ "Focusing %s due to button %u press (display.c)\n", window->desc, button); meta_window_focus (window, event->any.time); + meta_window_check_alive (window, event->any.time); } else /* However, do allow terminals to lose focus due to new diff -Nru mutter-3.36.1/src/tests/clutter/conform/actor-pick.c mutter-3.36.2/src/tests/clutter/conform/actor-pick.c --- mutter-3.36.1/src/tests/clutter/conform/actor-pick.c 2020-03-30 19:29:39.319884500 +0000 +++ mutter-3.36.2/src/tests/clutter/conform/actor-pick.c 2020-04-29 20:22:32.453450000 +0000 @@ -67,6 +67,9 @@ } else if (test_num == 2) { + ClutterActorBox over_actor_box = + CLUTTER_ACTOR_BOX_INIT (0, 0, STAGE_WIDTH, STAGE_HEIGHT); + /* Make the actor visible but set a clip so that only some of the actors are accessible */ clutter_actor_show (over_actor); @@ -76,6 +79,11 @@ state->actor_width * (ACTORS_X - 4), state->actor_height * (ACTORS_Y - 4)); + /* Only allocated actors can be picked, so force an allocation + * of the overlay actor here. + */ + clutter_actor_allocate (over_actor, &over_actor_box, 0); + if (g_test_verbose ()) g_print ("Clipped covering actor:\n"); } @@ -175,10 +183,10 @@ for (y = 0; y < ACTORS_Y; y++) for (x = 0; x < ACTORS_X; x++) { - ClutterColor color = { x * 255 / (ACTORS_X - 1), - y * 255 / (ACTORS_Y - 1), - 128, 255 }; - ClutterActor *rect = clutter_rectangle_new_with_color (&color); + ClutterColor color = { x * 255 / (ACTORS_X - 1), + y * 255 / (ACTORS_Y - 1), + 128, 255 }; + ClutterActor *rect = clutter_rectangle_new_with_color (&color); clutter_actor_set_position (rect, x * state.actor_width, @@ -187,9 +195,9 @@ state.actor_width, state.actor_height); - clutter_actor_add_child (state.stage, rect); + clutter_actor_add_child (state.stage, rect); - state.actors[y * ACTORS_X + x] = rect; + state.actors[y * ACTORS_X + x] = rect; } clutter_actor_show (state.stage); diff -Nru mutter-3.36.1/src/tests/monitor-configs/lid-scale.xml mutter-3.36.2/src/tests/monitor-configs/lid-scale.xml --- mutter-3.36.1/src/tests/monitor-configs/lid-scale.xml 1970-01-01 00:00:00.000000000 +0000 +++ mutter-3.36.2/src/tests/monitor-configs/lid-scale.xml 2020-04-29 20:22:32.462449800 +0000 @@ -0,0 +1,23 @@ + + + + 0 + 0 + yes + 2 + + + eDP-1 + MetaProduct's Inc. + MetaMonitor + 0x123456 + + + 1920 + 1080 + 60.000495910644531 + + + + + diff -Nru mutter-3.36.1/src/tests/monitor-unit-tests.c mutter-3.36.2/src/tests/monitor-unit-tests.c --- mutter-3.36.1/src/tests/monitor-unit-tests.c 2020-03-30 19:29:39.331884400 +0000 +++ mutter-3.36.2/src/tests/monitor-unit-tests.c 2020-04-29 20:22:32.463449700 +0000 @@ -2869,6 +2869,116 @@ } static void +meta_test_monitor_lid_scaled_closed_opened (void) +{ + MonitorTestCase test_case = { + .setup = { + .modes = { + { + .width = 1920, + .height = 1080, + .refresh_rate = 60.000495910644531 + } + }, + .n_modes = 1, + .outputs = { + { + .crtc = 0, + .modes = { 0 }, + .n_modes = 1, + .preferred_mode = 0, + .possible_crtcs = { 0 }, + .n_possible_crtcs = 1, + .width_mm = 222, + .height_mm = 125, + .is_laptop_panel = TRUE + }, + }, + .n_outputs = 1, + .crtcs = { + { + .current_mode = 0 + }, + }, + .n_crtcs = 1 + }, + + .expect = { + .monitors = { + { + .outputs = { 0 }, + .n_outputs = 1, + .modes = { + { + .width = 1920, + .height = 1080, + .refresh_rate = 60.000495910644531, + .crtc_modes = { + { + .output = 0, + .crtc_mode = 0 + } + } + } + }, + .n_modes = 1, + .current_mode = 0, + .width_mm = 222, + .height_mm = 125, + } + }, + .n_monitors = 1, + .logical_monitors = { + { + .monitors = { 0 }, + .n_monitors = 1, + .layout = { .x = 0, .y = 0, .width = 960, .height = 540 }, + .scale = 2 + } + }, + .n_logical_monitors = 1, + .primary_logical_monitor = 0, + .n_outputs = 1, + .crtcs = { + { + .current_mode = 0, + } + }, + .n_crtcs = 1, + .n_tiled_monitors = 0, + .screen_width = 960, + .screen_height = 540 + } + }; + MetaMonitorTestSetup *test_setup; + MetaBackend *backend = meta_get_backend (); + MetaMonitorManager *monitor_manager = + meta_backend_get_monitor_manager (backend); + + if (!meta_is_stage_views_enabled ()) + { + g_test_skip ("Not using stage views"); + return; + } + + test_setup = create_monitor_test_setup (&test_case, + MONITOR_TEST_FLAG_NONE); + set_custom_monitor_config ("lid-scale.xml"); + emulate_hotplug (test_setup); + check_monitor_configuration (&test_case); + + meta_backend_test_set_is_lid_closed (META_BACKEND_TEST (backend), TRUE); + meta_monitor_manager_lid_is_closed_changed (monitor_manager); + + check_monitor_configuration (&test_case); + + meta_backend_test_set_is_lid_closed (META_BACKEND_TEST (backend), FALSE); + meta_monitor_manager_lid_is_closed_changed (monitor_manager); + + check_monitor_configuration (&test_case); +} + +static void meta_test_monitor_no_outputs (void) { MonitorTestCase test_case = { @@ -4828,12 +4938,13 @@ .current_mode = 1, .transform = META_MONITOR_TRANSFORM_90, .x = 1024, - .y = 400, + .y = 0, }, { .current_mode = 1, .transform = META_MONITOR_TRANSFORM_90, .x = 1024, + .y = 400, } }, .n_crtcs = 3, @@ -4860,6 +4971,198 @@ } static void +meta_test_monitor_custom_second_rotated_nonnative_tiled_config (void) +{ + MonitorTestCase test_case = { + .setup = { + .modes = { + { + .width = 1024, + .height = 768, + .refresh_rate = 60.000495910644531 + }, + { + .width = 400, + .height = 600, + .refresh_rate = 60.000495910644531 + } + }, + .n_modes = 2, + .outputs = { + { + .crtc = 0, + .modes = { 0 }, + .n_modes = 1, + .preferred_mode = 0, + .possible_crtcs = { 0 }, + .n_possible_crtcs = 1, + .width_mm = 222, + .height_mm = 125, + }, + { + .crtc = -1, + .modes = { 1 }, + .n_modes = 1, + .preferred_mode = 1, + .possible_crtcs = { 1, 2 }, + .n_possible_crtcs = 2, + .width_mm = 222, + .height_mm = 125, + .tile_info = { + .group_id = 1, + .max_h_tiles = 2, + .max_v_tiles = 1, + .loc_h_tile = 0, + .loc_v_tile = 0, + .tile_w = 400, + .tile_h = 600 + } + }, + { + .crtc = -1, + .modes = { 1 }, + .n_modes = 1, + .preferred_mode = 1, + .possible_crtcs = { 1, 2 }, + .n_possible_crtcs = 2, + .width_mm = 222, + .height_mm = 125, + .tile_info = { + .group_id = 1, + .max_h_tiles = 2, + .max_v_tiles = 1, + .loc_h_tile = 1, + .loc_v_tile = 0, + .tile_w = 400, + .tile_h = 600 + } + } + }, + .n_outputs = 3, + .crtcs = { + { + .current_mode = -1 + }, + { + .current_mode = -1 + }, + { + .current_mode = -1 + } + }, + .n_crtcs = 3 + }, + + .expect = { + .monitors = { + { + .outputs = { 0 }, + .n_outputs = 1, + .modes = { + { + .width = 1024, + .height = 768, + .refresh_rate = 60.000495910644531, + .crtc_modes = { + { + .output = 0, + .crtc_mode = 0 + } + } + } + }, + .n_modes = 1, + .current_mode = 0, + .width_mm = 222, + .height_mm = 125, + }, + { + .outputs = { 1, 2 }, + .n_outputs = 2, + .modes = { + { + .width = 800, + .height = 600, + .refresh_rate = 60.000495910644531, + .crtc_modes = { + { + .output = 1, + .crtc_mode = 1, + }, + { + .output = 2, + .crtc_mode = 1, + } + } + } + }, + .n_modes = 1, + .current_mode = 0, + .width_mm = 222, + .height_mm = 125, + } + }, + .n_monitors = 2, + .logical_monitors = { + { + .monitors = { 0 }, + .n_monitors = 1, + .layout = { .x = 0, .y = 256, .width = 1024, .height = 768 }, + .scale = 1 + }, + { + .monitors = { 1 }, + .n_monitors = 1, + .layout = { .x = 1024, .y = 0, .width = 600, .height = 800 }, + .scale = 1, + .transform = META_MONITOR_TRANSFORM_90 + } + }, + .n_logical_monitors = 2, + .primary_logical_monitor = 0, + .n_outputs = 3, + .crtcs = { + { + .current_mode = 0, + .y = 256, + }, + { + .current_mode = 1, + .transform = META_MONITOR_TRANSFORM_NORMAL, + .x = 1024, + .y = 0, + }, + { + .current_mode = 1, + .transform = META_MONITOR_TRANSFORM_NORMAL, + .x = 1024, + .y = 400, + } + }, + .n_crtcs = 3, + .n_tiled_monitors = 1, + .screen_width = 1024 + 600, + .screen_height = 1024 + } + }; + MetaMonitorTestSetup *test_setup; + MetaBackend *backend = meta_get_backend (); + MetaMonitorManager *monitor_manager = + meta_backend_get_monitor_manager (backend); + MetaMonitorManagerTest *monitor_manager_test = + META_MONITOR_MANAGER_TEST (monitor_manager); + + meta_monitor_manager_test_set_handles_transforms (monitor_manager_test, + FALSE); + + test_setup = create_monitor_test_setup (&test_case, + MONITOR_TEST_FLAG_NONE); + set_custom_monitor_config ("second-rotated-tiled.xml"); + emulate_hotplug (test_setup); + check_monitor_configuration (&test_case); +} + +static void meta_test_monitor_custom_second_rotated_nonnative_config (void) { MonitorTestCase test_case = { @@ -6058,6 +6361,8 @@ meta_test_monitor_lid_closed_no_external); add_monitor_test ("/backends/monitor/lid-closed-with-hotplugged-external", meta_test_monitor_lid_closed_with_hotplugged_external); + add_monitor_test ("/backends/monitor/lid-scaled-closed-opened", + meta_test_monitor_lid_scaled_closed_opened); add_monitor_test ("/backends/monitor/no-outputs", meta_test_monitor_no_outputs); add_monitor_test ("/backends/monitor/underscanning-config", @@ -6093,6 +6398,8 @@ meta_test_monitor_custom_second_rotated_config); add_monitor_test ("/backends/monitor/custom/second-rotated-tiled-config", meta_test_monitor_custom_second_rotated_tiled_config); + add_monitor_test ("/backends/monitor/custom/second-rotated-nonnative-tiled-config", + meta_test_monitor_custom_second_rotated_nonnative_tiled_config); add_monitor_test ("/backends/monitor/custom/second-rotated-nonnative-config", meta_test_monitor_custom_second_rotated_nonnative_config); add_monitor_test ("/backends/monitor/custom/interlaced-config", diff -Nru mutter-3.36.1/src/wayland/meta-wayland-data-device.c mutter-3.36.2/src/wayland/meta-wayland-data-device.c --- mutter-3.36.1/src/wayland/meta-wayland-data-device.c 2020-03-30 19:29:39.339884300 +0000 +++ mutter-3.36.2/src/wayland/meta-wayland-data-device.c 2020-04-29 20:22:32.469449500 +0000 @@ -1344,20 +1344,8 @@ selection_data_source_destroyed (gpointer data, GObject *object_was_here) { MetaWaylandDataDevice *data_device = data; - MetaWaylandSeat *seat = wl_container_of (data_device, seat, data_device); - struct wl_resource *data_device_resource; - struct wl_client *focus_client = NULL; data_device->selection_data_source = NULL; - - focus_client = meta_wayland_keyboard_get_focus_client (seat->keyboard); - if (focus_client) - { - data_device_resource = wl_resource_find_for_client (&data_device->resource_list, focus_client); - if (data_device_resource) - wl_data_device_send_selection (data_device_resource, NULL); - } - unset_selection_source (data_device, META_SELECTION_CLIPBOARD); } @@ -1392,8 +1380,7 @@ if (!priv->resource) return; - if (wl_resource_get_version(priv->resource) >= WL_DATA_SOURCE_DND_FINISHED_SINCE_VERSION) - wl_data_source_send_cancelled (priv->resource); + wl_data_source_send_cancelled (priv->resource); } static void @@ -1414,11 +1401,12 @@ MetaWaylandDataSourcePrivate *priv = meta_wayland_data_source_get_instance_private (source); - priv->drop_performed = TRUE; - if (wl_resource_get_version (priv->resource) >= WL_DATA_SOURCE_DND_DROP_PERFORMED_SINCE_VERSION) - wl_data_source_send_dnd_drop_performed (priv->resource); + { + priv->drop_performed = TRUE; + wl_data_source_send_dnd_drop_performed (priv->resource); + } } static void @@ -1659,8 +1647,6 @@ guint32 serial) { MetaWaylandSeat *seat = wl_container_of (data_device, seat, data_device); - struct wl_resource *data_device_resource; - struct wl_client *focus_client; MetaSelectionSource *selection_source; if (data_device->selection_data_source && @@ -1669,7 +1655,6 @@ if (data_device->selection_data_source) { - meta_wayland_data_source_cancel (data_device->selection_data_source); g_object_weak_unref (G_OBJECT (data_device->selection_data_source), selection_data_source_destroyed, data_device); @@ -1696,18 +1681,6 @@ set_selection_source (data_device, META_SELECTION_CLIPBOARD, selection_source); g_object_unref (selection_source); - - focus_client = meta_wayland_keyboard_get_focus_client (seat->keyboard); - if (focus_client) - { - data_device_resource = wl_resource_find_for_client (&data_device->resource_list, focus_client); - if (data_device_resource) - { - struct wl_resource *offer; - offer = create_and_send_clipboard_offer (data_device, data_device_resource); - wl_data_device_send_selection (data_device_resource, offer); - } - } } static void @@ -1758,21 +1731,8 @@ GObject *object_was_here) { MetaWaylandDataDevice *data_device = data; - MetaWaylandSeat *seat = wl_container_of (data_device, seat, data_device); - struct wl_client *focus_client = NULL; data_device->primary_data_source = NULL; - - focus_client = meta_wayland_keyboard_get_focus_client (seat->keyboard); - if (focus_client) - { - struct wl_resource *data_device_resource; - - data_device_resource = wl_resource_find_for_client (&data_device->primary_resource_list, focus_client); - if (data_device_resource) - gtk_primary_selection_device_send_selection (data_device_resource, NULL); - } - unset_selection_source (data_device, META_SELECTION_PRIMARY); } @@ -1782,8 +1742,6 @@ guint32 serial) { MetaWaylandSeat *seat = wl_container_of (data_device, seat, data_device); - struct wl_resource *data_device_resource; - struct wl_client *focus_client; MetaSelectionSource *selection_source; g_assert (!source || META_IS_WAYLAND_DATA_SOURCE_PRIMARY (source)); @@ -1794,7 +1752,6 @@ if (data_device->primary_data_source) { - meta_wayland_data_source_cancel (data_device->primary_data_source); g_object_weak_unref (G_OBJECT (data_device->primary_data_source), primary_source_destroyed, data_device); @@ -1820,18 +1777,6 @@ set_selection_source (data_device, META_SELECTION_PRIMARY, selection_source); g_object_unref (selection_source); - - focus_client = meta_wayland_keyboard_get_focus_client (seat->keyboard); - if (focus_client) - { - data_device_resource = wl_resource_find_for_client (&data_device->primary_resource_list, focus_client); - if (data_device_resource) - { - struct wl_resource *offer; - offer = create_and_send_primary_offer (data_device, data_device_resource); - gtk_primary_selection_device_send_selection (data_device_resource, offer); - } - } } static void diff -Nru mutter-3.36.1/src/wayland/meta-wayland-keyboard.c mutter-3.36.2/src/wayland/meta-wayland-keyboard.c --- mutter-3.36.1/src/wayland/meta-wayland-keyboard.c 2020-03-30 19:29:39.341884100 +0000 +++ mutter-3.36.2/src/wayland/meta-wayland-keyboard.c 2020-04-29 20:22:32.471449400 +0000 @@ -603,7 +603,6 @@ meta_wayland_keyboard_end_grab (keyboard); meta_wayland_keyboard_set_focus (keyboard, NULL); - meta_wayland_xkb_info_destroy (&keyboard->xkb_info); wl_list_remove (&keyboard->resource_list); wl_list_init (&keyboard->resource_list); @@ -918,6 +917,17 @@ } static void +meta_wayland_keyboard_finalize (GObject *object) +{ + MetaWaylandKeyboard *keyboard = META_WAYLAND_KEYBOARD (object); + + meta_wayland_xkb_info_destroy (&keyboard->xkb_info); +} + +static void meta_wayland_keyboard_class_init (MetaWaylandKeyboardClass *klass) { + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + object_class->finalize = meta_wayland_keyboard_finalize; } diff -Nru mutter-3.36.1/src/wayland/meta-xwayland-dnd.c mutter-3.36.2/src/wayland/meta-xwayland-dnd.c --- mutter-3.36.1/src/wayland/meta-xwayland-dnd.c 2020-03-30 19:29:39.349884000 +0000 +++ mutter-3.36.2/src/wayland/meta-xwayland-dnd.c 2020-04-29 20:22:32.477449200 +0000 @@ -145,6 +145,8 @@ gchar **p; struct wl_array *source_mime_types; + meta_x11_error_trap_push (x11_display); + data_source = compositor->seat->data_device.dnd_data_source; xev.xclient.type = ClientMessage; xev.xclient.message_type = xdnd_atoms[ATOM_DND_ENTER]; @@ -189,6 +191,9 @@ } XSendEvent (xdisplay, dest, False, NoEventMask, &xev); + + if (meta_x11_error_trap_pop_with_return (x11_display) != Success) + g_critical ("Error sending XdndEnter"); } static void @@ -205,7 +210,9 @@ xev.xclient.window = dest; xev.xclient.data.l[0] = x11_display->selection.xwindow; + meta_x11_error_trap_push (x11_display); XSendEvent (xdisplay, dest, False, NoEventMask, &xev); + meta_x11_error_trap_pop (x11_display); } static void @@ -241,7 +248,11 @@ xev.xclient.data.l[3] = time; xev.xclient.data.l[4] = action_to_atom (action); + meta_x11_error_trap_push (x11_display); XSendEvent (xdisplay, dest, False, NoEventMask, &xev); + + if (meta_x11_error_trap_pop_with_return (x11_display) != Success) + g_critical ("Error sending XdndPosition"); } static void @@ -261,7 +272,11 @@ xev.xclient.data.l[0] = x11_display->selection.xwindow; xev.xclient.data.l[2] = time; + meta_x11_error_trap_push (x11_display); XSendEvent (xdisplay, dest, False, NoEventMask, &xev); + + if (meta_x11_error_trap_pop_with_return (x11_display) != Success) + g_critical ("Error sending XdndDrop"); } static void @@ -289,7 +304,11 @@ xev.xclient.data.l[2] = action_to_atom (action); } + meta_x11_error_trap_push (x11_display); XSendEvent (xdisplay, dest, False, NoEventMask, &xev); + + if (meta_x11_error_trap_pop_with_return (x11_display) != Success) + g_critical ("Error sending XdndFinished"); } static void @@ -297,6 +316,7 @@ Window dest, uint32_t action) { + MetaX11Display *x11_display = meta_get_display ()->x11_display; Display *xdisplay = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()); XEvent xev = { 0 }; @@ -312,7 +332,11 @@ if (xev.xclient.data.l[4]) xev.xclient.data.l[1] |= 1 << 0; /* Bit 1: dest accepts the drop */ + meta_x11_error_trap_push (x11_display); XSendEvent (xdisplay, dest, False, NoEventMask, &xev); + + if (meta_x11_error_trap_pop_with_return (x11_display) != Success) + g_critical ("Error sending Xdndstatus"); } static void diff -Nru mutter-3.36.1/src/x11/meta-x11-selection.c mutter-3.36.2/src/x11/meta-x11-selection.c --- mutter-3.36.1/src/x11/meta-x11-selection.c 2020-03-30 19:29:39.354884000 +0000 +++ mutter-3.36.2/src/x11/meta-x11-selection.c 2020-04-29 20:22:32.481449100 +0000 @@ -23,6 +23,8 @@ #include +#include "core/meta-selection-private.h" +#include "meta/meta-selection-source-memory.h" #include "x11/meta-selection-source-x11-private.h" #include "x11/meta-x11-selection-output-stream-private.h" #include "x11/meta-x11-selection-private.h" @@ -30,6 +32,13 @@ #define UTF8_STRING_MIMETYPE "text/plain;charset=utf-8" #define STRING_MIMETYPE "text/plain" +/* Set an arbitrary (although generous) threshold to determine whether a + * XFixesSelectionNotify corresponds to a XSetSelectionOwner from another + * client. The selection timestamp is not updated if the owner client is + * closed. + */ +#define SELECTION_CLEARED_BY_CLIENT(e) (e->timestamp - e->selection_timestamp < 50) + static gboolean atom_to_selection_type (Display *xdisplay, Atom selection, @@ -296,8 +305,8 @@ source = meta_selection_source_x11_new_finish (res, &error); if (source) { - meta_selection_set_owner (selection, selection_type, source); g_set_object (&x11_display->selection.owners[selection_type], source); + meta_selection_set_owner (selection, selection_type, source); g_object_unref (source); } else if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) @@ -331,16 +340,27 @@ x11_display->selection.cancellables[selection_type] = g_cancellable_new (); - if (event->owner == None) + if (event->owner == None && x11_display->selection.owners[selection_type]) { - if (x11_display->selection.owners[selection_type]) + if (SELECTION_CLEARED_BY_CLIENT (event)) + { + MetaSelectionSource *source; + + /* Replace with an empty owner */ + source = g_object_new (META_TYPE_SELECTION_SOURCE_MEMORY, NULL); + g_set_object (&x11_display->selection.owners[selection_type], source); + meta_selection_set_owner (selection, selection_type, source); + g_object_unref (source); + } + else { /* An X client went away, clear the selection */ meta_selection_unset_owner (selection, selection_type, x11_display->selection.owners[selection_type]); + g_clear_object (&x11_display->selection.owners[selection_type]); } } - else if (event->owner != x11_display->selection.xwindow) + else if (event->owner != None && event->owner != x11_display->selection.xwindow) { SourceNewData *data; @@ -374,14 +394,13 @@ } static void -owner_changed_cb (MetaSelection *selection, - MetaSelectionType selection_type, - MetaSelectionSource *new_owner, - MetaX11Display *x11_display) +notify_selection_owner (MetaX11Display *x11_display, + MetaSelectionType selection_type, + MetaSelectionSource *new_owner) { Display *xdisplay = x11_display->xdisplay; - if (new_owner && !META_IS_SELECTION_SOURCE_X11 (new_owner)) + if (new_owner && new_owner != x11_display->selection.owners[selection_type]) { if (x11_display->selection.cancellables[selection_type]) { @@ -404,6 +423,7 @@ { XSetWindowAttributes attributes = { 0 }; MetaDisplay *display = meta_get_display (); + MetaSelection *selection; guint mask, i; attributes.event_mask = PropertyChangeMask | SubstructureNotifyMask; @@ -424,18 +444,24 @@ XFixesSelectionWindowDestroyNotifyMask | XFixesSelectionClientCloseNotifyMask; + selection = meta_display_get_selection (display); + for (i = 0; i < META_N_SELECTION_TYPES; i++) { + MetaSelectionSource *owner; + XFixesSelectSelectionInput (x11_display->xdisplay, x11_display->selection.xwindow, selection_to_atom (i, x11_display->xdisplay), mask); + owner = meta_selection_get_current_owner (selection, i); + notify_selection_owner (x11_display, i, owner); } - g_signal_connect (meta_display_get_selection (display), - "owner-changed", - G_CALLBACK (owner_changed_cb), - x11_display); + g_signal_connect_swapped (selection, + "owner-changed", + G_CALLBACK (notify_selection_owner), + x11_display); } void @@ -445,7 +471,7 @@ guint i; g_signal_handlers_disconnect_by_func (meta_display_get_selection (display), - owner_changed_cb, + notify_selection_owner, x11_display); for (i = 0; i < META_N_SELECTION_TYPES; i++) diff -Nru mutter-3.36.1/src/x11/meta-x11-selection-output-stream.c mutter-3.36.2/src/x11/meta-x11-selection-output-stream.c --- mutter-3.36.1/src/x11/meta-x11-selection-output-stream.c 2020-03-30 19:29:39.353883700 +0000 +++ mutter-3.36.2/src/x11/meta-x11-selection-output-stream.c 2020-04-29 20:22:32.481449100 +0000 @@ -60,6 +60,8 @@ meta_x11_selection_output_stream, G_TYPE_OUTPUT_STREAM); +static size_t get_element_size (int format); + static void meta_x11_selection_output_stream_notify_selection (MetaX11SelectionOutputStream *stream) { @@ -97,6 +99,9 @@ if (priv->delete_pending) return FALSE; + if (!g_output_stream_is_closing (G_OUTPUT_STREAM (stream)) && + priv->data->len < get_element_size (priv->format)) + return FALSE; return TRUE; } @@ -110,7 +115,7 @@ if (size <= 0) size = XMaxRequestSize (display->xdisplay); - return size - 100; + return (size - 100) * 4; } static gboolean @@ -120,7 +125,12 @@ meta_x11_selection_output_stream_get_instance_private (stream); if (priv->data->len == 0) - return FALSE; + { + if (priv->incr) + return g_output_stream_is_closing (G_OUTPUT_STREAM (stream)); + else + return FALSE; + } if (g_output_stream_is_closing (G_OUTPUT_STREAM (stream))) return TRUE; @@ -193,7 +203,8 @@ MetaX11SelectionOutputStreamPrivate *priv = meta_x11_selection_output_stream_get_instance_private (stream); Display *xdisplay; - size_t element_size, n_elements; + size_t element_size, n_elements, max_size; + gboolean first_chunk = FALSE; int error_code; g_assert (!priv->delete_pending); @@ -207,8 +218,12 @@ element_size = get_element_size (priv->format); n_elements = priv->data->len / element_size; + max_size = get_max_request_size (priv->x11_display); - if (!g_output_stream_is_closing (G_OUTPUT_STREAM (stream))) + if (!priv->incr) + first_chunk = TRUE; + + if (!priv->incr && priv->data->len > max_size) { XWindowAttributes attrs; @@ -224,14 +239,22 @@ XChangeProperty (xdisplay, priv->xwindow, priv->xproperty, - XInternAtom (priv->x11_display->xdisplay, "INCR", True), + XInternAtom (priv->x11_display->xdisplay, "INCR", False), 32, PropModeReplace, (guchar *) &(long) { n_elements }, 1); + priv->delete_pending = TRUE; } else { + size_t copy_n_elements; + + if (priv->incr && priv->data->len > 0) + priv->delete_pending = TRUE; + + copy_n_elements = MIN (n_elements, max_size / element_size); + XChangeProperty (xdisplay, priv->xwindow, priv->xproperty, @@ -239,15 +262,13 @@ priv->format, PropModeReplace, priv->data->data, - n_elements); - g_byte_array_remove_range (priv->data, 0, n_elements * element_size); - if (priv->data->len < element_size) - priv->flush_requested = FALSE; + copy_n_elements); + g_byte_array_remove_range (priv->data, 0, copy_n_elements * element_size); } - meta_x11_selection_output_stream_notify_selection (stream); + if (first_chunk) + meta_x11_selection_output_stream_notify_selection (stream); - priv->delete_pending = TRUE; g_cond_broadcast (&priv->cond); g_mutex_unlock (&priv->mutex); @@ -257,19 +278,26 @@ { char error_str[100]; - XGetErrorText (xdisplay, error_code, error_str, sizeof (error_str)); - g_task_return_new_error (priv->pending_task, - G_IO_ERROR, - G_IO_ERROR_BROKEN_PIPE, - "Failed to flush selection output stream: %s", - error_str); - g_clear_object (&priv->pending_task); + priv->flush_requested = FALSE; + priv->delete_pending = FALSE; priv->pipe_error = TRUE; + + if (priv->pending_task) + { + XGetErrorText (xdisplay, error_code, error_str, sizeof (error_str)); + g_task_return_new_error (priv->pending_task, + G_IO_ERROR, + G_IO_ERROR_BROKEN_PIPE, + "Failed to flush selection output stream: %s", + error_str); + g_clear_object (&priv->pending_task); + } } - else if (priv->pending_task) + else if (priv->pending_task && priv->data->len == 0 && !priv->delete_pending) { size_t result; + priv->flush_requested = FALSE; result = GPOINTER_TO_SIZE (g_task_get_task_data (priv->pending_task)); g_task_return_int (priv->pending_task, result); g_clear_object (&priv->pending_task); @@ -281,12 +309,17 @@ { MetaX11SelectionOutputStream *stream = META_X11_SELECTION_OUTPUT_STREAM (data); + MetaX11SelectionOutputStreamPrivate *priv = + meta_x11_selection_output_stream_get_instance_private (stream); if (meta_x11_selection_output_stream_needs_flush (stream) && meta_x11_selection_output_stream_can_flush (stream)) meta_x11_selection_output_stream_perform_flush (stream); - return G_SOURCE_REMOVE; + if (priv->delete_pending || priv->data->len > 0) + return G_SOURCE_CONTINUE; + else + return G_SOURCE_REMOVE; } static gssize @@ -354,16 +387,11 @@ g_object_unref (task); return; } - else if (!meta_x11_selection_output_stream_can_flush (stream)) - { - g_assert (priv->pending_task == NULL); - priv->pending_task = task; - g_task_set_task_data (task, GSIZE_TO_POINTER (count), NULL); - return; - } else { - meta_x11_selection_output_stream_perform_flush (stream); + if (meta_x11_selection_output_stream_can_flush (stream)) + meta_x11_selection_output_stream_perform_flush (stream); + g_task_return_int (task, count); g_object_unref (task); return; @@ -391,7 +419,7 @@ g_mutex_lock (&priv->mutex); - if (priv->data->len >= get_element_size (priv->format)) + if (priv->data->len > 0) priv->flush_requested = TRUE; needs_flush = meta_x11_selection_output_stream_needs_flush_unlocked (stream); @@ -466,10 +494,9 @@ } } + g_assert (priv->pending_task == NULL); + priv->pending_task = task; meta_x11_selection_output_stream_perform_flush (stream); - g_task_return_boolean (task, TRUE); - g_object_unref (task); - return; } static gboolean