示例#1
0
void
meta_set_stage_input_region (MetaScreen   *screen,
                             XserverRegion region)
{
  /* As a wayland compositor we can simply ignore all this trickery
   * for setting an input region on the stage for capturing events in
   * clutter since all input comes to us first and we get to choose
   * who else sees them.
   */
  if (!meta_is_wayland_compositor ())
    {
      MetaDisplay *display = screen->display;
      MetaCompositor *compositor = display->compositor;
      Display *xdpy = meta_display_get_xdisplay (display);
      Window xstage = clutter_x11_get_stage_window (CLUTTER_STAGE (compositor->stage));

      XFixesSetWindowShapeRegion (xdpy, xstage, ShapeInput, 0, 0, region);

      /* It's generally a good heuristic that when a crossing event is generated because
       * we reshape the overlay, we don't want it to affect focus-follows-mouse focus -
       * it's not the user doing something, it's the environment changing under the user.
       */
      meta_display_add_ignored_crossing_serial (display, XNextRequest (xdpy));
      XFixesSetWindowShapeRegion (xdpy, compositor->output, ShapeInput, 0, 0, region);
    }
}
示例#2
0
文件: compositor.c 项目: nkoep/muffin
static void
do_set_stage_input_region (MetaScreen   *screen,
                           XserverRegion region)
{
    MetaCompScreen *info = meta_screen_get_compositor_data (screen);
    MetaDisplay *display = meta_screen_get_display (screen);
    Display        *xdpy = meta_display_get_xdisplay (display);
    Window        xstage = clutter_x11_get_stage_window (CLUTTER_STAGE (info->stage));

    XFixesSetWindowShapeRegion (xdpy, xstage, ShapeInput, 0, 0, region);

    /* It's generally a good heuristic that when a crossing event is generated because
     * we reshape the overlay, we don't want it to affect focus-follows-mouse focus -
     * it's not the user doing something, it's the environment changing under the user.
     */
    meta_display_add_ignored_crossing_serial (display, XNextRequest (xdpy));
    XFixesSetWindowShapeRegion (xdpy, info->output, ShapeInput, 0, 0, region);
}