[gtk/wip/otte/gleanup: 152/182] x11: Simplify code




commit 2fee8bcd17a7f3afe7821cd9310efa7e896076ae
Author: Benjamin Otte <otte redhat com>
Date:   Sun Jun 6 17:29:29 2021 +0200

    x11: Simplify code
    
    These variables were a lot more important in GTK3, but now we just want
    to pass them through to X.

 gdk/x11/gdksurface-x11.c | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)
---
diff --git a/gdk/x11/gdksurface-x11.c b/gdk/x11/gdksurface-x11.c
index e4952f2c7b..add72799f6 100644
--- a/gdk/x11/gdksurface-x11.c
+++ b/gdk/x11/gdksurface-x11.c
@@ -1169,16 +1169,12 @@ _gdk_x11_display_create_surface (GdkDisplay     *display,
   GdkX11Display *display_x11;
 
   Window xparent;
-  Visual *xvisual;
   Display *xdisplay;
 
   XSetWindowAttributes xattributes;
   long xattributes_mask;
   XClassHint *class_hint;
 
-  unsigned int class;
-  int depth;
-
   int abs_x;
   int abs_y;
 
@@ -1231,12 +1227,8 @@ _gdk_x11_display_create_surface (GdkDisplay     *display,
 
   xattributes_mask = 0;
 
-  xvisual = gdk_x11_display_get_window_visual (display_x11);
-
   impl->override_redirect = FALSE;
 
-  class = InputOutput;
-
   xattributes.background_pixmap = None;
   xattributes_mask |= CWBackPixmap;
 
@@ -1260,8 +1252,6 @@ _gdk_x11_display_create_surface (GdkDisplay     *display,
       impl->override_redirect = TRUE;
     }
 
-  depth = gdk_x11_display_get_window_depth (display_x11);
-
   if (surface->width * impl->surface_scale > 32767 ||
       surface->height * impl->surface_scale > 32767)
     {
@@ -1284,7 +1274,10 @@ _gdk_x11_display_create_surface (GdkDisplay     *display,
                              (surface->y + abs_y) * impl->surface_scale,
                              MAX (1, surface->width * impl->surface_scale),
                              MAX (1, surface->height * impl->surface_scale),
-                             0, depth, class, xvisual,
+                             0,
+                             gdk_x11_display_get_window_depth (display_x11),
+                             InputOutput,
+                             gdk_x11_display_get_window_visual (display_x11),
                              xattributes_mask, &xattributes);
 
   g_object_ref (surface);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]