Ticket #16270: mutter-42.0-consolidated_fixes-1.patch

File mutter-42.0-consolidated_fixes-1.patch, 25.4 KB (added by Xi Ruoyao, 3 years ago)

A consolidated patch of the 7 MRs mentioned https://gitlab.gnome.org/GNOME/mutter/-/issues/2175

  • TabularUnified clutter/clutter/cally/cally-stage.c

    diff --color -Naur mutter-42.0/clutter/clutter/cally/cally-stage.c mutter-42.0-patched/clutter/clutter/cally/cally-stage.c
    old new  
    3939#include "cally-stage.h"
    4040#include "cally-actor-private.h"
    4141
     42#include "../clutter-stage-private.h"
     43
    4244/* AtkObject.h */
    4345static void                  cally_stage_real_initialize (AtkObject *obj,
    4446                                                          gpointer   data);
     
    191193
    192194  stage = CLUTTER_STAGE (CALLY_GET_CLUTTER_ACTOR (obj));
    193195
     196  if (clutter_stage_is_activated (stage))
     197    cally_stage_activate_cb (stage, CALLY_STAGE (obj));
     198
    194199  g_signal_connect (stage, "activate", G_CALLBACK (cally_stage_activate_cb), obj);
    195200  g_signal_connect (stage, "deactivate", G_CALLBACK (cally_stage_deactivate_cb), obj);
    196201  g_signal_connect (stage, "notify::key-focus",
  • TabularUnified clutter/clutter/clutter-actor.c

    diff --color -Naur mutter-42.0/clutter/clutter/clutter-actor.c mutter-42.0-patched/clutter/clutter/clutter-actor.c
    old new  
    12641264  if (CLUTTER_ACTOR_IS_MAPPED (self) == mapped)
    12651265    return;
    12661266
     1267  g_return_if_fail (!CLUTTER_ACTOR_IN_MAP_UNMAP (self));
     1268
     1269  CLUTTER_SET_PRIVATE_FLAGS (self, CLUTTER_IN_MAP_UNMAP);
     1270
    12671271  if (mapped)
    12681272    {
    12691273      CLUTTER_ACTOR_GET_CLASS (self)->map (self);
     
    12741278      CLUTTER_ACTOR_GET_CLASS (self)->unmap (self);
    12751279      g_assert (!CLUTTER_ACTOR_IS_MAPPED (self));
    12761280    }
     1281
     1282  CLUTTER_UNSET_PRIVATE_FLAGS (self, CLUTTER_IN_MAP_UNMAP);
    12771283}
    12781284
    12791285/* this function updates the mapped and realized states according to
     
    16951701   */
    16961702  g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_MAPPED]);
    16971703
     1704  if (priv->has_pointer)
     1705    {
     1706      ClutterActor *stage = _clutter_actor_get_stage_internal (self);
     1707
     1708      clutter_stage_pointer_actor_unreactive (CLUTTER_STAGE (stage), self);
     1709    }
     1710
    16981711  /* relinquish keyboard focus if we were unmapped while owning it */
    16991712  if (!CLUTTER_ACTOR_IS_TOPLEVEL (self))
    17001713    maybe_unset_key_focus (self);
     
    1243412447clutter_actor_set_reactive (ClutterActor *actor,
    1243512448                            gboolean      reactive)
    1243612449{
     12450  ClutterActorPrivate *priv;
     12451
    1243712452  g_return_if_fail (CLUTTER_IS_ACTOR (actor));
    1243812453
     12454  priv = actor->priv;
     12455
    1243912456  if (reactive == CLUTTER_ACTOR_IS_REACTIVE (actor))
    1244012457    return;
    1244112458
     
    1244512462    CLUTTER_ACTOR_UNSET_FLAGS (actor, CLUTTER_ACTOR_REACTIVE);
    1244612463
    1244712464  g_object_notify_by_pspec (G_OBJECT (actor), obj_props[PROP_REACTIVE]);
     12465
     12466  if (!CLUTTER_ACTOR_IS_REACTIVE (actor) && priv->has_pointer)
     12467    {
     12468      ClutterActor *stage = _clutter_actor_get_stage_internal (actor);
     12469
     12470      clutter_stage_pointer_actor_unreactive (CLUTTER_STAGE (stage), actor);
     12471    }
    1244812472}
    1244912473
    1245012474/**
  • TabularUnified clutter/clutter/clutter-event.c

    diff --color -Naur mutter-42.0/clutter/clutter/clutter-event.c mutter-42.0-patched/clutter/clutter/clutter-event.c
    old new  
    17721772}
    17731773
    17741774gboolean
    1775 _clutter_event_process_filters (ClutterEvent *event)
     1775_clutter_event_process_filters (ClutterEvent *event,
     1776                                ClutterActor *event_actor)
    17761777{
    17771778  ClutterMainContext *context = _clutter_context_get_default ();
    17781779  GList *l, *next;
     
    17891790      if (event_filter->stage && event_filter->stage != event->any.stage)
    17901791        continue;
    17911792
    1792       if (event_filter->func (event, event_filter->user_data) == CLUTTER_EVENT_STOP)
     1793      if (event_filter->func (event, event_actor, event_filter->user_data) == CLUTTER_EVENT_STOP)
    17931794        return CLUTTER_EVENT_STOP;
    17941795    }
    17951796
  • TabularUnified clutter/clutter/clutter-event.h

    diff --color -Naur mutter-42.0/clutter/clutter/clutter-event.h mutter-42.0-patched/clutter/clutter/clutter-event.h
    old new  
    615615/**
    616616 * ClutterEventFilterFunc:
    617617 * @event: the event that is going to be emitted
     618 * @event_actor: the current device actor of the events device
    618619 * @user_data: the data pointer passed to clutter_event_add_filter()
    619620 *
    620621 * A function pointer type used by event filters that are added with
     
    628629 * Since: 1.18
    629630 */
    630631typedef gboolean (* ClutterEventFilterFunc) (const ClutterEvent *event,
     632                                             ClutterActor       *event_actor,
    631633                                             gpointer            user_data);
    632634
    633635CLUTTER_EXPORT
  • TabularUnified clutter/clutter/clutter-event-private.h

    diff --color -Naur mutter-42.0/clutter/clutter/clutter-event-private.h mutter-42.0-patched/clutter/clutter/clutter-event-private.h
    old new  
    1414void            _clutter_process_event                  (ClutterEvent       *event);
    1515
    1616CLUTTER_EXPORT
    17 gboolean        _clutter_event_process_filters          (ClutterEvent       *event);
     17gboolean        _clutter_event_process_filters          (ClutterEvent *event,
     18                                                         ClutterActor *event_actor);
    1819
    1920/* clears the event queue inside the main context */
    2021void            _clutter_clear_events_queue             (void);
  • TabularUnified clutter/clutter/clutter-input-pointer-a11y.c

    diff --color -Naur mutter-42.0/clutter/clutter/clutter-input-pointer-a11y.c mutter-42.0-patched/clutter/clutter/clutter-input-pointer-a11y.c
    old new  
    2525
    2626#include "clutter-build-config.h"
    2727
     28#include "clutter-backend-private.h"
    2829#include "clutter-enum-types.h"
    2930#include "clutter-input-device.h"
    3031#include "clutter-input-device-private.h"
    3132#include "clutter-input-pointer-a11y-private.h"
    3233#include "clutter-main.h"
     34#include "clutter-private.h"
    3335#include "clutter-virtual-input-device.h"
    3436
    3537static gboolean
     
    726728
    727729  return (is_secondary_click_enabled (device) || is_dwell_click_enabled (device));
    728730}
     731
     732void
     733_clutter_input_pointer_a11y_maybe_handle_event (ClutterEvent *event)
     734{
     735
     736  ClutterInputDevice *device = clutter_event_get_device (event);
     737  ClutterMainContext *clutter_context;
     738  ClutterBackend *backend;
     739
     740  if (!_clutter_is_input_pointer_a11y_enabled (device))
     741    return;
     742
     743  if ((event->any.flags & CLUTTER_EVENT_FLAG_SYNTHETIC) != 0)
     744    return;
     745
     746  clutter_context = _clutter_context_get_default ();
     747  backend = clutter_context->backend;
     748
     749  if (!clutter_backend_is_display_server (backend))
     750    return;
     751
     752  if (event->type == CLUTTER_MOTION)
     753    {
     754      float x, y;
     755
     756      clutter_event_get_coords (event, &x, &y);
     757      _clutter_input_pointer_a11y_on_motion_event (device, x, y);
     758    }
     759  else if (event->type == CLUTTER_BUTTON_PRESS ||
     760           event->type == CLUTTER_BUTTON_RELEASE)
     761    {
     762      _clutter_input_pointer_a11y_on_button_event (device,
     763                                                   event->button.button,
     764                                                   event->type == CLUTTER_BUTTON_PRESS);
     765    }
     766}
  • TabularUnified clutter/clutter/clutter-input-pointer-a11y-private.h

    diff --color -Naur mutter-42.0/clutter/clutter/clutter-input-pointer-a11y-private.h mutter-42.0-patched/clutter/clutter/clutter-input-pointer-a11y-private.h
    old new  
    4242CLUTTER_EXPORT
    4343gboolean _clutter_is_input_pointer_a11y_enabled  (ClutterInputDevice     *device);
    4444
     45CLUTTER_EXPORT
     46void _clutter_input_pointer_a11y_maybe_handle_event (ClutterEvent *event);
     47
    4548G_END_DECLS
    4649
    4750#endif /* __CLUTTER_INPUT_POINTER_A11Y_H__ */
  • TabularUnified clutter/clutter/clutter-main.c

    diff --color -Naur mutter-42.0/clutter/clutter/clutter-main.c mutter-42.0-patched/clutter/clutter/clutter-main.c
    old new  
    741741void
    742742clutter_do_event (ClutterEvent *event)
    743743{
     744  ClutterActor *event_actor = NULL;
     745  ClutterContext *context = _clutter_context_get_default();
     746
    744747  /* we need the stage for the event */
    745748  if (event->any.stage == NULL)
    746749    {
     
    765768      break;
    766769    }
    767770
    768   if (_clutter_event_process_filters (event))
    769     return;
     771  _clutter_input_pointer_a11y_maybe_handle_event (event);
     772
     773  context->current_event = g_slist_prepend (context->current_event, event);
     774
     775  if (event->any.type != CLUTTER_DEVICE_ADDED &&
     776      event->any.type != CLUTTER_DEVICE_REMOVED &&
     777      event->any.type != CLUTTER_NOTHING &&
     778      event->any.type != CLUTTER_EVENT_LAST)
     779    {
     780      event_actor = clutter_stage_get_event_actor (event->any.stage, event);
     781    }
     782
     783  if (_clutter_event_process_filters (event, event_actor))
     784    {
     785      context->current_event =
     786        g_slist_delete_link (context->current_event, context->current_event);
     787
     788      return;
     789    }
     790
     791  context->current_event = g_slist_delete_link (context->current_event, context->current_event);
    770792
    771793  /* Instead of processing events when received, we queue them up to
    772794   * handle per-frame before animations, layout, and drawing.
     
    810832{
    811833  ClutterInputDevice *device = clutter_event_get_device (event);
    812834  ClutterEventSequence *sequence = clutter_event_get_event_sequence (event);
    813   ClutterMainContext *clutter_context;
    814   ClutterBackend *backend;
    815835  ClutterActor *target;
    816836
    817   clutter_context = _clutter_context_get_default ();
    818   backend = clutter_context->backend;
    819 
    820837  switch (event->type)
    821838    {
    822839      case CLUTTER_NOTHING:
     
    858875        break;
    859876
    860877      case CLUTTER_MOTION:
    861         if (clutter_backend_is_display_server (backend) &&
    862             !(event->any.flags & CLUTTER_EVENT_FLAG_SYNTHETIC))
    863           {
    864             if (_clutter_is_input_pointer_a11y_enabled (device))
    865               {
    866                 gfloat x, y;
    867 
    868                 clutter_event_get_coords (event, &x, &y);
    869                 _clutter_input_pointer_a11y_on_motion_event (device, x, y);
    870               }
    871           }
    872         G_GNUC_FALLTHROUGH;
    873878      case CLUTTER_BUTTON_PRESS:
    874879      case CLUTTER_BUTTON_RELEASE:
    875         if (clutter_backend_is_display_server (backend))
    876           {
    877             if (_clutter_is_input_pointer_a11y_enabled (device) && (event->type != CLUTTER_MOTION))
    878               {
    879                 _clutter_input_pointer_a11y_on_button_event (device,
    880                                                              event->button.button,
    881                                                              event->type == CLUTTER_BUTTON_PRESS);
    882               }
    883           }
    884 
    885         G_GNUC_FALLTHROUGH;
    886880      case CLUTTER_SCROLL:
    887881      case CLUTTER_TOUCHPAD_PINCH:
    888882      case CLUTTER_TOUCHPAD_SWIPE:
  • TabularUnified clutter/clutter/clutter-private.h

    diff --color -Naur mutter-42.0/clutter/clutter/clutter-private.h mutter-42.0-patched/clutter/clutter/clutter-private.h
    old new  
    6969#define CLUTTER_ACTOR_IN_PREF_WIDTH(a)          ((CLUTTER_PRIVATE_FLAGS (a) & CLUTTER_IN_PREF_WIDTH) != FALSE)
    7070#define CLUTTER_ACTOR_IN_PREF_HEIGHT(a)         ((CLUTTER_PRIVATE_FLAGS (a) & CLUTTER_IN_PREF_HEIGHT) != FALSE)
    7171#define CLUTTER_ACTOR_IN_PREF_SIZE(a)           ((CLUTTER_PRIVATE_FLAGS (a) & (CLUTTER_IN_PREF_HEIGHT|CLUTTER_IN_PREF_WIDTH)) != FALSE)
     72#define CLUTTER_ACTOR_IN_MAP_UNMAP(a)           ((CLUTTER_PRIVATE_FLAGS (a) & CLUTTER_IN_MAP_UNMAP) != FALSE)
    7273
    7374#define CLUTTER_PARAM_READABLE  (G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)
    7475#define CLUTTER_PARAM_WRITABLE  (G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS)
     
    105106
    106107  /* Used to avoid recursion */
    107108  CLUTTER_IN_RELAYOUT    = 1 << 7,
     109
     110  CLUTTER_IN_MAP_UNMAP   = 1 << 8,
    108111} ClutterPrivateFlags;
    109112
    110113/*
  • TabularUnified clutter/clutter/clutter-stage.c

    diff --color -Naur mutter-42.0/clutter/clutter/clutter-stage.c mutter-42.0-patched/clutter/clutter/clutter-stage.c
    old new  
    128128  int update_freeze_count;
    129129
    130130  gboolean pending_finish_queue_redraws;
     131  gboolean is_activated;
    131132
    132133  GHashTable *pointer_devices;
    133134  GHashTable *touch_sequences;
     
    579580static void
    580581clutter_stage_real_activate (ClutterStage *stage)
    581582{
     583  stage->priv->is_activated = TRUE;
     584
    582585  clutter_stage_emit_key_focus_event (stage, TRUE);
    583586}
    584587
    585588static void
    586589clutter_stage_real_deactivate (ClutterStage *stage)
    587590{
     591  stage->priv->is_activated = FALSE;
     592
    588593  clutter_stage_emit_key_focus_event (stage, FALSE);
    589594}
    590595
     
    31503155  priv->actor_needs_immediate_relayout = TRUE;
    31513156}
    31523157
    3153 static void
    3154 on_device_actor_reactive_changed (ClutterActor       *actor,
    3155                                   GParamSpec         *pspec,
    3156                                   PointerDeviceEntry *entry)
     3158void
     3159clutter_stage_pointer_actor_unreactive (ClutterStage *self,
     3160                                        ClutterActor *actor)
    31573161{
    3158   ClutterStage *self = entry->stage;
     3162  ClutterStagePrivate *priv = self->priv;
     3163  GHashTableIter iter;
     3164  gpointer value;
    31593165
    3160   g_assert (!clutter_actor_get_reactive (actor));
     3166  if (CLUTTER_ACTOR_IN_DESTRUCTION (self))
     3167    return;
    31613168
    3162   clutter_stage_pick_and_update_device (self,
    3163                                         entry->device,
    3164                                         entry->sequence,
    3165                                         CLUTTER_DEVICE_UPDATE_IGNORE_CACHE |
    3166                                         CLUTTER_DEVICE_UPDATE_EMIT_CROSSING,
    3167                                         entry->coords,
    3168                                         CLUTTER_CURRENT_TIME);
    3169 }
     3169  g_assert (!clutter_actor_is_mapped (actor) || !clutter_actor_get_reactive (actor));
    31703170
    3171 static void
    3172 on_device_actor_destroyed (ClutterActor       *actor,
    3173                            PointerDeviceEntry *entry)
    3174 {
    3175   /* Simply unset the current_actor pointer here, there's no need to
    3176    * unset has_pointer or to disconnect any signals because the actor
    3177    * is gone anyway.
    3178    */
    3179   entry->current_actor = NULL;
    3180   g_clear_pointer (&entry->clear_area, cairo_region_destroy);
    3181   clutter_stage_repick_device (entry->stage, entry->device);
     3171  g_hash_table_iter_init (&iter, priv->pointer_devices);
     3172  while (g_hash_table_iter_next (&iter, NULL, &value))
     3173    {
     3174      PointerDeviceEntry *entry = value;
     3175
     3176      if (entry->current_actor != actor)
     3177        continue;
     3178
     3179      clutter_stage_pick_and_update_device (self,
     3180                                            entry->device,
     3181                                            NULL,
     3182                                            CLUTTER_DEVICE_UPDATE_IGNORE_CACHE |
     3183                                            CLUTTER_DEVICE_UPDATE_EMIT_CROSSING,
     3184                                            entry->coords,
     3185                                            CLUTTER_CURRENT_TIME);
     3186    }
     3187
     3188  g_hash_table_iter_init (&iter, priv->touch_sequences);
     3189  while (g_hash_table_iter_next (&iter, NULL, &value))
     3190    {
     3191      PointerDeviceEntry *entry = value;
     3192
     3193      if (entry->current_actor != actor)
     3194        continue;
     3195
     3196      clutter_stage_pick_and_update_device (self,
     3197                                            entry->device,
     3198                                            entry->sequence,
     3199                                            CLUTTER_DEVICE_UPDATE_IGNORE_CACHE |
     3200                                            CLUTTER_DEVICE_UPDATE_EMIT_CROSSING,
     3201                                            entry->coords,
     3202                                            CLUTTER_CURRENT_TIME);
     3203    }
     3204
     3205  if (actor != CLUTTER_ACTOR (self))
     3206    g_assert (!clutter_actor_has_pointer (actor));
    31823207}
    31833208
    31843209static void
    31853210free_pointer_device_entry (PointerDeviceEntry *entry)
    31863211{
    31873212  if (entry->current_actor)
    3188     {
    3189       ClutterActor *actor = entry->current_actor;
    3190 
    3191       g_signal_handlers_disconnect_by_func (actor,
    3192                                             G_CALLBACK (on_device_actor_reactive_changed),
    3193                                             entry);
    3194       g_signal_handlers_disconnect_by_func (actor,
    3195                                             G_CALLBACK (on_device_actor_destroyed),
    3196                                             entry);
    3197 
    3198       _clutter_actor_set_has_pointer (actor, FALSE);
    3199    }
     3213    _clutter_actor_set_has_pointer (entry->current_actor, FALSE);
    32003214
    32013215  g_clear_pointer (&entry->clear_area, cairo_region_destroy);
    32023216
     
    32403254  if (entry->current_actor != actor)
    32413255    {
    32423256      if (entry->current_actor)
    3243         {
    3244           ClutterActor *old_actor = entry->current_actor;
    3245 
    3246           g_signal_handlers_disconnect_by_func (old_actor,
    3247                                                 G_CALLBACK (on_device_actor_reactive_changed),
    3248                                                 entry);
    3249           g_signal_handlers_disconnect_by_func (old_actor,
    3250                                                 G_CALLBACK (on_device_actor_destroyed),
    3251                                                 entry);
    3252 
    3253           _clutter_actor_set_has_pointer (old_actor, FALSE);
    3254         }
     3257        _clutter_actor_set_has_pointer (entry->current_actor, FALSE);
    32553258
    32563259      entry->current_actor = actor;
    32573260
    32583261      if (actor)
    3259         {
    3260           g_signal_connect (actor, "notify::reactive",
    3261                             G_CALLBACK (on_device_actor_reactive_changed), entry);
    3262           g_signal_connect (actor, "destroy",
    3263                             G_CALLBACK (on_device_actor_destroyed), entry);
    3264 
    3265           _clutter_actor_set_has_pointer (actor, TRUE);
    3266         }
     3262        _clutter_actor_set_has_pointer (actor, TRUE);
    32673263    }
    32683264
    32693265  g_clear_pointer (&entry->clear_area, cairo_region_destroy);
     
    34783474                                         CLUTTER_EVENT_NONE,
    34793475                                         old_actor, new_actor,
    34803476                                         point, time_ms);
    3481           if (!_clutter_event_process_filters (event))
     3477          if (!_clutter_event_process_filters (event, old_actor))
    34823478            _clutter_actor_handle_event (old_actor, root, event);
    34833479
    34843480          clutter_event_free (event);
     
    34923488                                         CLUTTER_EVENT_NONE,
    34933489                                         new_actor, old_actor,
    34943490                                         point, time_ms);
    3495           if (!_clutter_event_process_filters (event))
     3491          if (!_clutter_event_process_filters (event, new_actor))
    34963492            _clutter_actor_handle_event (new_actor, root, event);
    34973493
    34983494          clutter_event_free (event);
     
    36763672                                     grab_actor : old_grab_actor,
    36773673                                     entry->coords,
    36783674                                     CLUTTER_CURRENT_TIME);
    3679       if (!_clutter_event_process_filters (event))
     3675      if (!_clutter_event_process_filters (event, entry->current_actor))
    36803676        _clutter_actor_handle_event (deepmost, topmost, event);
    36813677      clutter_event_free (event);
    36823678    }
     
    39873983
    39883984  return NULL;
    39893985}
     3986
     3987gboolean
     3988clutter_stage_is_activated (ClutterStage *stage)
     3989{
     3990  g_return_val_if_fail (CLUTTER_IS_STAGE (stage), FALSE);
     3991
     3992  return stage->priv->is_activated;
     3993}
  • TabularUnified clutter/clutter/clutter-stage-private.h

    diff --color -Naur mutter-42.0/clutter/clutter/clutter-stage-private.h mutter-42.0-patched/clutter/clutter/clutter-stage-private.h
    old new  
    154154void clutter_stage_unlink_grab (ClutterStage *self,
    155155                                ClutterGrab  *grab);
    156156
     157gboolean clutter_stage_is_activated (ClutterStage *stage);
     158
     159void clutter_stage_pointer_actor_unreactive (ClutterStage *self,
     160                                             ClutterActor *actor);
     161
    157162G_END_DECLS
    158163
    159164#endif /* __CLUTTER_STAGE_PRIVATE_H__ */
  • TabularUnified src/backends/native/meta-stage-native.c

    diff --color -Naur mutter-42.0/src/backends/native/meta-stage-native.c mutter-42.0-patched/src/backends/native/meta-stage-native.c
    old new  
    2727#include "backends/native/meta-stage-native.h"
    2828
    2929#include "backends/meta-backend-private.h"
     30#include "backends/meta-stage-private.h"
    3031#include "backends/native/meta-crtc-virtual.h"
    3132#include "backends/native/meta-cursor-renderer-native.h"
    3233#include "backends/native/meta-renderer-native.h"
     
    171172}
    172173
    173174static void
     175meta_stage_native_constructed (GObject *object)
     176{
     177  MetaStageNative *self = META_STAGE_NATIVE (object);
     178
     179  G_OBJECT_CLASS (meta_stage_native_parent_class)->constructed (object);
     180
     181  meta_stage_set_active ((MetaStage *) self->parent.wrapper, TRUE);
     182}
     183
     184static void
    174185meta_stage_native_class_init (MetaStageNativeClass *klass)
    175186{
     187  GObjectClass *object_class = (GObjectClass *) klass;
     188
     189  object_class->constructed = meta_stage_native_constructed;
     190
    176191  quark_view_frame_closure =
    177192    g_quark_from_static_string ("-meta-native-stage-view-frame-closure");
    178193}
  • TabularUnified src/core/display.c

    diff --color -Naur mutter-42.0/src/core/display.c mutter-42.0-patched/src/core/display.c
    old new  
    14361436  else
    14371437    meta_topic (META_DEBUG_FOCUS, "Focus change has no effect, because there is no matching wayland surface");
    14381438
    1439   meta_stage_set_active (stage, focus_window == NULL);
    14401439  meta_wayland_compositor_set_input_focus (compositor, focus_window);
    14411440
    14421441  clutter_stage_repick_device (CLUTTER_STAGE (stage),
  • TabularUnified src/core/events.c

    diff --color -Naur mutter-42.0/src/core/events.c mutter-42.0-patched/src/core/events.c
    old new  
    8181
    8282static MetaWindow *
    8383get_window_for_event (MetaDisplay        *display,
    84                       const ClutterEvent *event)
     84                      const ClutterEvent *event,
     85                      ClutterActor       *event_actor)
    8586{
    8687  switch (display->event_route)
    8788    {
    8889    case META_EVENT_ROUTE_NORMAL:
    8990      {
    90         ClutterActor *target;
    9191        MetaWindowActor *window_actor;
    9292
    9393        /* Always use the key focused window for key events. */
    9494        if (IS_KEY_EVENT (event))
    9595            return stage_has_key_focus () ? display->focus_window : NULL;
    9696
    97         target = clutter_stage_get_device_actor (clutter_event_get_stage (event),
    98                                                  clutter_event_get_device (event),
    99                                                  clutter_event_get_event_sequence (event));
    100         window_actor = meta_window_actor_from_actor (target);
     97        window_actor = meta_window_actor_from_actor (event_actor);
    10198        if (window_actor)
    10299          return meta_window_actor_get_meta_window (window_actor);
    103100        else
     
    213210
    214211static gboolean
    215212meta_display_handle_event (MetaDisplay        *display,
    216                            const ClutterEvent *event)
     213                           const ClutterEvent *event,
     214                           ClutterActor       *event_actor)
    217215{
    218216  MetaBackend *backend = meta_get_backend ();
    219217  MetaWindow *window = NULL;
     
    338336    }
    339337#endif
    340338
    341   window = get_window_for_event (display, event);
     339  window = get_window_for_event (display, event, event_actor);
    342340
    343341  display->current_time = event->any.time;
    344342
     
    540538
    541539static gboolean
    542540event_callback (const ClutterEvent *event,
     541                ClutterActor       *event_actor,
    543542                gpointer            data)
    544543{
    545544  MetaDisplay *display = data;
    546545
    547   return meta_display_handle_event (display, event);
     546  return meta_display_handle_event (display, event, event_actor);
    548547}
    549548
    550549void
  • TabularUnified src/wayland/meta-wayland-surface.c

    diff --color -Naur mutter-42.0/src/wayland/meta-wayland-surface.c mutter-42.0-patched/src/wayland/meta-wayland-surface.c
    old new  
    791791  if ((get_buffer_width (surface) % surface->scale != 0) ||
    792792      (get_buffer_height (surface) % surface->scale != 0))
    793793    {
    794       wl_resource_post_error (surface->resource, WL_SURFACE_ERROR_INVALID_SIZE,
    795                               "Buffer size (%dx%d) must be an integer multiple "
    796                               "of the buffer_scale (%d)",
    797                               get_buffer_width (surface),
    798                               get_buffer_height (surface), surface->scale);
    799       goto cleanup;
     794      struct wl_resource *resource = surface->resource;
     795      pid_t pid;
     796
     797      wl_client_get_credentials (wl_resource_get_client (resource), &pid, NULL,
     798                                 NULL);
     799
     800      g_warning ("Bug in client with pid %ld: Buffer size (%dx%d) is not an"
     801                 "integer multiple of the buffer_scale (%d).", (long) pid,
     802                 get_buffer_width (surface), get_buffer_height (surface),
     803                 surface->scale);
    800804    }
    801805
    802806  if (state->has_new_buffer_transform)