diff -ru ../orig/unity-7.4.0+16.04.20160906/lockscreen/BackgroundSettings.cpp lockscreen/BackgroundSettings.cpp --- ../orig/unity-7.4.0+16.04.20160906/lockscreen/BackgroundSettings.cpp 2016-09-06 19:17:02.000000000 -0400 +++ lockscreen/BackgroundSettings.cpp 2017-10-09 19:50:57.516100799 -0400 @@ -53,20 +53,20 @@ auto& settings = Settings::Instance(); nux::CairoGraphics cairo_graphics(CAIRO_FORMAT_ARGB32, geo.width, geo.height); - cairo_surface_set_device_scale(cairo_graphics.GetSurface(), scale, scale); cairo_t* c = cairo_graphics.GetInternalContext(); - double s_width = geo.width / scale; - double s_height = geo.height / scale; cairo_surface_t* bg_surface = nullptr; if (settings.use_user_background()) { - bg_surface = gnome_bg_create_surface(gnome_bg_, gdk_get_default_root_window(), s_width, s_height, FALSE); + nux::Geometry const& screen_geo = UScreen::GetDefault()->GetScreenGeometry(); + cairo_surface_t* tmp = gnome_bg_create_surface(gnome_bg_, gdk_get_default_root_window(), screen_geo.width, screen_geo.height, TRUE); + bg_surface = cairo_surface_create_for_rectangle(tmp, geo.x, geo.y, geo.width, geo.height); + cairo_surface_destroy(tmp); } else if (!settings.background().empty()) { - glib::Object pixbuf(gdk_pixbuf_new_from_file_at_scale(settings.background().c_str(), s_width, s_height, FALSE, NULL)); + glib::Object pixbuf(gdk_pixbuf_new_from_file_at_scale(settings.background().c_str(), geo.width, geo.height, FALSE, NULL)); if (pixbuf) bg_surface = gdk_cairo_surface_create_from_pixbuf(pixbuf, 0, NULL); @@ -85,6 +85,10 @@ cairo_paint(c); } + cairo_surface_set_device_scale(cairo_graphics.GetSurface(), scale, scale); + double s_width = geo.width / scale; + double s_height = geo.height / scale; + if (!settings.logo().empty()) { int grid_x_offset = GetGridOffset(s_width);