summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2020-10-07 21:01:31 -0400
committerMatthias Clasen <mclasen@redhat.com>2020-10-07 21:02:22 -0400
commit839baf2bef9af07e06c948b5e1143b79035dfc9c (patch)
tree2802851d9661d35a50c06b30f8e2b2d1fbb51b61
parente602d67e59364ec6cba82c5c337f15846fe8a8ea (diff)
downloadgtk+-839baf2bef9af07e06c948b5e1143b79035dfc9c.tar.gz
x11: Stop using gdk_surface_new_temp
No need to roundtrip through the frontend to create one of our own surfaces.
-rw-r--r--gdk/x11/gdkdisplay-x11.c9
-rw-r--r--gdk/x11/gdkdrag-x11.c10
-rw-r--r--gdk/x11/gdksurface-x11.c8
3 files changed, 19 insertions, 8 deletions
diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c
index 99d21f6b2a..b6a223d914 100644
--- a/gdk/x11/gdkdisplay-x11.c
+++ b/gdk/x11/gdkdisplay-x11.c
@@ -1441,10 +1441,11 @@ gdk_x11_display_open (const char *display_name)
gdk_event_init (display);
- {
- GdkRectangle rect = { -100, -100, 1, 1 };
- display_x11->leader_gdk_surface = gdk_surface_new_temp (display, &rect);
- }
+ display_x11->leader_gdk_surface =
+ _gdk_x11_display_create_surface (display,
+ GDK_SURFACE_TEMP,
+ NULL,
+ -100, -100, 1, 1);
(_gdk_x11_surface_get_toplevel (display_x11->leader_gdk_surface))->is_leader = TRUE;
diff --git a/gdk/x11/gdkdrag-x11.c b/gdk/x11/gdkdrag-x11.c
index 80f40f17d1..8e40cab447 100644
--- a/gdk/x11/gdkdrag-x11.c
+++ b/gdk/x11/gdkdrag-x11.c
@@ -1269,7 +1269,10 @@ create_drag_surface (GdkDisplay *display)
{
GdkSurface *surface;
- surface = gdk_surface_new_temp (display, &(GdkRectangle) { 0, 0, 100, 100 });
+ surface = _gdk_x11_display_create_surface (display,
+ GDK_SURFACE_TEMP,
+ NULL,
+ 0, 0, 100, 100);
return surface;
}
@@ -1999,7 +2002,10 @@ _gdk_x11_surface_drag_begin (GdkSurface *surface,
display = gdk_surface_get_display (surface);
- ipc_surface = gdk_surface_new_temp (display, &(GdkRectangle) { -99, -99, 1, 1 });
+ ipc_surface = _gdk_x11_display_create_surface (display,
+ GDK_SURFACE_TEMP,
+ NULL,
+ -99, -99, 1, 1);
drag = (GdkDrag *) g_object_new (GDK_TYPE_X11_DRAG,
"surface", ipc_surface,
diff --git a/gdk/x11/gdksurface-x11.c b/gdk/x11/gdksurface-x11.c
index eabb298071..24b536cb96 100644
--- a/gdk/x11/gdksurface-x11.c
+++ b/gdk/x11/gdksurface-x11.c
@@ -4114,11 +4114,15 @@ create_moveresize_surface (MoveResizeData *mv_resize,
guint32 timestamp)
{
GdkGrabStatus status;
- GdkRectangle rect = { -100, -100, 1, 1 };
g_assert (mv_resize->moveresize_emulation_surface == NULL);
- mv_resize->moveresize_emulation_surface = gdk_surface_new_temp (mv_resize->display, &rect);
+ mv_resize->moveresize_emulation_surface =
+ _gdk_x11_display_create_surface (mv_resize->display,
+ GDK_SURFACE_TEMP,
+ NULL,
+ -100, -100, 1, 1);
+
gdk_x11_surface_show (mv_resize->moveresize_emulation_surface, FALSE);
status = gdk_seat_grab (gdk_device_get_seat (mv_resize->device),