Added support for foreign windows to the Win32 backend.

* clutter/win32/clutter-stage-win32.c
	(clutter_stage_win32_request_coords): Don't resize foreign
	windows.
	(clutter_stage_win32_unrealize): Don't destroy foreign windows.
	(clutter_stage_win32_init): Added initialiser for is_foreign_win.
	(clutter_win32_get_stage_from_window): Resort to looking in the
	stage list if the window isn't the right window class so that it
	can still find stages with foreign windows.
	(clutter_win32_set_stage_foreign): New public function to set a
	foreign window for a stage.

	* clutter/win32/clutter-event-win32.c
	(clutter_win32_disable_event_retrieval): New public function to
	disable event retrieval.
	(message_translate): Don't handle WM_SIZE or WM_MOVE for foreign
	windows.

	* clutter/win32/clutter-backend-win32.h (struct
	_ClutterBackendWin32): Added a flag to disable event retrieval

	* clutter/win32/clutter-backend-win32.c
	(clutter_backend_win32_ensure_context): Update debug note to
	include whether the stage is foreign or not.
This commit is contained in:
Neil Roberts
2008-04-15 16:12:37 +00:00
parent 429f7e64ca
commit 3d1f2a0859
7 changed files with 168 additions and 29 deletions

View File

@ -269,8 +269,9 @@ clutter_backend_win32_ensure_context (ClutterBackend *backend,
else
{
CLUTTER_NOTE (BACKEND,
"MakeCurrent window %p, context %p",
"MakeCurrent window %p (%s), context %p",
stage_win32->hwnd,
stage_win32->is_foreign_win ? "foreign" : "native",
backend_win32->gl_context);
wglMakeCurrent (stage_win32->client_dc,
backend_win32->gl_context);
@ -366,7 +367,8 @@ clutter_backend_win32_init (ClutterBackendWin32 *backend_win32)
{
ClutterBackend *backend = CLUTTER_BACKEND (backend_win32);
backend_win32->gl_context = NULL;
backend_win32->gl_context = NULL;
backend_win32->no_event_retrieval = FALSE;
/* FIXME: get from GetSystemMetric? */
clutter_backend_set_double_click_time (backend, 250);