From fee93d8d7b5e649cd0619e152d7d93c0472d38d3 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 1 Nov 2017 19:41:45 -0400 Subject: [PATCH] x11: Stop using gdk_screen_get_display Never necessary, we can just use the field directly. --- gdk/x11/gdkapplaunchcontext-x11.c | 2 +- gdk/x11/gdkglcontext-x11.c | 2 +- gdk/x11/gdkscreen-x11.c | 16 ++++++++-------- gdk/x11/gdkvisual-x11.c | 4 ++-- gdk/x11/gdkwindow-x11.c | 2 +- gdk/x11/xsettings-client.c | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/gdk/x11/gdkapplaunchcontext-x11.c b/gdk/x11/gdkapplaunchcontext-x11.c index a4e9800d6f..2080f19ee4 100644 --- a/gdk/x11/gdkapplaunchcontext-x11.c +++ b/gdk/x11/gdkapplaunchcontext-x11.c @@ -244,7 +244,7 @@ add_startup_timeout (GdkScreen *screen, } sn_data = g_new (StartupNotificationData, 1); - sn_data->display = g_object_ref (gdk_screen_get_display (screen)); + sn_data->display = g_object_ref (GDK_SCREEN_DISPLAY (screen)); sn_data->startup_id = g_strdup (startup_id); g_get_current_time (&sn_data->time); diff --git a/gdk/x11/gdkglcontext-x11.c b/gdk/x11/gdkglcontext-x11.c index 97500166ad..75dab823b4 100644 --- a/gdk/x11/gdkglcontext-x11.c +++ b/gdk/x11/gdkglcontext-x11.c @@ -785,7 +785,7 @@ gdk_x11_gl_context_init (GdkX11GLContext *self) gboolean gdk_x11_screen_init_gl (GdkScreen *screen) { - GdkDisplay *display = gdk_screen_get_display (screen); + GdkDisplay *display = GDK_SCREEN_DISPLAY (screen); GdkX11Display *display_x11 = GDK_X11_DISPLAY (display); Display *dpy; int error_base, event_base; diff --git a/gdk/x11/gdkscreen-x11.c b/gdk/x11/gdkscreen-x11.c index ad6505bda7..7d5e954843 100644 --- a/gdk/x11/gdkscreen-x11.c +++ b/gdk/x11/gdkscreen-x11.c @@ -179,7 +179,7 @@ get_current_desktop (GdkScreen *screen) gdk_atom_intern_static_string ("_NET_CURRENT_DESKTOP"))) return workspace; - display = GDK_DISPLAY_XDISPLAY (gdk_screen_get_display (screen)); + display = GDK_DISPLAY_XDISPLAY (GDK_SCREEN_DISPLAY (screen)); win = XRootWindow (display, gdk_x11_screen_get_screen_number (screen)); current_desktop = XInternAtom (display, "_NET_CURRENT_DESKTOP", True); @@ -220,8 +220,8 @@ gdk_x11_screen_get_work_area (GdkScreen *screen, int desktop; Display *display; - display = GDK_DISPLAY_XDISPLAY (gdk_screen_get_display (screen)); - root_window = gdk_display_get_root_window (gdk_screen_get_display (screen)); + display = GDK_SCREEN_XDISPLAY (screen); + root_window = gdk_display_get_root_window (GDK_SCREEN_DISPLAY (screen)); workarea = XInternAtom (display, "_NET_WORKAREA", True); /* Defaults in case of error */ @@ -343,7 +343,7 @@ static gboolean init_randr15 (GdkScreen *screen, gboolean *changed) { #ifdef HAVE_RANDR15 - GdkDisplay *display = gdk_screen_get_display (screen); + GdkDisplay *display = GDK_SCREEN_DISPLAY (screen); GdkX11Display *x11_display = GDK_X11_DISPLAY (display); GdkX11Screen *x11_screen = GDK_X11_SCREEN (screen); XRRScreenResources *resources; @@ -528,7 +528,7 @@ static gboolean init_randr13 (GdkScreen *screen, gboolean *changed) { #ifdef HAVE_RANDR - GdkDisplay *display = gdk_screen_get_display (screen); + GdkDisplay *display = GDK_SCREEN_DISPLAY (screen); GdkX11Display *x11_display = GDK_X11_DISPLAY (display); GdkX11Screen *x11_screen = GDK_X11_SCREEN (screen); XRRScreenResources *resources; @@ -869,7 +869,7 @@ init_randr_support (GdkScreen *screen) StructureNotifyMask); #ifdef HAVE_RANDR - if (!GDK_X11_DISPLAY (gdk_screen_get_display (screen))->have_randr12) + if (!GDK_X11_DISPLAY (GDK_SCREEN_DISPLAY (screen))->have_randr12) return; XRRSelectInput (GDK_SCREEN_XDISPLAY (screen), @@ -893,7 +893,7 @@ _gdk_x11_screen_size_changed (GdkScreen *screen, #ifdef HAVE_RANDR GdkX11Display *display_x11; - display_x11 = GDK_X11_DISPLAY (gdk_screen_get_display (screen)); + display_x11 = GDK_X11_DISPLAY (GDK_SCREEN_DISPLAY (screen)); if (display_x11->have_randr13 && event->type == ConfigureNotify) return; @@ -916,7 +916,7 @@ _gdk_x11_screen_get_edge_monitors (GdkScreen *screen, { #ifdef HAVE_XFREE_XINERAMA GdkX11Screen *x11_screen = GDK_X11_SCREEN (screen); - GdkWindow *root_window = gdk_display_get_root_window (gdk_screen_get_display (screen)); + GdkWindow *root_window = gdk_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 bottom_most_pos = 0; diff --git a/gdk/x11/gdkvisual-x11.c b/gdk/x11/gdkvisual-x11.c index ebb54c9c27..45ff54c003 100644 --- a/gdk/x11/gdkvisual-x11.c +++ b/gdk/x11/gdkvisual-x11.c @@ -268,7 +268,7 @@ _gdk_x11_screen_init_visuals (GdkScreen *screen, RootWindow (x11_screen->xdisplay, x11_screen->screen_num), xvisual, AllocNone); - gdk_display_setup_window_visual (gdk_screen_get_display (screen), + gdk_display_setup_window_visual (GDK_SCREEN_DISPLAY (screen), x11_screen->rgba_visual->depth, GDK_X11_VISUAL (x11_screen->rgba_visual)->xvisual, colormap, @@ -276,7 +276,7 @@ _gdk_x11_screen_init_visuals (GdkScreen *screen, } else { - gdk_display_setup_window_visual (gdk_screen_get_display (screen), + gdk_display_setup_window_visual (GDK_SCREEN_DISPLAY (screen), DefaultDepth (x11_screen->xdisplay, x11_screen->screen_num), DefaultVisual (x11_screen->xdisplay, x11_screen->screen_num), DefaultColormap (x11_screen->xdisplay, x11_screen->screen_num), diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c index e292b7a326..09781ff141 100644 --- a/gdk/x11/gdkwindow-x11.c +++ b/gdk/x11/gdkwindow-x11.c @@ -638,7 +638,7 @@ _gdk_x11_screen_init_root_window (GdkScreen *screen) g_assert (x11_screen->root_window == NULL); - window = x11_screen->root_window = _gdk_display_create_window (gdk_screen_get_display (screen)); + 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; diff --git a/gdk/x11/xsettings-client.c b/gdk/x11/xsettings-client.c index b661b7a97d..cc21636ecd 100644 --- a/gdk/x11/xsettings-client.c +++ b/gdk/x11/xsettings-client.c @@ -73,7 +73,7 @@ gdk_xsettings_notify (GdkX11Screen *x11_screen, const char *name, GdkSettingAction action) { - gdk_display_setting_changed (gdk_screen_get_display (GDK_SCREEN (x11_screen)), name); + gdk_display_setting_changed (x11_screen->display, name); } static gboolean