static void actor_show_cb (ClutterActor *actor, MnbInputLayer layer) { ClutterActorBox box; MnbInputRegion *mir = g_object_get_qdata (G_OBJECT (actor), quark_mir); Display *xdpy; g_assert (mgr_singleton); xdpy = meta_plugin_get_xdisplay (mgr_singleton->plugin); clutter_actor_get_allocation_box (actor, &box); if (!mir) { mir = mnb_input_manager_push_region (box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1, META_IS_WINDOW_ACTOR (actor), layer); g_object_set_qdata (G_OBJECT (actor), quark_mir, mir); } else { XRectangle rect; rect.x = box.x1; rect.y = box.y1; rect.width = box.x2 - box.x1; rect.height = box.y2 - box.y1; XFixesSetRegion (xdpy, mir->region, &rect, 1); mnb_input_manager_apply_stack (); } }
static void actor_allocation_cb (ClutterActor *actor, GParamSpec *pspec, gpointer data) { ClutterActorBox box; MnbInputRegion *mir = g_object_get_qdata (G_OBJECT (actor), quark_mir); XRectangle rect; Display *xdpy; g_assert (mgr_singleton); if (!mir) return; xdpy = meta_plugin_get_xdisplay (mgr_singleton->plugin); clutter_actor_get_allocation_box (actor, &box); rect.x = box.x1; rect.y = box.y1; rect.width = box.x2 - box.x1; rect.height = box.y2 - box.y1; XFixesSetRegion (xdpy, mir->region, &rect, 1); mnb_input_manager_apply_stack (); }
EAPI void ecore_x_region_set(Ecore_X_Region region, Ecore_X_Rectangle *rects, int num) { #ifdef ECORE_XFIXES XRectangle *xrect = _ecore_x_rectangle_ecore_to_x(rects, num); LOGFN(__FILE__, __LINE__, __FUNCTION__); XFixesSetRegion(_ecore_x_disp, region, xrect, num); #endif /* ifdef ECORE_XFIXES */ } /* ecore_x_region_set */
static void panel_show_cb (ClutterActor *actor, MnbInputLayer layer) { ClutterGeometry geom; MnbInputRegion *mir = g_object_get_qdata (G_OBJECT (actor), quark_mir); Display *xdpy; gint screen_width, screen_height; MetaScreen *screen; MetaWorkspace *workspace; g_assert (mgr_singleton); screen = meta_plugin_get_screen (mgr_singleton->plugin); workspace = meta_screen_get_active_workspace (screen); meta_plugin_query_screen_size (mgr_singleton->plugin, &screen_width, &screen_height); if (workspace) { MetaRectangle r; meta_workspace_get_work_area_all_monitors (workspace, &r); screen_height = r.y + r.height; } xdpy = meta_plugin_get_xdisplay (mgr_singleton->plugin); clutter_actor_get_geometry (actor, &geom); if (!mir) { mir = mnb_input_manager_push_region (0, geom.y + geom.height, screen_width, screen_height, FALSE, layer); g_object_set_qdata (G_OBJECT (actor), quark_mir, mir); } else { XRectangle rect; rect.x = 0; rect.y = geom.y + geom.height; rect.width = screen_width; rect.height = screen_height; XFixesSetRegion (xdpy, mir->region, &rect, 1); mnb_input_manager_apply_stack (); } }
void x11_shadow_validate_region(x11ShadowSubsystem* subsystem, int x, int y, int width, int height) { XRectangle region; if (!subsystem->use_xfixes || !subsystem->use_xdamage) return; region.x = x; region.y = y; region.width = width; region.height = height; #ifdef WITH_XFIXES XFixesSetRegion(subsystem->display, subsystem->xdamage_region, ®ion, 1); XDamageSubtract(subsystem->display, subsystem->xdamage, subsystem->xdamage_region, None); #endif }
void xf_xdamage_subtract_region(xfPeerContext* xfp, int x, int y, int width, int height) { XRectangle region; xfInfo* xfi = xfp->info; region.x = x; region.y = y; region.width = width; region.height = height; #ifdef WITH_XFIXES pthread_mutex_lock(&(xfp->mutex)); XFixesSetRegion(xfi->display, xfi->xdamage_region, ®ion, 1); XDamageSubtract(xfi->display, xfi->xdamage, xfi->xdamage_region, None); pthread_mutex_unlock(&(xfp->mutex)); #endif }
static void panel_allocation_cb (ClutterActor *actor, GParamSpec *pspec, gpointer data) { ClutterGeometry geom; MnbInputRegion *mir = g_object_get_qdata (G_OBJECT (actor), quark_mir); XRectangle rect; Display *xdpy; gint screen_width, screen_height; MetaScreen *screen; MetaWorkspace *workspace; g_assert (mgr_singleton); if (!mir) return; screen = meta_plugin_get_screen (mgr_singleton->plugin); workspace = meta_screen_get_active_workspace (screen); meta_plugin_query_screen_size (mgr_singleton->plugin, &screen_width, &screen_height); if (workspace) { MetaRectangle r; meta_workspace_get_work_area_all_monitors (workspace, &r); screen_height = r.y + r.height; } xdpy = meta_plugin_get_xdisplay (mgr_singleton->plugin); clutter_actor_get_geometry (actor, &geom); rect.x = 0; rect.y = MIN ((geom.y + geom.height), screen_height); rect.width = screen_width; rect.height = screen_height - rect.y; XFixesSetRegion (xdpy, mir->region, &rect, 1); mnb_input_manager_apply_stack (); }