[gtk/matthiasc/for-master: 3/6] x11: Stop using gdk_surface_new_temp
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/matthiasc/for-master: 3/6] x11: Stop using gdk_surface_new_temp
- Date: Thu, 8 Oct 2020 01:22:30 +0000 (UTC)
commit 839baf2bef9af07e06c948b5e1143b79035dfc9c
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Oct 7 21:01:31 2020 -0400
x11: Stop using gdk_surface_new_temp
No need to roundtrip through the frontend to create
one of our own surfaces.
gdk/x11/gdkdisplay-x11.c | 9 +++++----
gdk/x11/gdkdrag-x11.c | 10 ++++++++--
gdk/x11/gdksurface-x11.c | 8 ++++++--
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),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]