win32: Create gdk_win32_draw_surface_new()

... and use it.
This commit is contained in:
Benjamin Otte 2023-04-21 05:37:49 +02:00
parent 42cea18f3e
commit ab0fa08d8e
4 changed files with 12 additions and 21 deletions

View File

@ -427,10 +427,7 @@ wintab_init_check (GdkDeviceManagerWin32 *device_manager)
ndevices, ncursors));
#endif
/* Create a dummy window to receive wintab events */
wintab_window =
gdk_win32_display_create_surface (display,
GDK_SURFACE_DRAG,
NULL);
wintab_window = gdk_win32_drag_surface_new (display);
g_object_ref (wintab_window);

View File

@ -1644,18 +1644,6 @@ _gdk_win32_dnd_exit (void)
CoUninitialize ();
}
static GdkSurface *
create_drag_surface (GdkDisplay *display)
{
GdkSurface *surface;
surface = gdk_win32_display_create_surface (display,
GDK_SURFACE_DRAG,
NULL);
return surface;
}
GdkDrag *
_gdk_win32_surface_drag_begin (GdkSurface *surface,
GdkDevice *device,
@ -1695,7 +1683,7 @@ _gdk_win32_surface_drag_begin (GdkSurface *surface,
g_set_object (&drag_win32->grab_surface, surface);
drag_win32->drag_surface = create_drag_surface (gdk_surface_get_display (surface));
drag_win32->drag_surface = gdk_win32_drag_surface_new (gdk_surface_get_display (surface));
if (!drag_context_grab (drag))
{

View File

@ -456,10 +456,6 @@ gdk_win32_display_create_surface (GdkDisplay *display,
NULL);
break;
case GDK_SURFACE_DRAG:
surface = g_object_new (GDK_TYPE_WIN32_DRAG_SURFACE,
"display", display,
NULL);
break;
default:
g_assert_not_reached ();
break;
@ -5159,3 +5155,11 @@ _gdk_win32_surface_invalidate_egl_framebuffer (GdkSurface *surface)
}
#endif
}
GdkSurface *
gdk_win32_drag_surface_new (GdkDisplay *display)
{
return g_object_new (GDK_TYPE_WIN32_DRAG_SURFACE,
"display", display,
NULL);
}

View File

@ -364,6 +364,8 @@ void gdk_win32_surface_move_resize (GdkSurface *window,
int width,
int height);
GdkSurface *gdk_win32_drag_surface_new (GdkDisplay *display);
RECT
gdk_win32_surface_handle_queued_move_resize (GdkDrawContext *draw_context);