iconhelper: Refactor ensure_surface()

Make gtk_icon_helper_ensure_surface() a private function that just
ensures the surface was loaded.

Add gtk_icon_helper_load_surface() that is called by the above function
and the dnd code to actually load the surface.
This commit is contained in:
Benjamin Otte
2015-11-30 00:55:43 +01:00
parent 2ce67f0098
commit afad393b15
3 changed files with 26 additions and 22 deletions

View File

@ -884,8 +884,8 @@ gtk_drag_get_cursor (GtkWidget *widget,
_gtk_icon_helper_get_size (info->icon_helper,
gtk_widget_get_style_context (widget),
&icon_width, &icon_height);
icon_surface = _gtk_icon_helper_ensure_surface (info->icon_helper,
gtk_widget_get_style_context (widget));
icon_surface = gtk_icon_helper_load_surface (info->icon_helper,
gtk_widget_get_style_context (widget));
icon_x = info->hot_x;
icon_y = info->hot_y;
@ -2791,7 +2791,7 @@ set_icon_helper (GdkDragContext *context,
gtk_widget_set_size_request (window, width, height);
source = _gtk_icon_helper_ensure_surface (helper, gtk_widget_get_style_context (window));
source = gtk_icon_helper_load_surface (helper, gtk_widget_get_style_context (window));
surface = gdk_window_create_similar_surface (gdk_screen_get_root_window (screen),
CAIRO_CONTENT_COLOR,
width, height);