x11: Get rid of gdk_drawable_get_size() usage
This commit is contained in:
		@ -736,7 +736,8 @@ translate_axes (GdkDevice       *device,
 | 
			
		||||
  axes = g_new0 (gdouble, n_axes);
 | 
			
		||||
  vals = valuators->values;
 | 
			
		||||
 | 
			
		||||
  gdk_drawable_get_size (GDK_DRAWABLE (window), &width, &height);
 | 
			
		||||
  width = gdk_window_get_width (window);
 | 
			
		||||
  height = gdk_window_get_height (window);
 | 
			
		||||
 | 
			
		||||
  for (i = 0; i < valuators->mask_len * 8; i++)
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
@ -95,10 +95,9 @@ _gdk_x11_drawable_update_size (GdkDrawable *drawable)
 | 
			
		||||
  
 | 
			
		||||
  if (impl->cairo_surface)
 | 
			
		||||
    {
 | 
			
		||||
      int width, height;
 | 
			
		||||
      
 | 
			
		||||
      gdk_drawable_get_size (impl->wrapper, &width, &height);
 | 
			
		||||
      cairo_xlib_surface_set_size (impl->cairo_surface, width, height);
 | 
			
		||||
      cairo_xlib_surface_set_size (impl->cairo_surface,
 | 
			
		||||
                                   gdk_window_get_width (impl->wrapper),
 | 
			
		||||
                                   gdk_window_get_height (impl->wrapper));
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -230,11 +229,9 @@ gdk_x11_ref_cairo_surface (GdkDrawable *drawable)
 | 
			
		||||
 | 
			
		||||
  if (!impl->cairo_surface)
 | 
			
		||||
    {
 | 
			
		||||
      int width, height;
 | 
			
		||||
  
 | 
			
		||||
      gdk_drawable_get_size (impl->wrapper, &width, &height);
 | 
			
		||||
 | 
			
		||||
      impl->cairo_surface = gdk_x11_create_cairo_surface (drawable, width, height);
 | 
			
		||||
      impl->cairo_surface = gdk_x11_create_cairo_surface (drawable,
 | 
			
		||||
                                                          gdk_window_get_width (impl->wrapper),
 | 
			
		||||
                                                          gdk_window_get_height (impl->wrapper));
 | 
			
		||||
      
 | 
			
		||||
      if (impl->cairo_surface)
 | 
			
		||||
	cairo_surface_set_user_data (impl->cairo_surface, &gdk_x11_cairo_key,
 | 
			
		||||
 | 
			
		||||
@ -102,15 +102,16 @@ gdk_test_simulate_key (GdkWindow      *window,
 | 
			
		||||
  g_return_val_if_fail (window != NULL, FALSE);
 | 
			
		||||
  if (!GDK_WINDOW_IS_MAPPED (window))
 | 
			
		||||
    return FALSE;
 | 
			
		||||
 | 
			
		||||
  screen = gdk_window_get_screen (window);
 | 
			
		||||
  priv = (GdkWindowObject *)window;
 | 
			
		||||
 | 
			
		||||
  if (x < 0 && y < 0)
 | 
			
		||||
    {
 | 
			
		||||
      gdk_drawable_get_size (window, &x, &y);
 | 
			
		||||
      x /= 2;
 | 
			
		||||
      y /= 2;
 | 
			
		||||
      x = priv->width / 2;
 | 
			
		||||
      y = priv->height / 2;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  priv = (GdkWindowObject *)window;
 | 
			
		||||
  /* Convert to impl coordinates */
 | 
			
		||||
  x = x + priv->abs_x;
 | 
			
		||||
  y = y + priv->abs_y;
 | 
			
		||||
@ -208,15 +209,16 @@ gdk_test_simulate_button (GdkWindow      *window,
 | 
			
		||||
 | 
			
		||||
  if (!GDK_WINDOW_IS_MAPPED (window))
 | 
			
		||||
    return FALSE;
 | 
			
		||||
 | 
			
		||||
  screen = gdk_window_get_screen (window);
 | 
			
		||||
  priv = (GdkWindowObject *)window;
 | 
			
		||||
 | 
			
		||||
  if (x < 0 && y < 0)
 | 
			
		||||
    {
 | 
			
		||||
      gdk_drawable_get_size (window, &x, &y);
 | 
			
		||||
      x /= 2;
 | 
			
		||||
      y /= 2;
 | 
			
		||||
      x = priv->width / 2;
 | 
			
		||||
      y = priv->height / 2;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  priv = (GdkWindowObject *)window;
 | 
			
		||||
  /* Convert to impl coordinates */
 | 
			
		||||
  x = x + priv->abs_x;
 | 
			
		||||
  y = y + priv->abs_y;
 | 
			
		||||
 | 
			
		||||
@ -1352,8 +1352,8 @@ post_unmap (GdkWindow *window)
 | 
			
		||||
	  GdkRectangle invalid_rect;
 | 
			
		||||
      
 | 
			
		||||
	  gdk_window_get_position (window, &invalid_rect.x, &invalid_rect.y);
 | 
			
		||||
	  gdk_drawable_get_size (GDK_DRAWABLE (window),
 | 
			
		||||
				 &invalid_rect.width, &invalid_rect.height);
 | 
			
		||||
	  invalid_rect.width = gdk_window_get_width (window);
 | 
			
		||||
	  invalid_rect.height = gdk_window_get_height (window);
 | 
			
		||||
	  gdk_window_invalidate_rect ((GdkWindow *)private->parent,
 | 
			
		||||
				      &invalid_rect, TRUE);
 | 
			
		||||
	}
 | 
			
		||||
@ -2862,7 +2862,8 @@ gdk_window_get_frame_extents (GdkWindow    *window,
 | 
			
		||||
  /* Refine our fallback answer a bit using local information */
 | 
			
		||||
  rect->x = private->x;
 | 
			
		||||
  rect->y = private->y;
 | 
			
		||||
  gdk_drawable_get_size ((GdkDrawable *)private, &rect->width, &rect->height);
 | 
			
		||||
  rect->width = private->width;
 | 
			
		||||
  rect->height = private->height;
 | 
			
		||||
 | 
			
		||||
  impl = GDK_WINDOW_IMPL_X11 (private->impl);
 | 
			
		||||
  if (GDK_WINDOW_DESTROYED (private) || impl->override_redirect)
 | 
			
		||||
@ -5168,9 +5169,8 @@ emulate_resize_drag (GdkWindow     *window,
 | 
			
		||||
  mv_resize->moveresize_y = root_y;
 | 
			
		||||
  mv_resize->moveresize_window = g_object_ref (window);
 | 
			
		||||
 | 
			
		||||
  gdk_drawable_get_size (window,
 | 
			
		||||
			 &mv_resize->moveresize_orig_width,
 | 
			
		||||
			 &mv_resize->moveresize_orig_height);
 | 
			
		||||
  mv_resize->moveresize_orig_width = gdk_window_get_width (window);
 | 
			
		||||
  mv_resize->moveresize_orig_height = gdk_window_get_height (window);
 | 
			
		||||
 | 
			
		||||
  mv_resize->moveresize_geom_mask = 0;
 | 
			
		||||
  gdk_window_get_geometry_hints (window,
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user