diff options
author | Benjamin Otte <otte@redhat.com> | 2023-04-17 02:17:03 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2023-04-26 21:03:34 +0200 |
commit | cbe89b955a6157045debd8c2ed1dab8d30419962 (patch) | |
tree | 51a74ad586edfab2c59252a9eef2e54ef66799c3 | |
parent | 2d827978a67632d10295c88e631b3eb4290769c6 (diff) | |
download | gtk+-cbe89b955a6157045debd8c2ed1dab8d30419962.tar.gz |
x11: Get rid of sizes when constructing surfaces
Just call XCreateWindow with 0, 0, 1, 1 size.
-rw-r--r-- | gdk/x11/gdkdisplay-x11.c | 16 | ||||
-rw-r--r-- | gdk/x11/gdkdrag-x11.c | 14 | ||||
-rw-r--r-- | gdk/x11/gdkprivate-x11.h | 10 | ||||
-rw-r--r-- | gdk/x11/gdksurface-x11.c | 41 |
4 files changed, 19 insertions, 62 deletions
diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c index 793a65081c..ba03482b8c 100644 --- a/gdk/x11/gdkdisplay-x11.c +++ b/gdk/x11/gdkdisplay-x11.c @@ -1391,11 +1391,9 @@ gdk_x11_display_init_leader_surface (GdkX11Display *self) gdk_event_init (display); - self->leader_gdk_surface = - _gdk_x11_display_create_surface (display, - GDK_SURFACE_DRAG, - NULL, - -100, -100, 1, 1); + self->leader_gdk_surface = gdk_x11_display_create_surface (display, + GDK_SURFACE_DRAG, + NULL); (_gdk_x11_surface_get_toplevel (self->leader_gdk_surface))->is_leader = TRUE; self->leader_window = GDK_SURFACE_XID (self->leader_gdk_surface); @@ -2753,14 +2751,6 @@ gdk_x11_display_get_screen (GdkDisplay *display) return GDK_X11_DISPLAY (display)->screen; } -static GdkSurface * -gdk_x11_display_create_surface (GdkDisplay *display, - GdkSurfaceType surface_type, - GdkSurface *parent) -{ - return _gdk_x11_display_create_surface (display, surface_type, parent, 0, 0, 100, 100); -} - static GdkKeymap * gdk_x11_display_get_keymap (GdkDisplay *display) { diff --git a/gdk/x11/gdkdrag-x11.c b/gdk/x11/gdkdrag-x11.c index ade46a7970..abd2f138ab 100644 --- a/gdk/x11/gdkdrag-x11.c +++ b/gdk/x11/gdkdrag-x11.c @@ -1260,10 +1260,9 @@ create_drag_surface (GdkDisplay *display) { GdkSurface *surface; - surface = _gdk_x11_display_create_surface (display, - GDK_SURFACE_DRAG, - NULL, - 0, 0, 100, 100); + surface = gdk_x11_display_create_surface (display, + GDK_SURFACE_DRAG, + NULL); return surface; } @@ -2001,10 +2000,9 @@ _gdk_x11_surface_drag_begin (GdkSurface *surface, display = gdk_surface_get_display (surface); - ipc_surface = _gdk_x11_display_create_surface (display, - GDK_SURFACE_DRAG, - NULL, - -99, -99, 1, 1); + ipc_surface = gdk_x11_display_create_surface (display, + GDK_SURFACE_DRAG, + NULL); drag = (GdkDrag *) g_object_new (GDK_TYPE_X11_DRAG, "surface", ipc_surface, diff --git a/gdk/x11/gdkprivate-x11.h b/gdk/x11/gdkprivate-x11.h index cf095b6cb2..1bedb10703 100644 --- a/gdk/x11/gdkprivate-x11.h +++ b/gdk/x11/gdkprivate-x11.h @@ -173,13 +173,9 @@ void _gdk_x11_display_get_maximal_cursor_size (GdkDisplay *display, guint *width, guint *height); -GdkSurface * _gdk_x11_display_create_surface (GdkDisplay *display, - GdkSurfaceType surface_type, - GdkSurface *parent, - int x, - int y, - int width, - int height); +GdkSurface * gdk_x11_display_create_surface (GdkDisplay *display, + GdkSurfaceType surface_type, + GdkSurface *parent); GList * gdk_x11_display_get_toplevel_windows (GdkDisplay *display); void _gdk_x11_precache_atoms (GdkDisplay *display, diff --git a/gdk/x11/gdksurface-x11.c b/gdk/x11/gdksurface-x11.c index f0b54d5411..b190b8ff34 100644 --- a/gdk/x11/gdksurface-x11.c +++ b/gdk/x11/gdksurface-x11.c @@ -1197,13 +1197,9 @@ static void gdk_x11_surface_set_type_hint (GdkSurface *surface, GdkSurfaceTypeHint hint); GdkSurface * -_gdk_x11_display_create_surface (GdkDisplay *display, - GdkSurfaceType surface_type, - GdkSurface *parent, - int x, - int y, - int width, - int height) +gdk_x11_display_create_surface (GdkDisplay *display, + GdkSurfaceType surface_type, + GdkSurface *parent) { GdkSurface *surface; GdkFrameClock *frame_clock; @@ -1255,11 +1251,6 @@ _gdk_x11_display_create_surface (GdkDisplay *display, g_object_unref (frame_clock); - surface->x = x; - surface->y = y; - surface->width = width; - surface->height = height; - impl = GDK_X11_SURFACE (surface); impl->surface_scale = x11_screen->surface_scale; @@ -1292,25 +1283,8 @@ _gdk_x11_display_create_surface (GdkDisplay *display, impl->override_redirect = TRUE; } - if (surface->width * impl->surface_scale > 32767 || - surface->height * impl->surface_scale > 32767) - { - g_warning ("Native Windows wider or taller than 32767 pixels are not supported"); - - if (surface->width * impl->surface_scale > 32767) - surface->width = 32767 / impl->surface_scale; - if (surface->height * impl->surface_scale > 32767) - surface->height = 32767 / impl->surface_scale; - } - - impl->unscaled_width = surface->width * impl->surface_scale; - impl->unscaled_height = surface->height * impl->surface_scale; - impl->xid = XCreateWindow (xdisplay, xparent, - surface->x * impl->surface_scale, - surface->y * impl->surface_scale, - MAX (1, surface->width * impl->surface_scale), - MAX (1, surface->height * impl->surface_scale), + 0, 0, 1, 1, 0, gdk_x11_display_get_window_depth (display_x11), InputOutput, @@ -4435,10 +4409,9 @@ create_moveresize_surface (MoveResizeData *mv_resize, g_assert (mv_resize->moveresize_emulation_surface == NULL); mv_resize->moveresize_emulation_surface = - _gdk_x11_display_create_surface (mv_resize->display, - GDK_SURFACE_DRAG, - NULL, - -100, -100, 1, 1); + gdk_x11_display_create_surface (mv_resize->display, + GDK_SURFACE_DRAG, + NULL); gdk_surface_set_is_mapped (mv_resize->moveresize_emulation_surface, TRUE); gdk_x11_surface_show (mv_resize->moveresize_emulation_surface, FALSE); |