mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-14 14:20:21 +00:00
x11: Add private gdk_x11_drag_surface_new()
... and use it.
This commit is contained in:
parent
83faacabe3
commit
486196c979
@ -1391,9 +1391,7 @@ gdk_x11_display_init_leader_surface (GdkX11Display *self)
|
|||||||
|
|
||||||
gdk_event_init (display);
|
gdk_event_init (display);
|
||||||
|
|
||||||
self->leader_gdk_surface = gdk_x11_display_create_surface (display,
|
self->leader_gdk_surface = gdk_x11_drag_surface_new (display);
|
||||||
GDK_SURFACE_DRAG,
|
|
||||||
NULL);
|
|
||||||
|
|
||||||
(_gdk_x11_surface_get_toplevel (self->leader_gdk_surface))->is_leader = TRUE;
|
(_gdk_x11_surface_get_toplevel (self->leader_gdk_surface))->is_leader = TRUE;
|
||||||
self->leader_window = GDK_SURFACE_XID (self->leader_gdk_surface);
|
self->leader_window = GDK_SURFACE_XID (self->leader_gdk_surface);
|
||||||
|
@ -1255,18 +1255,6 @@ gdk_drag_do_leave (GdkX11Drag *drag_x11)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static GdkSurface *
|
|
||||||
create_drag_surface (GdkDisplay *display)
|
|
||||||
{
|
|
||||||
GdkSurface *surface;
|
|
||||||
|
|
||||||
surface = gdk_x11_display_create_surface (display,
|
|
||||||
GDK_SURFACE_DRAG,
|
|
||||||
NULL);
|
|
||||||
|
|
||||||
return surface;
|
|
||||||
}
|
|
||||||
|
|
||||||
static Window
|
static Window
|
||||||
_gdk_x11_display_get_drag_protocol (GdkDisplay *display,
|
_gdk_x11_display_get_drag_protocol (GdkDisplay *display,
|
||||||
Window xid,
|
Window xid,
|
||||||
@ -2000,9 +1988,7 @@ _gdk_x11_surface_drag_begin (GdkSurface *surface,
|
|||||||
|
|
||||||
display = gdk_surface_get_display (surface);
|
display = gdk_surface_get_display (surface);
|
||||||
|
|
||||||
ipc_surface = gdk_x11_display_create_surface (display,
|
ipc_surface = gdk_x11_drag_surface_new (display);
|
||||||
GDK_SURFACE_DRAG,
|
|
||||||
NULL);
|
|
||||||
|
|
||||||
drag = (GdkDrag *) g_object_new (GDK_TYPE_X11_DRAG,
|
drag = (GdkDrag *) g_object_new (GDK_TYPE_X11_DRAG,
|
||||||
"surface", ipc_surface,
|
"surface", ipc_surface,
|
||||||
@ -2036,7 +2022,7 @@ _gdk_x11_surface_drag_begin (GdkSurface *surface,
|
|||||||
gdk_surface_set_is_mapped (x11_drag->ipc_surface, TRUE);
|
gdk_surface_set_is_mapped (x11_drag->ipc_surface, TRUE);
|
||||||
gdk_x11_surface_show (x11_drag->ipc_surface, FALSE);
|
gdk_x11_surface_show (x11_drag->ipc_surface, FALSE);
|
||||||
|
|
||||||
x11_drag->drag_surface = create_drag_surface (display);
|
x11_drag->drag_surface = gdk_x11_drag_surface_new (display);
|
||||||
|
|
||||||
if (!drag_grab (drag))
|
if (!drag_grab (drag))
|
||||||
{
|
{
|
||||||
|
@ -1260,10 +1260,6 @@ gdk_x11_display_create_surface (GdkDisplay *display,
|
|||||||
NULL);
|
NULL);
|
||||||
break;
|
break;
|
||||||
case GDK_SURFACE_DRAG:
|
case GDK_SURFACE_DRAG:
|
||||||
surface = g_object_new (GDK_TYPE_X11_DRAG_SURFACE,
|
|
||||||
"display", display,
|
|
||||||
NULL);
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
g_assert_not_reached ();
|
g_assert_not_reached ();
|
||||||
break;
|
break;
|
||||||
@ -4354,10 +4350,7 @@ create_moveresize_surface (MoveResizeData *mv_resize,
|
|||||||
|
|
||||||
g_assert (mv_resize->moveresize_emulation_surface == NULL);
|
g_assert (mv_resize->moveresize_emulation_surface == NULL);
|
||||||
|
|
||||||
mv_resize->moveresize_emulation_surface =
|
mv_resize->moveresize_emulation_surface = gdk_x11_drag_surface_new (mv_resize->display);
|
||||||
gdk_x11_display_create_surface (mv_resize->display,
|
|
||||||
GDK_SURFACE_DRAG,
|
|
||||||
NULL);
|
|
||||||
|
|
||||||
gdk_surface_set_is_mapped (mv_resize->moveresize_emulation_surface, TRUE);
|
gdk_surface_set_is_mapped (mv_resize->moveresize_emulation_surface, TRUE);
|
||||||
gdk_x11_surface_show (mv_resize->moveresize_emulation_surface, FALSE);
|
gdk_x11_surface_show (mv_resize->moveresize_emulation_surface, FALSE);
|
||||||
@ -5453,3 +5446,12 @@ gdk_x11_drag_surface_iface_init (GdkDragSurfaceInterface *iface)
|
|||||||
{
|
{
|
||||||
iface->present = gdk_x11_drag_surface_present;
|
iface->present = gdk_x11_drag_surface_present;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GdkSurface *
|
||||||
|
gdk_x11_drag_surface_new (GdkDisplay *display)
|
||||||
|
{
|
||||||
|
return g_object_new (GDK_TYPE_X11_DRAG_SURFACE,
|
||||||
|
"display", display,
|
||||||
|
NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -191,6 +191,8 @@ struct _GdkToplevelX11
|
|||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
GdkSurface *gdk_x11_drag_surface_new (GdkDisplay *display);
|
||||||
|
|
||||||
GdkToplevelX11 *_gdk_x11_surface_get_toplevel (GdkSurface *window);
|
GdkToplevelX11 *_gdk_x11_surface_get_toplevel (GdkSurface *window);
|
||||||
|
|
||||||
GdkCursor *_gdk_x11_surface_get_cursor (GdkSurface *window);
|
GdkCursor *_gdk_x11_surface_get_cursor (GdkSurface *window);
|
||||||
|
Loading…
Reference in New Issue
Block a user