[gtk/wip/otte/gleanup: 26/69] x11: Simplify code




commit c5df081904ca6e23eabe135634c70cdfe37845b4
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 8b5ea3c424..11abd59723 100644
--- a/gdk/x11/gdksurface-x11.c
+++ b/gdk/x11/gdksurface-x11.c
@@ -1161,16 +1161,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;
 
@@ -1223,12 +1219,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;
 
@@ -1252,8 +1244,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)
     {
@@ -1276,7 +1266,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]