offscreenwindow: Handle window_scale
We create similar windows in the right way to get the device scale right.
This commit is contained in:
		@ -141,18 +141,11 @@ _gdk_offscreen_window_create_surface (GdkWindow *offscreen,
 | 
				
			|||||||
                                      gint       width,
 | 
					                                      gint       width,
 | 
				
			||||||
                                      gint       height)
 | 
					                                      gint       height)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  cairo_surface_t *similar;
 | 
					 | 
				
			||||||
  cairo_surface_t *surface;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  g_return_val_if_fail (GDK_IS_OFFSCREEN_WINDOW (offscreen->impl), NULL);
 | 
					  g_return_val_if_fail (GDK_IS_OFFSCREEN_WINDOW (offscreen->impl), NULL);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  similar = _gdk_window_ref_cairo_surface (offscreen->parent);
 | 
					  return gdk_window_create_similar_surface (offscreen->parent,
 | 
				
			||||||
 | 
										    CAIRO_CONTENT_COLOR_ALPHA, 
 | 
				
			||||||
  surface = cairo_surface_create_similar (similar, CAIRO_CONTENT_COLOR_ALPHA, width, height);
 | 
										    width, height);
 | 
				
			||||||
 | 
					 | 
				
			||||||
  cairo_surface_destroy (similar);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  return surface;
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void
 | 
					void
 | 
				
			||||||
@ -687,6 +680,16 @@ gdk_offscreen_window_get_frame_extents (GdkWindow    *window,
 | 
				
			|||||||
  rect->height = window->height;
 | 
					  rect->height = window->height;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					static gint
 | 
				
			||||||
 | 
					gdk_offscreen_window_get_scale_factor (GdkWindow *window)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  if (GDK_WINDOW_DESTROYED (window))
 | 
				
			||||||
 | 
					    return 1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  return gdk_window_get_scale_factor (window->parent);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void
 | 
					static void
 | 
				
			||||||
gdk_offscreen_window_class_init (GdkOffscreenWindowClass *klass)
 | 
					gdk_offscreen_window_class_init (GdkOffscreenWindowClass *klass)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
@ -773,4 +776,5 @@ gdk_offscreen_window_class_init (GdkOffscreenWindowClass *klass)
 | 
				
			|||||||
  impl_class->get_property = NULL;
 | 
					  impl_class->get_property = NULL;
 | 
				
			||||||
  impl_class->change_property = NULL;
 | 
					  impl_class->change_property = NULL;
 | 
				
			||||||
  impl_class->delete_property = NULL;
 | 
					  impl_class->delete_property = NULL;
 | 
				
			||||||
 | 
					  impl_class->get_scale_factor = gdk_offscreen_window_get_scale_factor;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user