[gtk+] x11: Stop creating a root window



commit 964cdaf3a3fd74d80bcf9ac64888e6778f61e042
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Nov 13 16:39:54 2017 -0500

    x11: Stop creating a root window
    
    We no longer need it.

 gdk/x11/gdkdisplay-x11.c |    9 +--------
 gdk/x11/gdkdisplay-x11.h |    2 --
 gdk/x11/gdkprivate-x11.h |    1 -
 gdk/x11/gdkscreen-x11.c  |   24 +++---------------------
 gdk/x11/gdkscreen-x11.h  |    2 --
 gdk/x11/gdkwindow-x11.c  |   44 --------------------------------------------
 6 files changed, 4 insertions(+), 78 deletions(-)
---
diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c
index a165917..e2dd382 100644
--- a/gdk/x11/gdkdisplay-x11.c
+++ b/gdk/x11/gdkdisplay-x11.c
@@ -1419,8 +1419,7 @@ _gdk_wm_protocols_filter (GdkXEvent *xev,
       return GDK_FILTER_REMOVE;
     }
   else if (atom == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_PING") &&
-          !_gdk_x11_display_is_root_window (display,
-                                            xevent->xclient.window))
+          !_gdk_x11_display_is_root_window (display, xevent->xclient.window))
     {
       XClientMessageEvent xclient = xevent->xclient;
 
@@ -3151,12 +3150,6 @@ gdk_x11_display_get_setting (GdkDisplay  *display,
   return gdk_x11_screen_get_setting (GDK_X11_DISPLAY (display)->screen, name, value);
 }
 
-GdkWindow *
-gdk_x11_display_get_root_window (GdkDisplay *display)
-{
-  return gdk_x11_screen_get_root_window (GDK_X11_DISPLAY (display)->screen);
-}
-
 GList *
 gdk_x11_display_get_toplevel_windows (GdkDisplay *display)
 {
diff --git a/gdk/x11/gdkdisplay-x11.h b/gdk/x11/gdkdisplay-x11.h
index 3ddc777..60e6168 100644
--- a/gdk/x11/gdkdisplay-x11.h
+++ b/gdk/x11/gdkdisplay-x11.h
@@ -171,8 +171,6 @@ GdkFilterReturn _gdk_wm_protocols_filter        (GdkXEvent   *xev,
                                                  GdkEvent    *event,
                                                  gpointer     data);
 
-GdkWindow *gdk_x11_display_get_root_window (GdkDisplay *display);
-
 G_END_DECLS
 
 #endif  /* __GDK_X11_DISPLAY__ */
diff --git a/gdk/x11/gdkprivate-x11.h b/gdk/x11/gdkprivate-x11.h
index 48d4e85..ab43c39 100644
--- a/gdk/x11/gdkprivate-x11.h
+++ b/gdk/x11/gdkprivate-x11.h
@@ -272,7 +272,6 @@ gdk_window_cache_shape_filter (GdkXEvent *xev,
                                GdkEvent  *event,
                                gpointer   data);
 
-void _gdk_x11_screen_init_root_window (GdkScreen *screen);
 void _gdk_x11_screen_init_visuals     (GdkScreen *screen,
                                        gboolean   setup_display);
 
diff --git a/gdk/x11/gdkscreen-x11.c b/gdk/x11/gdkscreen-x11.c
index c16107e..6f5178e 100644
--- a/gdk/x11/gdkscreen-x11.c
+++ b/gdk/x11/gdkscreen-x11.c
@@ -73,12 +73,6 @@ gdk_x11_screen_init (GdkX11Screen *screen)
 {
 }
 
-GdkWindow *
-gdk_x11_screen_get_root_window (GdkScreen *screen)
-{
-  return GDK_X11_SCREEN (screen)->root_window;
-}
-
 static void
 gdk_x11_screen_dispose (GObject *object)
 {
@@ -96,9 +90,6 @@ gdk_x11_screen_dispose (GObject *object)
 
   _gdk_x11_xsettings_finish (x11_screen);
 
-  if (x11_screen->root_window)
-    _gdk_window_destroy (x11_screen->root_window, TRUE);
-
   for (i = 0; i < x11_screen->nvisuals; i++)
     g_object_run_dispose (G_OBJECT (x11_screen->visuals[i]));
 
@@ -116,9 +107,6 @@ gdk_x11_screen_finalize (GObject *object)
   GdkX11Screen *x11_screen = GDK_X11_SCREEN (object);
   gint          i;
 
-  if (x11_screen->root_window)
-    g_object_unref (x11_screen->root_window);
-
   /* Visual Part */
   for (i = 0; i < x11_screen->nvisuals; i++)
     g_object_unref (x11_screen->visuals[i]);
@@ -789,7 +777,7 @@ _gdk_x11_screen_new (GdkDisplay *display,
   x11_screen->xdisplay = display_x11->xdisplay;
   x11_screen->xscreen = ScreenOfDisplay (display_x11->xdisplay, screen_number);
   x11_screen->screen_num = screen_number;
-  x11_screen->xroot_window = RootWindow (display_x11->xdisplay,screen_number);
+  x11_screen->xroot_window = RootWindow (display_x11->xdisplay, screen_number);
   x11_screen->wmspec_check_window = None;
   /* we want this to be always non-null */
   x11_screen->window_manager_name = g_strdup ("unknown");
@@ -809,7 +797,6 @@ _gdk_x11_screen_new (GdkDisplay *display,
   init_multihead (screen);
 
   _gdk_x11_screen_init_visuals (screen, setup_display);
-  _gdk_x11_screen_init_root_window (screen);
 
   return screen;
 }
@@ -820,7 +807,6 @@ _gdk_x11_screen_set_window_scale (GdkX11Screen *x11_screen,
 {
   GdkX11Display *x11_display = GDK_X11_DISPLAY (x11_screen->display);
   GList *toplevels, *l;
-  GdkWindow *root;
   int i;
 
   if (x11_screen->window_scale == scale)
@@ -828,9 +814,6 @@ _gdk_x11_screen_set_window_scale (GdkX11Screen *x11_screen,
 
   x11_screen->window_scale = scale;
 
-  root = x11_screen->root_window;
-  GDK_WINDOW_IMPL_X11 (root->impl)->window_scale = scale;
-
   toplevels = gdk_x11_display_get_toplevel_windows (x11_screen->display);
 
   for (l = toplevels; l != NULL; l = l->next)
@@ -906,9 +889,8 @@ _gdk_x11_screen_get_edge_monitors (GdkScreen *screen,
 {
 #ifdef HAVE_XFREE_XINERAMA
   GdkX11Screen *x11_screen = GDK_X11_SCREEN (screen);
-  GdkWindow    *root_window = gdk_x11_display_get_root_window (GDK_SCREEN_DISPLAY (screen));
-  gint          top_most_pos = gdk_window_get_height (root_window);
-  gint          left_most_pos = gdk_window_get_width (root_window);
+  gint          top_most_pos = HeightOfScreen (x11_screen->xscreen);
+  gint          left_most_pos = WidthOfScreen (x11_screen->xscreen);
   gint          bottom_most_pos = 0;
   gint          right_most_pos = 0;
   gint          i;
diff --git a/gdk/x11/gdkscreen-x11.h b/gdk/x11/gdkscreen-x11.h
index fa7b873..5f091e0 100644
--- a/gdk/x11/gdkscreen-x11.h
+++ b/gdk/x11/gdkscreen-x11.h
@@ -40,7 +40,6 @@ struct _GdkX11Screen
   Display *xdisplay;
   Screen *xscreen;
   Window xroot_window;
-  GdkWindow *root_window;
   gint screen_num;
 
   gint window_scale;
@@ -117,7 +116,6 @@ void gdk_x11_screen_get_work_area           (GdkScreen    *screen,
 gboolean gdk_x11_screen_get_setting         (GdkScreen    *screen,
                                              const char   *name,
                                              GValue       *value);
-GdkWindow *gdk_x11_screen_get_root_window   (GdkScreen *screen);
 
 G_END_DECLS
 
diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c
index da3c6a5..2371ce5 100644
--- a/gdk/x11/gdkwindow-x11.c
+++ b/gdk/x11/gdkwindow-x11.c
@@ -624,50 +624,6 @@ gdk_x11_window_create_pixmap_surface (GdkWindow *window,
   return surface;
 }
 
-void
-_gdk_x11_screen_init_root_window (GdkScreen *screen)
-{
-  GdkWindow *window;
-  GdkWindowImplX11 *impl;
-  GdkX11Screen *x11_screen;
-
-  x11_screen = GDK_X11_SCREEN (screen);
-
-  g_assert (x11_screen->root_window == NULL);
-
-  window = x11_screen->root_window = _gdk_display_create_window (GDK_SCREEN_DISPLAY (screen));
-
-  window->impl = g_object_new (GDK_TYPE_WINDOW_IMPL_X11, NULL);
-  window->impl_window = window;
-
-  impl = GDK_WINDOW_IMPL_X11 (window->impl);
-  
-  impl->xid = x11_screen->xroot_window;
-  impl->wrapper = window;
-  impl->window_scale = x11_screen->window_scale;
-  
-  window->window_type = GDK_WINDOW_ROOT;
-
-  window->x = 0;
-  window->y = 0;
-  window->abs_x = 0;
-  window->abs_y = 0;
-  impl->unscaled_width = WidthOfScreen (x11_screen->xscreen);
-  impl->unscaled_height = HeightOfScreen (x11_screen->xscreen);
-  window->width = WidthOfScreen (x11_screen->xscreen) / impl->window_scale;
-  window->height = HeightOfScreen (x11_screen->xscreen) / impl->window_scale;
-  window->viewable = TRUE;
-
-  /* see init_randr_support() in gdkscreen-x11.c */
-  window->event_mask = GDK_STRUCTURE_MASK;
-
-  _gdk_window_update_size (x11_screen->root_window);
-
-  _gdk_x11_display_add_window (x11_screen->display,
-                               &x11_screen->xroot_window,
-                               x11_screen->root_window);
-}
-
 static void
 set_wm_protocols (GdkWindow *window)
 {


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