diff --git a/src/core/core.c b/src/core/core.c index c2ec5fec4..7583da1ea 100644 --- a/src/core/core.c +++ b/src/core/core.c @@ -775,3 +775,24 @@ meta_invalidate_default_icons (void) g_slist_free (windows); } +void +meta_core_add_old_event_mask (Display *xdisplay, + Window xwindow, + XIEventMask *mask) +{ + XIEventMask *prev; + gint n_masks, i, j; + + prev = XIGetSelectedEvents (xdisplay, xwindow, &n_masks); + + for (i = 0; i < n_masks; i++) + { + if (prev[i].deviceid != XIAllMasterDevices) + continue; + + for (j = 0; j < MIN (mask->mask_len, prev[i].mask_len); j++) + mask->mask[j] |= prev[i].mask[j]; + } + + XFree (prev); +} diff --git a/src/core/core.h b/src/core/core.h index 12451bd63..71bbcd632 100644 --- a/src/core/core.h +++ b/src/core/core.h @@ -205,8 +205,8 @@ void meta_core_increment_event_serial (Display *display); void meta_invalidate_default_icons (void); +void meta_core_add_old_event_mask (Display *xdisplay, + Window xwindow, + XIEventMask *mask); + #endif - - - -