{
ShowWindow (stage_win32->hwnd, do_raise ? SW_SHOW : SW_SHOWNA);
+ if (stage_win32->accept_focus)
+ SetForegroundWindow (stage_win32->hwnd);
+
clutter_actor_map (CLUTTER_ACTOR (stage_win32->wrapper));
}
}
RedrawWindow (hwnd, NULL, NULL, RDW_FRAME | RDW_INVALIDATE);
}
+static void
+clutter_stage_win32_set_accept_focus (ClutterStageWindow *stage_window,
+ gboolean accept_focus)
+{
+ ClutterStageWin32 *stage_win32 = CLUTTER_STAGE_WIN32 (stage_window);
+
+ accept_focus = !!accept_focus;
+
+ stage_win32->accept_focus = accept_focus;
+}
+
static ClutterActor *
clutter_stage_win32_get_wrapper (ClutterStageWindow *stage_window)
{
stage->win_height = 480;
stage->backend = NULL;
stage->scroll_pos = 0;
- stage->is_foreign_win = FALSE;
stage->wtitle = NULL;
- stage->is_cursor_visible = TRUE;
stage->wrapper = NULL;
+
+ stage->is_foreign_win = FALSE;
+ stage->is_cursor_visible = TRUE;
+ stage->accept_focus = TRUE;
}
static void
iface->set_fullscreen = clutter_stage_win32_set_fullscreen;
iface->set_cursor_visible = clutter_stage_win32_set_cursor_visible;
iface->set_user_resizable = clutter_stage_win32_set_user_resize;
+ iface->set_accept_focus = clutter_stage_win32_set_accept_focus;
iface->show = clutter_stage_win32_show;
iface->hide = clutter_stage_win32_hide;
iface->resize = clutter_stage_win32_resize;
gint win_height;
gint scroll_pos;
RECT fullscreen_rect;
- gboolean is_foreign_win;
- gboolean tracking_mouse;
wchar_t *wtitle;
- gboolean is_cursor_visible;
ClutterBackendWin32 *backend;
ClutterStageState state;
ClutterStage *wrapper;
+
+ guint is_foreign_win : 1;
+ guint tracking_mouse : 1;
+ guint is_cursor_visible : 1;
+ guint accept_focus : 1;
};
struct _ClutterStageWin32Class