GdkSurfaceType surface_type,
GdkSurface *parent)
{
- HWND hwndNew;
HANDLE owner;
ATOM klass = 0;
DWORD dwStyle = 0, dwExStyle;
wtitle = g_utf8_to_utf16 (title, -1, NULL, NULL, NULL);
- hwndNew = CreateWindowExW (dwExStyle,
- MAKEINTRESOURCEW (klass),
- wtitle,
- dwStyle,
- CW_USEDEFAULT, CW_USEDEFAULT,
- CW_USEDEFAULT, CW_USEDEFAULT,
- owner,
- NULL,
- _gdk_dll_hinstance,
- surface);
- impl->handle = hwndNew;
-
- GetWindowRect (hwndNew, &rect);
+ impl->handle = CreateWindowExW (dwExStyle,
+ MAKEINTRESOURCEW (klass),
+ wtitle,
+ dwStyle,
+ CW_USEDEFAULT, CW_USEDEFAULT,
+ CW_USEDEFAULT, CW_USEDEFAULT,
+ owner,
+ NULL,
+ _gdk_dll_hinstance,
+ surface);
+ if (impl->handle == NULL)
+ {
+ WIN32_API_FAILED ("CreateWindowExW");
+ g_error ("Fatal error: CreateWindowExW failed.");
+ }
+
+ GetWindowRect (impl->handle, &rect);
impl->initial_x = rect.left;
impl->initial_y = rect.top;
g_free (wtitle);
- if (impl->handle == NULL)
- {
- WIN32_API_FAILED ("CreateWindowExW");
- g_object_unref (impl);
- return NULL;
- }
-
gdk_surface_set_egl_native_window (surface, (void *) impl->handle);
if (surface_type != GDK_SURFACE_DRAG)