static void set_foreign_window_callback (ClutterActor *actor, void *data) { ForeignWindowData *fwd = data; CLUTTER_NOTE (BACKEND, "Setting foreign window (0x%x)", (guint) fwd->hwnd); if (fwd->destroy_old_hwnd && fwd->stage_win32->hwnd != NULL) { CLUTTER_NOTE (BACKEND, "Destroying previous window (0x%x)", (guint) fwd->stage_win32->hwnd); DestroyWindow (fwd->stage_win32->hwnd); } fwd->stage_win32->hwnd = fwd->hwnd; fwd->stage_win32->is_foreign_win = TRUE; fwd->stage_win32->win_width = fwd->geom.width; fwd->stage_win32->win_height = fwd->geom.height; clutter_actor_set_size (actor, fwd->geom.width, fwd->geom.height); /* calling this with the stage unrealized will unset the stage * from the GL context; once the stage is realized the GL context * will be set again */ clutter_stage_ensure_current (CLUTTER_STAGE (actor)); }
static VALUE rbclt_stage_ensure_current (VALUE self) { ClutterStage *stage = CLUTTER_STAGE (RVAL2GOBJ (self)); clutter_stage_ensure_current (stage); return self; }
static void set_foreign_window_callback (ClutterActor *actor, void *data) { ForeignWindowClosure *closure = data; ClutterStageGdk *stage_gdk = closure->stage_gdk; stage_gdk->window = closure->window; stage_gdk->foreign_window = TRUE; /* calling this with the stage unrealized will unset the stage * from the GL context; once the stage is realized the GL context * will be set again */ clutter_stage_ensure_current (CLUTTER_STAGE (actor)); }
static void set_foreign_window_callback (ClutterActor *actor, void *data) { ForeignWindowData *fwd = data; ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (fwd->stage_x11); ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (stage_cogl->backend); CLUTTER_NOTE (BACKEND, "Setting foreign window (0x%x)", (unsigned int) fwd->xwindow); if (fwd->destroy_old_xwindow && fwd->stage_x11->xwin != None) { CLUTTER_NOTE (BACKEND, "Destroying previous window (0x%x)", (unsigned int) fwd->xwindow); XDestroyWindow (backend_x11->xdpy, fwd->stage_x11->xwin); } fwd->stage_x11->xwin = fwd->xwindow; fwd->stage_x11->is_foreign_xwin = TRUE; fwd->stage_x11->xwin_width = fwd->geom.width; fwd->stage_x11->xwin_height = fwd->geom.height; clutter_actor_set_size (actor, fwd->geom.width, fwd->geom.height); if (clutter_stages_by_xid == NULL) clutter_stages_by_xid = g_hash_table_new (NULL, NULL); g_hash_table_insert (clutter_stages_by_xid, GINT_TO_POINTER (fwd->stage_x11->xwin), fwd->stage_x11); /* calling this with the stage unrealized will unset the stage * from the GL context; once the stage is realized the GL context * will be set again */ clutter_stage_ensure_current (CLUTTER_STAGE (actor)); }