SHA256
1
0
forked from pool/nemo
nemo/nemo-2.3.0-revert-hidpi-support.patch

2013 lines
74 KiB
Diff

Index: nemo-2.3.0/libnemo-private/nemo-file-conflict-dialog.c
===================================================================
--- nemo-2.3.0.orig/libnemo-private/nemo-file-conflict-dialog.c
+++ nemo-2.3.0/libnemo-private/nemo-file-conflict-dialog.c
@@ -78,7 +78,6 @@ file_icons_changed (NemoFile *file,
pixbuf = nemo_file_get_icon_pixbuf (fcd->details->destination,
NEMO_ICON_SIZE_LARGE,
TRUE,
- gtk_widget_get_scale_factor (fcd->details->dest_image),
NEMO_FILE_ICON_FLAGS_USE_THUMBNAILS);
gtk_image_set_from_pixbuf (GTK_IMAGE (fcd->details->dest_image), pixbuf);
@@ -87,7 +86,6 @@ file_icons_changed (NemoFile *file,
pixbuf = nemo_file_get_icon_pixbuf (fcd->details->source,
NEMO_ICON_SIZE_LARGE,
TRUE,
- gtk_widget_get_scale_factor (fcd->details->src_image),
NEMO_FILE_ICON_FLAGS_USE_THUMBNAILS);
gtk_image_set_from_pixbuf (GTK_IMAGE (fcd->details->src_image), pixbuf);
@@ -223,7 +221,6 @@ file_list_ready_cb (GList *files,
pixbuf = nemo_file_get_icon_pixbuf (dest,
NEMO_ICON_SIZE_LARGE,
TRUE,
- gtk_widget_get_scale_factor (fcd->details->titles_vbox),
NEMO_FILE_ICON_FLAGS_USE_THUMBNAILS);
details->dest_image = gtk_image_new_from_pixbuf (pixbuf);
gtk_box_pack_start (GTK_BOX (details->first_hbox),
@@ -234,7 +231,6 @@ file_list_ready_cb (GList *files,
pixbuf = nemo_file_get_icon_pixbuf (src,
NEMO_ICON_SIZE_LARGE,
TRUE,
- gtk_widget_get_scale_factor (fcd->details->titles_vbox),
NEMO_FILE_ICON_FLAGS_USE_THUMBNAILS);
details->src_image = gtk_image_new_from_pixbuf (pixbuf);
gtk_box_pack_start (GTK_BOX (details->second_hbox),
Index: nemo-2.3.0/libnemo-private/nemo-file.c
===================================================================
--- nemo-2.3.0.orig/libnemo-private/nemo-file.c
+++ nemo-2.3.0/libnemo-private/nemo-file.c
@@ -4214,7 +4214,6 @@ get_default_file_icon (NemoFileIconFlags
NemoIconInfo *
nemo_file_get_icon (NemoFile *file,
int size,
- int scale,
NemoFileIconFlags flags)
{
NemoIconInfo *icon;
@@ -4227,8 +4226,8 @@ nemo_file_get_icon (NemoFile *file,
}
gicon = get_custom_icon (file);
- if (gicon != NULL) {
- icon = nemo_icon_info_lookup (gicon, size, scale);
+ if (gicon) {
+ icon = nemo_icon_info_lookup (gicon, size);
g_object_unref (gicon);
return icon;
}
@@ -4237,9 +4236,9 @@ nemo_file_get_icon (NemoFile *file,
flags & NEMO_FILE_ICON_FLAGS_FORCE_THUMBNAIL_SIZE);
if (flags & NEMO_FILE_ICON_FLAGS_FORCE_THUMBNAIL_SIZE) {
- modified_size = size * scale;
+ modified_size = size;
} else {
- modified_size = size * scale * cached_thumbnail_size / NEMO_ICON_SIZE_STANDARD;
+ modified_size = size * cached_thumbnail_size / NEMO_ICON_SIZE_STANDARD;
DEBUG ("Modifying icon size to %d, as our cached thumbnail size is %d",
modified_size, cached_thumbnail_size);
}
@@ -4248,7 +4247,7 @@ nemo_file_get_icon (NemoFile *file,
nemo_file_should_show_thumbnail (file)) {
if (file->details->thumbnail) {
int w, h, s;
- double thumb_scale;
+ double scale;
raw_pixbuf = g_object_ref (file->details->thumbnail);
@@ -4258,23 +4257,23 @@ nemo_file_get_icon (NemoFile *file,
s = MAX (w, h);
/* Don't scale up small thumbnails in the standard view */
if (s <= cached_thumbnail_size) {
- thumb_scale = (double)size / NEMO_ICON_SIZE_STANDARD;
+ scale = (double)size / NEMO_ICON_SIZE_STANDARD;
}
else {
- thumb_scale = (double)modified_size / s;
+ scale = (double)modified_size / s;
}
/* Make sure that icons don't get smaller than NEMO_ICON_SIZE_SMALLEST */
- if (s*thumb_scale <= NEMO_ICON_SIZE_SMALLEST) {
- thumb_scale = (double) NEMO_ICON_SIZE_SMALLEST / s;
+ if (s*scale <= NEMO_ICON_SIZE_SMALLEST) {
+ scale = (double) NEMO_ICON_SIZE_SMALLEST / s;
}
scaled_pixbuf = gdk_pixbuf_scale_simple (raw_pixbuf,
- MAX (w * thumb_scale, 1),
- MAX (h * thumb_scale, 1),
+ MAX (w * scale, 1),
+ MAX (h * scale, 1),
GDK_INTERP_BILINEAR);
/* We don't want frames around small icons */
- if (!gdk_pixbuf_get_has_alpha(raw_pixbuf) || s >= 128 * scale) {
+ if (!gdk_pixbuf_get_has_alpha(raw_pixbuf) || s >= 128) {
nemo_thumbnail_frame_image (&scaled_pixbuf);
}
g_object_unref (raw_pixbuf);
@@ -4283,7 +4282,7 @@ nemo_file_get_icon (NemoFile *file,
image instead. We don't want to compare to exactly 100%,
since the zoom level 150% gives thumbnails at 144, which is
ok to scale up from 128. */
- if (modified_size > 128 * 1.25 * scale &&
+ if (modified_size > 128 * 1.25 &&
!file->details->thumbnail_wants_original &&
nemo_can_thumbnail_internally (file)) {
/* Invalidate if we resize upward */
@@ -4292,9 +4291,9 @@ nemo_file_get_icon (NemoFile *file,
}
DEBUG ("Returning thumbnailed image, at size %d %d",
- (int) (w * thumb_scale), (int) (h * thumb_scale));
+ (int) (w * scale), (int) (h * scale));
- icon = nemo_icon_info_new_for_pixbuf (scaled_pixbuf, scale);
+ icon = nemo_icon_info_new_for_pixbuf (scaled_pixbuf);
g_object_unref (scaled_pixbuf);
return icon;
} else if (file->details->thumbnail_path == NULL &&
@@ -4315,15 +4314,15 @@ nemo_file_get_icon (NemoFile *file,
gicon = nemo_file_get_gicon (file, flags);
if (gicon) {
- icon = nemo_icon_info_lookup (gicon, size, scale);
+ icon = nemo_icon_info_lookup (gicon, size);
if (nemo_icon_info_is_fallback (icon)) {
g_object_unref (icon);
- icon = nemo_icon_info_lookup (get_default_file_icon (flags), size, scale);
+ icon = nemo_icon_info_lookup (get_default_file_icon (flags), size);
}
g_object_unref (gicon);
return icon;
} else {
- return nemo_icon_info_lookup (get_default_file_icon (flags), size, scale);
+ return nemo_icon_info_lookup (get_default_file_icon (flags), size);
}
}
@@ -4331,13 +4330,12 @@ GdkPixbuf *
nemo_file_get_icon_pixbuf (NemoFile *file,
int size,
gboolean force_size,
- int scale,
NemoFileIconFlags flags)
{
NemoIconInfo *info;
GdkPixbuf *pixbuf;
- info = nemo_file_get_icon (file, size, scale, flags);
+ info = nemo_file_get_icon (file, size, flags);
if (force_size) {
pixbuf = nemo_icon_info_get_pixbuf_at_size (info, size);
} else {
Index: nemo-2.3.0/libnemo-private/nemo-file.h
===================================================================
--- nemo-2.3.0.orig/libnemo-private/nemo-file.h
+++ nemo-2.3.0/libnemo-private/nemo-file.h
@@ -457,12 +457,10 @@ GIcon * nemo_file_get_gi
NemoFileIconFlags flags);
NemoIconInfo * nemo_file_get_icon (NemoFile *file,
int size,
- int scale,
NemoFileIconFlags flags);
GdkPixbuf * nemo_file_get_icon_pixbuf (NemoFile *file,
int size,
gboolean force_size,
- int scale,
NemoFileIconFlags flags);
gboolean nemo_file_has_open_window (NemoFile *file);
Index: nemo-2.3.0/libnemo-private/nemo-icon-canvas-item.c
===================================================================
--- nemo-2.3.0.orig/libnemo-private/nemo-icon-canvas-item.c
+++ nemo-2.3.0/libnemo-private/nemo-icon-canvas-item.c
@@ -78,7 +78,7 @@ struct NemoIconCanvasItemDetails {
/* The image, text, font. */
double x, y;
GdkPixbuf *pixbuf;
- cairo_surface_t *rendered_surface;
+ GdkPixbuf * rendered_pixbuf;
char *editable_text; /* Text that can be modified by a renaming function */
char *additional_text; /* Text that cannot be modifed, such as file size, etc. */
GdkPoint *attach_points;
@@ -227,8 +227,8 @@ nemo_icon_canvas_item_finalize (GObject
g_free (details->additional_text);
g_free (details->attach_points);
- if (details->rendered_surface != NULL) {
- cairo_surface_destroy (details->rendered_surface);
+ if (details->rendered_pixbuf != NULL) {
+ g_object_unref (details->rendered_pixbuf);
}
if (details->editable_text_layout != NULL) {
@@ -432,27 +432,6 @@ nemo_icon_canvas_item_get_property (GObj
}
}
-static void
-get_scaled_icon_size (NemoIconCanvasItem *item,
- gint *width,
- gint *height)
-{
- EelCanvas *canvas;
- GdkPixbuf *pixbuf = NULL;
- gint scale;
-
- if (item != NULL) {
- canvas = EEL_CANVAS_ITEM (item)->canvas;
- scale = gtk_widget_get_scale_factor (GTK_WIDGET (canvas));
- pixbuf = item->details->pixbuf;
- }
-
- if (width)
- *width = (pixbuf == NULL) ? 0 : (gdk_pixbuf_get_width (pixbuf) / scale);
- if (height)
- *height = (pixbuf == NULL) ? 0 : (gdk_pixbuf_get_height (pixbuf) / scale);
-}
-
cairo_surface_t *
nemo_icon_canvas_item_get_drag_surface (NemoIconCanvasItem *item)
{
@@ -460,13 +439,11 @@ nemo_icon_canvas_item_get_drag_surface (
EelCanvas *canvas;
GdkScreen *screen;
int width, height;
- int pix_width, pix_height;
int item_offset_x, item_offset_y;
EelIRect icon_rect;
double item_x, item_y;
cairo_t *cr;
GtkStyleContext *context;
- cairo_surface_t *drag_surface;
g_return_val_if_fail (NEMO_IS_ICON_CANVAS_ITEM (item), NULL);
@@ -493,25 +470,18 @@ nemo_icon_canvas_item_get_drag_surface (
width = EEL_CANVAS_ITEM (item)->x2 - EEL_CANVAS_ITEM (item)->x1;
height = EEL_CANVAS_ITEM (item)->y2 - EEL_CANVAS_ITEM (item)->y1;
- surface = gdk_window_create_similar_surface (gtk_widget_get_window (GTK_WIDGET (canvas)),
+ surface = gdk_window_create_similar_surface (gdk_screen_get_root_window (screen),
CAIRO_CONTENT_COLOR_ALPHA,
width, height);
cr = cairo_create (surface);
- drag_surface = gdk_cairo_surface_create_from_pixbuf (item->details->pixbuf,
- gtk_widget_get_scale_factor (GTK_WIDGET (canvas)),
- gtk_widget_get_window (GTK_WIDGET (canvas)));
- gtk_render_icon_surface (context, cr, drag_surface,
- item_offset_x, item_offset_y);
- cairo_surface_destroy (drag_surface);
-
- get_scaled_icon_size (item, &pix_width, &pix_height);
+ gtk_render_icon (context, cr, item->details->pixbuf, item_offset_x, item_offset_y);
icon_rect.x0 = item_offset_x;
icon_rect.y0 = item_offset_y;
- icon_rect.x1 = item_offset_x + pix_width;
- icon_rect.y1 = item_offset_y + pix_height;
+ icon_rect.x1 = item_offset_x + gdk_pixbuf_get_width (item->details->pixbuf);
+ icon_rect.y1 = item_offset_y + gdk_pixbuf_get_height (item->details->pixbuf);
draw_embedded_text (item, cr,
item_offset_x, item_offset_y);
@@ -543,9 +513,9 @@ nemo_icon_canvas_item_set_image (NemoIco
if (details->pixbuf != NULL) {
g_object_unref (details->pixbuf);
}
- if (details->rendered_surface != NULL) {
- cairo_surface_destroy (details->rendered_surface);
- details->rendered_surface = NULL;
+ if (details->rendered_pixbuf != NULL) {
+ g_object_unref (details->rendered_pixbuf);
+ details->rendered_pixbuf = NULL;
}
details->pixbuf = image;
@@ -1332,14 +1302,13 @@ draw_pixbuf (GdkPixbuf *pixbuf,
}
/* shared code to highlight or dim the passed-in pixbuf */
-static cairo_surface_t *
-real_map_surface (NemoIconCanvasItem *icon_item)
+static GdkPixbuf *
+real_map_pixbuf (NemoIconCanvasItem *icon_item)
{
EelCanvas *canvas;
GdkPixbuf *temp_pixbuf, *old_pixbuf;
GtkStyleContext *style;
GdkRGBA color;
- cairo_surface_t *surface;
temp_pixbuf = icon_item->details->pixbuf;
canvas = EEL_CANVAS_ITEM(icon_item)->canvas;
@@ -1370,27 +1339,22 @@ real_map_surface (NemoIconCanvasItem *ic
g_object_unref (old_pixbuf);
}
- surface = gdk_cairo_surface_create_from_pixbuf (temp_pixbuf,
- gtk_widget_get_scale_factor (GTK_WIDGET (canvas)),
- gtk_widget_get_window (GTK_WIDGET (canvas)));
- g_object_unref (temp_pixbuf);
-
- return surface;
+ return temp_pixbuf;
}
-static cairo_surface_t *
-map_surface (NemoIconCanvasItem *icon_item)
+static GdkPixbuf *
+map_pixbuf (NemoIconCanvasItem *icon_item)
{
- if (!(icon_item->details->rendered_surface != NULL
+ if (!(icon_item->details->rendered_pixbuf != NULL
&& icon_item->details->rendered_is_prelit == icon_item->details->is_prelit
&& icon_item->details->rendered_is_highlighted_for_selection == icon_item->details->is_highlighted_for_selection
&& icon_item->details->rendered_is_highlighted_for_drop == icon_item->details->is_highlighted_for_drop
&& icon_item->details->rendered_is_highlighted_for_clipboard == icon_item->details->is_highlighted_for_clipboard
&& (icon_item->details->is_highlighted_for_selection && icon_item->details->rendered_is_focused == gtk_widget_has_focus (GTK_WIDGET (EEL_CANVAS_ITEM (icon_item)->canvas))))) {
- if (icon_item->details->rendered_surface != NULL) {
- cairo_surface_destroy (icon_item->details->rendered_surface);
+ if (icon_item->details->rendered_pixbuf != NULL) {
+ g_object_unref (icon_item->details->rendered_pixbuf);
}
- icon_item->details->rendered_surface = real_map_surface (icon_item);
+ icon_item->details->rendered_pixbuf = real_map_pixbuf (icon_item);
icon_item->details->rendered_is_prelit = icon_item->details->is_prelit;
icon_item->details->rendered_is_highlighted_for_selection = icon_item->details->is_highlighted_for_selection;
icon_item->details->rendered_is_highlighted_for_drop = icon_item->details->is_highlighted_for_drop;
@@ -1398,9 +1362,9 @@ map_surface (NemoIconCanvasItem *icon_it
icon_item->details->rendered_is_focused = gtk_widget_has_focus (GTK_WIDGET (EEL_CANVAS_ITEM (icon_item)->canvas));
}
- cairo_surface_reference (icon_item->details->rendered_surface);
+ g_object_ref (icon_item->details->rendered_pixbuf);
- return icon_item->details->rendered_surface;
+ return icon_item->details->rendered_pixbuf;
}
static void
@@ -1413,7 +1377,6 @@ draw_embedded_text (NemoIconCanvasItem *
PangoFontDescription *desc;
GtkWidget *widget;
GtkStyleContext *style_context;
- guint scale;
if (item->details->embedded_text == NULL ||
item->details->embedded_text_rect.width == 0 ||
@@ -1445,18 +1408,16 @@ draw_embedded_text (NemoIconCanvasItem *
cairo_save (cr);
- scale = gtk_widget_get_scale_factor (widget);
-
cairo_rectangle (cr,
- x + item->details->embedded_text_rect.x / scale,
- y + item->details->embedded_text_rect.y / scale,
- item->details->embedded_text_rect.width / scale,
- item->details->embedded_text_rect.height / scale);
+ x + item->details->embedded_text_rect.x,
+ y + item->details->embedded_text_rect.y,
+ item->details->embedded_text_rect.width,
+ item->details->embedded_text_rect.height);
cairo_clip (cr);
gtk_render_layout (style_context, cr,
- x + item->details->embedded_text_rect.x / scale,
- y + item->details->embedded_text_rect.y / scale,
+ x + item->details->embedded_text_rect.x,
+ y + item->details->embedded_text_rect.y,
layout);
gtk_style_context_restore (style_context);
@@ -1473,7 +1434,7 @@ nemo_icon_canvas_item_draw (EelCanvasIte
NemoIconCanvasItem *icon_item;
NemoIconCanvasItemDetails *details;
EelIRect icon_rect;
- cairo_surface_t *temp_surface;
+ GdkPixbuf *temp_pixbuf;
GtkStyleContext *context;
container = NEMO_ICON_CONTAINER (item->canvas);
@@ -1491,12 +1452,12 @@ nemo_icon_canvas_item_draw (EelCanvasIte
gtk_style_context_add_class (context, "nemo-canvas-item");
icon_rect = icon_item->details->canvas_rect;
- temp_surface = map_surface (icon_item);
+ temp_pixbuf = map_pixbuf (icon_item);
- gtk_render_icon_surface (context, cr,
- temp_surface,
+ gtk_render_icon (context, cr,
+ temp_pixbuf,
icon_rect.x0, icon_rect.y0);
- cairo_surface_destroy (temp_surface);
+ g_object_unref (temp_pixbuf);
draw_embedded_text (icon_item, cr, icon_rect.x0, icon_rect.y0);
@@ -1823,7 +1784,6 @@ nemo_icon_canvas_item_ensure_bounds_up_t
EelIRect total_rect, total_rect_for_layout, total_rect_for_entire_text;
EelCanvasItem *item;
double pixels_per_unit;
- gint width, height;
details = icon_item->details;
item = EEL_CANVAS_ITEM (icon_item);
@@ -1838,13 +1798,17 @@ nemo_icon_canvas_item_ensure_bounds_up_t
icon_rect.y0 = 0;
icon_rect_raw.x0 = 0;
icon_rect_raw.y0 = 0;
-
- get_scaled_icon_size (icon_item, &width, &height);
-
- icon_rect_raw.x1 = icon_rect_raw.x0 + width;
- icon_rect_raw.y1 = icon_rect_raw.y0 + height;
- icon_rect.x1 = icon_rect_raw.x1 / pixels_per_unit;
- icon_rect.y1 = icon_rect_raw.y1 / pixels_per_unit;
+ if (details->pixbuf == NULL) {
+ icon_rect.x1 = icon_rect.x0;
+ icon_rect.y1 = icon_rect.y0;
+ icon_rect_raw.x1 = icon_rect_raw.x0;
+ icon_rect_raw.y1 = icon_rect_raw.y0;
+ } else {
+ icon_rect_raw.x1 = icon_rect_raw.x0 + gdk_pixbuf_get_width (details->pixbuf);
+ icon_rect_raw.y1 = icon_rect_raw.y0 + gdk_pixbuf_get_height (details->pixbuf);
+ icon_rect.x1 = icon_rect_raw.x1 / pixels_per_unit;
+ icon_rect.y1 = icon_rect_raw.y1 / pixels_per_unit;
+ }
/* Compute text rectangle. */
text_rect = compute_text_rectangle (icon_item, icon_rect, FALSE, BOUNDS_USAGE_FOR_DISPLAY);
@@ -1869,17 +1833,18 @@ nemo_icon_canvas_item_get_icon_rectangle
{
EelDRect rectangle;
double pixels_per_unit;
- gint width, height;
+ GdkPixbuf *pixbuf;
g_return_val_if_fail (NEMO_IS_ICON_CANVAS_ITEM (item), eel_drect_empty);
rectangle.x0 = item->details->x;
rectangle.y0 = item->details->y;
+ pixbuf = item->details->pixbuf;
+
pixels_per_unit = EEL_CANVAS_ITEM (item)->canvas->pixels_per_unit;
- get_scaled_icon_size (NEMO_ICON_CANVAS_ITEM (item), &width, &height);
- rectangle.x1 = rectangle.x0 + width / pixels_per_unit;
- rectangle.y1 = rectangle.y0 + height / pixels_per_unit;
+ rectangle.x1 = rectangle.x0 + (pixbuf == NULL ? 0 : gdk_pixbuf_get_width (pixbuf)) / pixels_per_unit;
+ rectangle.y1 = rectangle.y0 + (pixbuf == NULL ? 0 : gdk_pixbuf_get_height (pixbuf)) / pixels_per_unit;
eel_canvas_item_i2w (EEL_CANVAS_ITEM (item),
&rectangle.x0,
@@ -1900,17 +1865,18 @@ nemo_icon_canvas_item_get_text_rectangle
EelIRect text_rectangle;
EelDRect ret;
double pixels_per_unit;
- gint width, height;
+ GdkPixbuf *pixbuf;
g_return_val_if_fail (NEMO_IS_ICON_CANVAS_ITEM (item), eel_drect_empty);
icon_rectangle.x0 = item->details->x;
icon_rectangle.y0 = item->details->y;
+ pixbuf = item->details->pixbuf;
+
pixels_per_unit = EEL_CANVAS_ITEM (item)->canvas->pixels_per_unit;
- get_scaled_icon_size (item, &width, &height);
- icon_rectangle.x1 = icon_rectangle.x0 + width / pixels_per_unit;
- icon_rectangle.y1 = icon_rectangle.y0 + height / pixels_per_unit;
+ icon_rectangle.x1 = icon_rectangle.x0 + (pixbuf == NULL ? 0 : gdk_pixbuf_get_width (pixbuf)) / pixels_per_unit;
+ icon_rectangle.y1 = icon_rectangle.y0 + (pixbuf == NULL ? 0 : gdk_pixbuf_get_height (pixbuf)) / pixels_per_unit;
measure_label_text (item);
@@ -1938,7 +1904,7 @@ static void
get_icon_canvas_rectangle (NemoIconCanvasItem *item,
EelIRect *rect)
{
- gint width, height;
+ GdkPixbuf *pixbuf;
g_assert (NEMO_IS_ICON_CANVAS_ITEM (item));
g_assert (rect != NULL);
@@ -1949,10 +1915,10 @@ get_icon_canvas_rectangle (NemoIconCanva
&rect->x0,
&rect->y0);
- get_scaled_icon_size (item, &width, &height);
+ pixbuf = item->details->pixbuf;
- rect->x1 = rect->x0 + width;
- rect->y1 = rect->y0 + height;
+ rect->x1 = rect->x0 + (pixbuf == NULL ? 0 : gdk_pixbuf_get_width (pixbuf));
+ rect->y1 = rect->y0 + (pixbuf == NULL ? 0 : gdk_pixbuf_get_height (pixbuf));
}
void
@@ -2508,7 +2474,12 @@ nemo_icon_canvas_item_accessible_get_ima
item = NEMO_ICON_CANVAS_ITEM (atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (image)));
- get_scaled_icon_size (item, width, height);
+ if (!item || !item->details->pixbuf) {
+ *width = *height = 0;
+ } else {
+ *width = gdk_pixbuf_get_width (item->details->pixbuf);
+ *height = gdk_pixbuf_get_height (item->details->pixbuf);
+ }
}
static void
@@ -2588,7 +2559,7 @@ nemo_icon_canvas_item_accessible_get_off
char *icon_text;
gboolean have_editable;
gboolean have_additional;
- gint text_offset, height;
+ gint text_offset;
atk_component_get_extents (ATK_COMPONENT (text), &real_x, &real_y,
&real_width, &real_height, coords);
@@ -2599,8 +2570,7 @@ nemo_icon_canvas_item_accessible_get_off
item = NEMO_ICON_CANVAS_ITEM (atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (text)));
if (item->details->pixbuf) {
- get_scaled_icon_size (item, NULL, &height);
- y -= height;
+ y -= gdk_pixbuf_get_height (item->details->pixbuf);
}
have_editable = item->details->editable_text != NULL &&
item->details->editable_text[0] != '\0';
@@ -2696,14 +2666,13 @@ nemo_icon_canvas_item_accessible_get_cha
PangoRectangle rect;
PangoRectangle rect0;
gboolean have_editable;
- gint text_offset, pix_height;
+ gint text_offset;
atk_component_get_position (ATK_COMPONENT (text), &pos_x, &pos_y, coords);
item = NEMO_ICON_CANVAS_ITEM (atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (text)));
if (item->details->pixbuf) {
- get_scaled_icon_size (item, NULL, &pix_height);
- pos_y += pix_height;
+ pos_y += gdk_pixbuf_get_height (item->details->pixbuf);
}
have_editable = item->details->editable_text != NULL &&
Index: nemo-2.3.0/libnemo-private/nemo-icon-info.h
===================================================================
--- nemo-2.3.0.orig/libnemo-private/nemo-icon-info.h
+++ nemo-2.3.0/libnemo-private/nemo-icon-info.h
@@ -54,17 +54,13 @@ typedef struct _NemoIconInfoClass NemoIc
GType nemo_icon_info_get_type (void) G_GNUC_CONST;
-NemoIconInfo * nemo_icon_info_new_for_pixbuf (GdkPixbuf *pixbuf,
- int scale);
+NemoIconInfo * nemo_icon_info_new_for_pixbuf (GdkPixbuf *pixbuf);
NemoIconInfo * nemo_icon_info_lookup (GIcon *icon,
- int size,
- int scale);
+ int size);
NemoIconInfo * nemo_icon_info_lookup_from_name (const char *name,
- int size,
- int scale);
+ int size);
NemoIconInfo * nemo_icon_info_lookup_from_path (const char *path,
- int size,
- int scale);
+ int size);
gboolean nemo_icon_info_is_fallback (NemoIconInfo *icon);
GdkPixbuf * nemo_icon_info_get_pixbuf (NemoIconInfo *icon);
GdkPixbuf * nemo_icon_info_get_pixbuf_nodefault (NemoIconInfo *icon);
Index: nemo-2.3.0/libnemo-private/nemo-program-choosing.c
===================================================================
--- nemo-2.3.0.orig/libnemo-private/nemo-program-choosing.c
+++ nemo-2.3.0/libnemo-private/nemo-program-choosing.c
@@ -138,7 +138,6 @@ nemo_launch_application_by_uri (GAppInfo
file = nemo_file_get_by_uri (uris->data);
icon = nemo_file_get_icon (file,
48,
- gtk_widget_get_scale_factor (GTK_WIDGET (parent_window)),
0);
nemo_file_unref (file);
if (icon) {
Index: nemo-2.3.0/libnemo-private/nemo-ui-utilities.c
===================================================================
--- nemo-2.3.0.orig/libnemo-private/nemo-ui-utilities.c
+++ nemo-2.3.0/libnemo-private/nemo-ui-utilities.c
@@ -68,8 +68,7 @@ extension_action_callback (GtkAction *ac
}
GtkAction *
-nemo_action_from_menu_item (NemoMenuItem *item,
- GtkWidget *parent_widget)
+nemo_action_from_menu_item (NemoMenuItem *item)
{
char *name, *label, *tip, *icon_name;
gboolean sensitive, priority;
@@ -89,7 +88,7 @@ nemo_action_from_menu_item (NemoMenuItem
NULL);
if (icon_name != NULL) {
- pixbuf = nemo_ui_get_menu_icon (icon_name, parent_widget);
+ pixbuf = nemo_ui_get_menu_icon (icon_name);
if (pixbuf != NULL) {
gtk_action_set_gicon (action, G_ICON (pixbuf));
g_object_unref (pixbuf);
@@ -133,21 +132,18 @@ nemo_event_should_open_in_new_tab (void)
}
GdkPixbuf *
-nemo_ui_get_menu_icon (const char *icon_name,
- GtkWidget *parent_widget)
+nemo_ui_get_menu_icon (const char *icon_name)
{
NemoIconInfo *info;
GdkPixbuf *pixbuf;
int size;
- int scale;
size = nemo_get_icon_size_for_stock_size (GTK_ICON_SIZE_MENU);
- scale = gtk_widget_get_scale_factor (parent_widget);
if (g_path_is_absolute (icon_name)) {
- info = nemo_icon_info_lookup_from_path (icon_name, size, scale);
+ info = nemo_icon_info_lookup_from_path (icon_name, size);
} else {
- info = nemo_icon_info_lookup_from_name (icon_name, size, scale);
+ info = nemo_icon_info_lookup_from_name (icon_name, size);
}
pixbuf = nemo_icon_info_get_pixbuf_nodefault_at_size (info, size);
g_object_unref (info);
Index: nemo-2.3.0/libnemo-private/nemo-ui-utilities.h
===================================================================
--- nemo-2.3.0.orig/libnemo-private/nemo-ui-utilities.h
+++ nemo-2.3.0/libnemo-private/nemo-ui-utilities.h
@@ -34,12 +34,10 @@ void nemo_ui_prepare_merge_ui
const char *name,
guint *merge_id,
GtkActionGroup **action_group);
-GtkAction * nemo_action_from_menu_item (NemoMenuItem *item,
- GtkWidget *parent_widget);
+GtkAction * nemo_action_from_menu_item (NemoMenuItem *item);
gboolean nemo_event_should_open_in_new_tab (void);
-GdkPixbuf * nemo_ui_get_menu_icon (const char *icon_name,
- GtkWidget *parent_widget);
+GdkPixbuf * nemo_ui_get_menu_icon (const char *icon_name);
#endif /* NEMO_UI_UTILITIES_H */
Index: nemo-2.3.0/src/nemo-autorun-software.c
===================================================================
--- nemo-2.3.0.orig/src/nemo-autorun-software.c
+++ nemo-2.3.0/src/nemo-autorun-software.c
@@ -210,8 +210,7 @@ present_autorun_for_software_dialog (GMo
icon = g_mount_get_icon (mount);
icon_size = nemo_get_icon_size_for_stock_size (GTK_ICON_SIZE_DIALOG);
- icon_info = nemo_icon_info_lookup (icon, icon_size,
- gtk_widget_get_scale_factor (GTK_WIDGET (dialog)));
+ icon_info = nemo_icon_info_lookup (icon, icon_size);
pixbuf = nemo_icon_info_get_pixbuf_at_size (icon_info, icon_size);
image = gtk_image_new_from_pixbuf (pixbuf);
gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0.0);
Index: nemo-2.3.0/src/nemo-desktop-window.c
===================================================================
--- nemo-2.3.0.orig/src/nemo-desktop-window.c
+++ nemo-2.3.0/src/nemo-desktop-window.c
@@ -293,8 +293,7 @@ static NemoIconInfo *
real_get_icon (NemoWindow *window,
NemoWindowSlot *slot)
{
- return nemo_icon_info_lookup_from_name (NEMO_ICON_DESKTOP, 48,
- gtk_widget_get_scale_factor (GTK_WIDGET (window)));
+ return nemo_icon_info_lookup_from_name (NEMO_ICON_DESKTOP, 48);
}
static void
Index: nemo-2.3.0/src/nemo-icon-view-container.c
===================================================================
--- nemo-2.3.0.orig/src/nemo-icon-view-container.c
+++ nemo-2.3.0/src/nemo-icon-view-container.c
@@ -68,7 +68,6 @@ nemo_icon_view_container_get_icon_images
GIcon *emblemed_icon;
GEmblem *emblem;
GList *emblem_icons, *l;
- gint scale;
file = (NemoFile *) data;
@@ -106,8 +105,7 @@ nemo_icon_view_container_get_icon_images
emblems_to_ignore);
g_strfreev (emblems_to_ignore);
- scale = gtk_widget_get_scale_factor (GTK_WIDGET (icon_view));
- icon_info = nemo_file_get_icon (file, size, scale, flags);
+ icon_info = nemo_file_get_icon (file, size, flags);
/* apply emblems */
if (emblem_icons != NULL) {
@@ -126,8 +124,8 @@ nemo_icon_view_container_get_icon_images
if (s < size)
size = s;
- bad_ratio = nemo_icon_get_emblem_size_for_icon_size (size) * scale > w ||
- nemo_icon_get_emblem_size_for_icon_size (size) * scale > h;
+ bad_ratio = nemo_icon_get_emblem_size_for_icon_size (size) > w ||
+ nemo_icon_get_emblem_size_for_icon_size (size) > h;
if (bad_ratio)
goto skip_emblem; /* Would prefer to not use goto, but
@@ -148,7 +146,7 @@ nemo_icon_view_container_get_icon_images
}
g_clear_object (&icon_info);
- icon_info = nemo_icon_info_lookup (emblemed_icon, size, scale);
+ icon_info = nemo_icon_info_lookup (emblemed_icon, size);
g_object_unref (emblemed_icon);
skip_emblem:
Index: nemo-2.3.0/src/nemo-list-model.c
===================================================================
--- nemo-2.3.0.orig/src/nemo-list-model.c
+++ nemo-2.3.0/src/nemo-list-model.c
@@ -32,7 +32,6 @@
#include <glib.h>
#include <glib/gi18n.h>
#include <gtk/gtk.h>
-#include <cairo-gobject.h>
#include <libegg/eggtreemultidnd.h>
#include <eel/eel-graphic-effects.h>
@@ -40,7 +39,6 @@
enum {
SUBDIRECTORY_UNLOADED,
- GET_ICON_SCALE,
LAST_SIGNAL
};
@@ -159,7 +157,7 @@ nemo_list_model_get_column_type (GtkTree
case NEMO_LIST_MODEL_LARGE_ICON_COLUMN:
case NEMO_LIST_MODEL_LARGER_ICON_COLUMN:
case NEMO_LIST_MODEL_LARGEST_ICON_COLUMN:
- return CAIRO_GOBJECT_TYPE_SURFACE;
+ return GDK_TYPE_PIXBUF;
case NEMO_LIST_MODEL_FILE_NAME_IS_EDITABLE_COLUMN:
return G_TYPE_BOOLEAN;
default:
@@ -244,21 +242,6 @@ nemo_list_model_get_path (GtkTreeModel *
return path;
}
-static gint
-nemo_list_model_get_icon_scale (NemoListModel *model)
-{
- gint retval = -1;
-
- g_signal_emit (model, list_model_signals[GET_ICON_SCALE], 0,
- &retval);
-
- if (retval == -1) {
- retval = gdk_screen_get_monitor_scale_factor (gdk_screen_get_default (), 0);
- }
-
- return retval;
-}
-
static void
nemo_list_model_get_value (GtkTreeModel *tree_model, GtkTreeIter *iter, int column, GValue *value)
{
@@ -271,13 +254,12 @@ nemo_list_model_get_value (GtkTreeModel
NemoIconInfo *icon_info;
GEmblem *emblem;
GList *emblem_icons, *l;
- int icon_size, icon_scale;
+ int icon_size;
NemoZoomLevel zoom_level;
NemoFile *parent_file;
char *emblems_to_ignore[3];
int i;
NemoFileIconFlags flags;
- cairo_surface_t *surface;
model = (NemoListModel *)tree_model;
@@ -305,12 +287,11 @@ nemo_list_model_get_value (GtkTreeModel
case NEMO_LIST_MODEL_LARGE_ICON_COLUMN:
case NEMO_LIST_MODEL_LARGER_ICON_COLUMN:
case NEMO_LIST_MODEL_LARGEST_ICON_COLUMN:
- g_value_init (value, CAIRO_GOBJECT_TYPE_SURFACE);
+ g_value_init (value, GDK_TYPE_PIXBUF);
if (file != NULL) {
zoom_level = nemo_list_model_get_zoom_level_from_column_id (column);
icon_size = nemo_get_list_icon_size_for_zoom_level (zoom_level);
- icon_scale = nemo_list_model_get_icon_scale (model);
flags = NEMO_FILE_ICON_FLAGS_USE_THUMBNAILS |
NEMO_FILE_ICON_FLAGS_FORCE_THUMBNAIL_SIZE |
@@ -333,7 +314,7 @@ nemo_list_model_get_value (GtkTreeModel
}
}
- GdkPixbuf *pixbuf = nemo_file_get_icon_pixbuf (file, icon_size, TRUE, icon_scale, flags);
+ GdkPixbuf *pixbuf = nemo_file_get_icon_pixbuf (file, icon_size, TRUE, flags);
gint w, h, s;
gboolean bad_ratio;
@@ -344,8 +325,8 @@ nemo_list_model_get_value (GtkTreeModel
if (s < icon_size)
icon_size = s;
- bad_ratio = nemo_icon_get_emblem_size_for_icon_size (icon_size) * icon_scale > w ||
- nemo_icon_get_emblem_size_for_icon_size (icon_size) * icon_scale > h;
+ bad_ratio = nemo_icon_get_emblem_size_for_icon_size (icon_size) > w ||
+ nemo_icon_get_emblem_size_for_icon_size (icon_size) > h;
gicon = G_ICON (pixbuf);
@@ -381,7 +362,7 @@ nemo_list_model_get_value (GtkTreeModel
g_list_free_full (emblem_icons, g_object_unref);
- icon_info = nemo_icon_info_lookup (gicon, icon_size, icon_scale);
+ icon_info = nemo_icon_info_lookup (gicon, icon_size);
icon = nemo_icon_info_get_pixbuf_at_size (icon_info, icon_size);
g_object_unref (icon_info);
@@ -399,8 +380,7 @@ nemo_list_model_get_value (GtkTreeModel
}
}
- surface = gdk_cairo_surface_create_from_pixbuf (icon, icon_scale, NULL);
- g_value_take_boxed (value, surface);
+ g_value_set_object (value, icon);
g_object_unref (icon);
}
break;
@@ -1611,13 +1591,6 @@ nemo_list_model_class_init (NemoListMode
G_TYPE_NONE, 1,
NEMO_TYPE_DIRECTORY);
- list_model_signals[GET_ICON_SCALE] =
- g_signal_new ("get-icon-scale",
- NEMO_TYPE_LIST_MODEL,
- G_SIGNAL_RUN_FIRST | G_SIGNAL_RUN_LAST,
- 0, NULL, NULL,
- NULL,
- G_TYPE_INT, 0);
}
static void
@@ -1750,4 +1723,4 @@ gboolean
nemo_list_model_get_temporarily_disable_sort (NemoListModel *model)
{
return model->details->temp_unsorted;
-}
\ No newline at end of file
+}
Index: nemo-2.3.0/src/nemo-list-view.c
===================================================================
--- nemo-2.3.0.orig/src/nemo-list-view.c
+++ nemo-2.3.0/src/nemo-list-view.c
@@ -483,13 +483,13 @@ stop_drag_check (NemoListView *view)
view->details->drag_button = 0;
}
-static cairo_surface_t *
-get_drag_surface (NemoListView *view)
+static GdkPixbuf *
+get_drag_pixbuf (NemoListView *view)
{
GtkTreeModel *model;
GtkTreePath *path;
GtkTreeIter iter;
- cairo_surface_t *ret;
+ GdkPixbuf *ret;
GdkRectangle cell_area;
ret = NULL;
@@ -522,13 +522,14 @@ drag_begin_callback (GtkWidget *widget,
NemoListView *view)
{
GList *ref_list;
+ GdkPixbuf *pixbuf;
- cairo_surface_t *surface;
-
- surface = get_drag_surface (view);
- if (surface) {
- gtk_drag_set_icon_surface (context, surface);
- cairo_surface_destroy (surface);
+ pixbuf = get_drag_pixbuf (view);
+ if (pixbuf) {
+ gtk_drag_set_icon_pixbuf (context,
+ pixbuf,
+ 0, 0);
+ g_object_unref (pixbuf);
} else {
gtk_drag_set_icon_default (context);
}
@@ -1898,13 +1899,6 @@ focus_in_event_callback (GtkWidget *widg
return FALSE;
}
-static gint
-get_icon_scale_callback (NemoListModel *model,
- NemoListView *view)
-{
- return gtk_widget_get_scale_factor (GTK_WIDGET (view->details->tree_view));
-}
-
static void
create_and_set_up_tree_view (NemoListView *view)
{
@@ -2001,9 +1995,6 @@ create_and_set_up_tree_view (NemoListVie
g_signal_connect_object (view->details->model, "subdirectory_unloaded",
G_CALLBACK (subdirectory_unloaded_callback), view, 0);
- g_signal_connect_object (view->details->model, "get-icon-scale",
- G_CALLBACK (get_icon_scale_callback), view, 0);
-
gtk_tree_selection_set_mode (gtk_tree_view_get_selection (view->details->tree_view), GTK_SELECTION_MULTIPLE);
gtk_tree_view_set_rules_hint (view->details->tree_view, TRUE);
@@ -2055,7 +2046,7 @@ create_and_set_up_tree_view (NemoListVie
gtk_tree_view_column_pack_start (view->details->file_name_column, cell, FALSE);
gtk_tree_view_column_set_attributes (view->details->file_name_column,
cell,
- "surface", NEMO_LIST_MODEL_SMALLEST_ICON_COLUMN,
+ "pixbuf", NEMO_LIST_MODEL_SMALLEST_ICON_COLUMN,
NULL);
cell = gtk_cell_renderer_text_new ();
@@ -3038,7 +3029,7 @@ nemo_list_view_set_zoom_level (NemoListV
column = nemo_list_model_get_column_id_from_zoom_level (new_level);
gtk_tree_view_column_set_attributes (view->details->file_name_column,
GTK_CELL_RENDERER (view->details->pixbuf_cell),
- "surface", column,
+ "pixbuf", column,
NULL);
/* Scale text. */
Index: nemo-2.3.0/src/nemo-places-sidebar.c
===================================================================
--- nemo-2.3.0.orig/src/nemo-places-sidebar.c
+++ nemo-2.3.0/src/nemo-places-sidebar.c
@@ -29,7 +29,6 @@
#include <glib/gi18n.h>
#include <gio/gio.h>
#include <math.h>
-#include <cairo-gobject.h>
#include <libnemo-private/nemo-dnd.h>
#include <libnemo-private/nemo-bookmark.h>
@@ -260,7 +259,7 @@ static GtkTreeStore *nemo_shortcuts_mode
G_DEFINE_TYPE (NemoPlacesSidebar, nemo_places_sidebar, GTK_TYPE_SCROLLED_WINDOW);
-static cairo_surface_t *
+static GdkPixbuf *
get_eject_icon (NemoPlacesSidebar *sidebar,
gboolean highlighted)
{
@@ -271,14 +270,11 @@ get_eject_icon (NemoPlacesSidebar *sideb
GtkIconTheme *icon_theme;
GtkStyleContext *style;
GtkStateFlags state;
- cairo_surface_t *surface;
- gint scale = 1;
- scale = gtk_widget_get_scale_factor (GTK_WIDGET (sidebar));
icon_theme = gtk_icon_theme_get_default ();
icon_size = nemo_get_icon_size_for_stock_size (GTK_ICON_SIZE_MENU);
icon = g_themed_icon_new_with_default_fallbacks ("nemo-eject");
- icon_info = gtk_icon_theme_lookup_by_gicon_for_scale (icon_theme, icon, icon_size, scale, 0);
+ icon_info = gtk_icon_theme_lookup_by_gicon (icon_theme, icon, icon_size, 0);
style = gtk_widget_get_style_context (GTK_WIDGET (sidebar));
gtk_style_context_save (style);
@@ -310,9 +306,7 @@ get_eject_icon (NemoPlacesSidebar *sideb
gtk_style_context_restore (style);
g_object_unref (icon);
- surface = gdk_cairo_surface_create_from_pixbuf (eject, scale, NULL);
- g_object_unref (eject);
- return surface;
+ return eject;
}
static gboolean
@@ -404,27 +398,20 @@ add_place (NemoPlacesSidebar *sidebar,
{
GdkPixbuf *pixbuf;
GtkTreeIter iter;
- cairo_surface_t *eject;
+ GdkPixbuf *eject;
NemoIconInfo *icon_info;
int icon_size;
gboolean show_eject, show_unmount;
gboolean show_eject_button;
- gint scale;
- cairo_surface_t *surface;
-
- scale = gtk_widget_get_scale_factor (GTK_WIDGET (sidebar));
cat_iter = check_heading_for_devices (sidebar, section_type, cat_iter);
icon_size = nemo_get_icon_size_for_stock_size (GTK_ICON_SIZE_MENU);
- icon_info = nemo_icon_info_lookup (icon, icon_size, scale);
+ icon_info = nemo_icon_info_lookup (icon, icon_size);
pixbuf = nemo_icon_info_get_pixbuf_at_size (icon_info, icon_size);
g_object_unref (icon_info);
-
- surface = gdk_cairo_surface_create_from_pixbuf (pixbuf, scale, NULL);
- g_object_unref (pixbuf);
check_unmount_and_eject (mount, volume, drive,
&show_unmount, &show_eject);
@@ -447,7 +434,7 @@ add_place (NemoPlacesSidebar *sidebar,
gtk_tree_store_append (sidebar->store, &iter, &cat_iter);
gtk_tree_store_set (sidebar->store, &iter,
- PLACES_SIDEBAR_COLUMN_ICON, surface,
+ PLACES_SIDEBAR_COLUMN_ICON, pixbuf,
PLACES_SIDEBAR_COLUMN_NAME, name,
PLACES_SIDEBAR_COLUMN_URI, uri,
PLACES_SIDEBAR_COLUMN_DRIVE, drive,
@@ -465,6 +452,10 @@ add_place (NemoPlacesSidebar *sidebar,
PLACES_SIDEBAR_COLUMN_SHOW_DF, show_df_percent,
-1);
+ if (pixbuf != NULL) {
+ g_object_unref (pixbuf);
+ }
+
return cat_iter;
}
@@ -3905,7 +3896,7 @@ nemo_places_sidebar_init (NemoPlacesSide
cell = gtk_cell_renderer_pixbuf_new ();
gtk_tree_view_column_pack_start (col, cell, FALSE);
gtk_tree_view_column_set_attributes (col, cell,
- "surface", PLACES_SIDEBAR_COLUMN_ICON,
+ "pixbuf", PLACES_SIDEBAR_COLUMN_ICON,
NULL);
gtk_tree_view_column_set_cell_data_func (col, cell,
icon_cell_renderer_func,
@@ -3935,7 +3926,7 @@ nemo_places_sidebar_init (NemoPlacesSide
gtk_tree_view_column_pack_start (eject_col, cell, FALSE);
gtk_tree_view_column_set_attributes (eject_col, cell,
"visible", PLACES_SIDEBAR_COLUMN_EJECT,
- "surface", PLACES_SIDEBAR_COLUMN_EJECT_ICON,
+ "pixbuf", PLACES_SIDEBAR_COLUMN_EJECT_ICON,
NULL);
/* normal text renderer */
@@ -4267,13 +4258,13 @@ nemo_shortcuts_model_new (NemoPlacesSide
G_TYPE_VOLUME,
G_TYPE_MOUNT,
G_TYPE_STRING,
- CAIRO_GOBJECT_TYPE_SURFACE,
+ GDK_TYPE_PIXBUF,
G_TYPE_INT,
G_TYPE_BOOLEAN,
G_TYPE_BOOLEAN,
G_TYPE_BOOLEAN,
G_TYPE_STRING,
- CAIRO_GOBJECT_TYPE_SURFACE,
+ GDK_TYPE_PIXBUF,
G_TYPE_INT,
G_TYPE_STRING,
G_TYPE_INT,
Index: nemo-2.3.0/src/nemo-properties-window.c
===================================================================
--- nemo-2.3.0.orig/src/nemo-properties-window.c
+++ nemo-2.3.0/src/nemo-properties-window.c
@@ -358,21 +358,19 @@ get_image_for_properties_window (NemoPro
{
NemoIconInfo *icon, *new_icon;
GList *l;
- gint icon_scale;
icon = NULL;
- icon_scale = gtk_widget_get_scale_factor (GTK_WIDGET (window->details->notebook));
for (l = window->details->original_files; l != NULL; l = l->next) {
NemoFile *file;
file = NEMO_FILE (l->data);
if (!icon) {
- icon = nemo_file_get_icon (file, NEMO_ICON_SIZE_STANDARD, icon_scale,
+ icon = nemo_file_get_icon (file, NEMO_ICON_SIZE_STANDARD,
NEMO_FILE_ICON_FLAGS_USE_THUMBNAILS |
NEMO_FILE_ICON_FLAGS_IGNORE_VISITING);
} else {
- new_icon = nemo_file_get_icon (file, NEMO_ICON_SIZE_STANDARD, icon_scale,
+ new_icon = nemo_file_get_icon (file, NEMO_ICON_SIZE_STANDARD,
NEMO_FILE_ICON_FLAGS_USE_THUMBNAILS |
NEMO_FILE_ICON_FLAGS_IGNORE_VISITING);
if (!new_icon || new_icon != icon) {
@@ -386,7 +384,7 @@ get_image_for_properties_window (NemoPro
}
if (!icon) {
- icon = nemo_icon_info_lookup_from_name ("text-x-generic", NEMO_ICON_SIZE_STANDARD, icon_scale);
+ icon = nemo_icon_info_lookup_from_name ("text-x-generic", NEMO_ICON_SIZE_STANDARD);
}
if (icon_name != NULL) {
@@ -402,12 +400,14 @@ get_image_for_properties_window (NemoPro
static void
-update_properties_window_icon (NemoPropertiesWindow *window)
+update_properties_window_icon (GtkImage *image)
{
+ NemoPropertiesWindow *window;
GdkPixbuf *pixbuf;
- cairo_surface_t *surface;
char *name;
+ window = g_object_get_data (G_OBJECT (image), "properties_window");
+
get_image_for_properties_window (window, &name, &pixbuf);
if (name != NULL) {
@@ -416,13 +416,10 @@ update_properties_window_icon (NemoPrope
gtk_window_set_icon (GTK_WINDOW (window), pixbuf);
}
- surface = gdk_cairo_surface_create_from_pixbuf (pixbuf, gtk_widget_get_scale_factor (GTK_WIDGET (window)),
- gtk_widget_get_window (GTK_WIDGET (window)));
- gtk_image_set_from_surface (GTK_IMAGE (window->details->icon_image), surface);
+ gtk_image_set_from_pixbuf (image, pixbuf);
g_free (name);
g_object_unref (pixbuf);
- cairo_surface_destroy (surface);
}
/* utility to test if a uri refers to a local image */
@@ -522,11 +519,11 @@ create_image_widget (NemoPropertiesWindo
{
GtkWidget *button;
GtkWidget *image;
+ GdkPixbuf *pixbuf;
- image = gtk_image_new ();
- window->details->icon_image = image;
+ get_image_for_properties_window (window, NULL, &pixbuf);
- update_properties_window_icon (window);
+ image = gtk_image_new ();
gtk_widget_show (image);
button = NULL;
@@ -546,6 +543,11 @@ create_image_widget (NemoPropertiesWindo
G_CALLBACK (select_image_button_callback), window);
}
+ gtk_image_set_from_pixbuf (GTK_IMAGE (image), pixbuf);
+ g_object_unref (pixbuf);
+ g_object_set_data (G_OBJECT (image), "properties_window", window);
+ window->details->icon_image = image;
+
window->details->icon_button = button;
return button != NULL ? button : image;
@@ -994,7 +996,7 @@ properties_window_update (NemoProperties
if (dirty_original) {
update_properties_window_title (window);
- update_properties_window_icon (window);
+ update_properties_window_icon (GTK_IMAGE (window->details->icon_image));
update_name_field (window);
Index: nemo-2.3.0/src/nemo-tree-sidebar-model.c
===================================================================
--- nemo-2.3.0.orig/src/nemo-tree-sidebar-model.c
+++ nemo-2.3.0/src/nemo-tree-sidebar-model.c
@@ -36,14 +36,12 @@
#include <libnemo-private/nemo-file-attributes.h>
#include <libnemo-private/nemo-file.h>
-#include <cairo-gobject.h>
#include <glib/gi18n.h>
#include <gtk/gtk.h>
#include <string.h>
enum {
ROW_LOADED,
- GET_ICON_SCALE,
LAST_SIGNAL
};
@@ -79,7 +77,6 @@ struct TreeNode {
/* part of the node used only for directories */
int dummy_child_ref_count;
int all_children_ref_count;
- guint icon_scale;
NemoDirectory *directory;
guint done_loading_id;
@@ -112,7 +109,6 @@ struct FMTreeModelRoot {
/* separate hash table for each root node needed */
GHashTable *file_to_node_map;
- guint icon_scale;
TreeNode *root_node;
};
@@ -138,21 +134,6 @@ fm_tree_model_get_flags (GtkTreeModel *t
return GTK_TREE_MODEL_ITERS_PERSIST;
}
-static gint
-fm_tree_model_get_icon_scale (GtkTreeModel *model)
-{
- gint retval = -1;
-
- g_signal_emit (model, tree_model_signals[GET_ICON_SCALE], 0,
- &retval);
-
- if (retval == -1) {
- retval = gdk_screen_get_monitor_scale_factor (gdk_screen_get_default (), 0);
- }
-
- return retval;
-}
-
static void
object_unref_if_not_NULL (gpointer object)
{
@@ -170,7 +151,6 @@ tree_model_root_new (FMTreeModel *model)
root = g_new0 (FMTreeModelRoot, 1);
root->model = model;
root->file_to_node_map = g_hash_table_new (NULL, NULL);
- root->icon_scale = fm_tree_model_get_icon_scale (GTK_TREE_MODEL (model));
return root;
}
@@ -183,7 +163,6 @@ tree_node_new (NemoFile *file, FMTreeMod
node = g_new0 (TreeNode, 1);
node->file = nemo_file_ref (file);
node->root = root;
- node->icon_scale = root->icon_scale;
return node;
}
@@ -265,7 +244,7 @@ tree_node_parent (TreeNode *node, TreeNo
}
static GdkPixbuf *
-get_menu_icon (GIcon *icon, guint scale)
+get_menu_icon (GIcon *icon)
{
NemoIconInfo *info;
GdkPixbuf *pixbuf;
@@ -273,7 +252,7 @@ get_menu_icon (GIcon *icon, guint scale)
size = nemo_get_icon_size_for_stock_size (GTK_ICON_SIZE_MENU);
- info = nemo_icon_info_lookup (icon, size, scale);
+ info = nemo_icon_info_lookup (icon, size);
pixbuf = nemo_icon_info_get_pixbuf_nodefault_at_size (info, size);
g_object_unref (info);
@@ -297,7 +276,7 @@ get_menu_icon_for_file (TreeNode *node,
int i;
size = nemo_get_icon_size_for_stock_size (GTK_ICON_SIZE_MENU);
- gicon = G_ICON (nemo_file_get_icon_pixbuf (file, size, TRUE, node->icon_scale, flags));
+ gicon = G_ICON (nemo_file_get_icon_pixbuf (file, size, TRUE, flags));
i = 0;
emblems_to_ignore[i++] = NEMO_FILE_EMBLEM_NAME_TRASH;
@@ -331,7 +310,7 @@ get_menu_icon_for_file (TreeNode *node,
g_list_free_full (emblem_icons, g_object_unref);
- info = nemo_icon_info_lookup (gicon, size, node->icon_scale);
+ info = nemo_icon_info_lookup (gicon, size);
retval = nemo_icon_info_get_pixbuf_nodefault_at_size (info, size);
model = node->root->model;
@@ -359,7 +338,7 @@ tree_node_get_pixbuf (TreeNode *node,
NemoFileIconFlags flags)
{
if (node->parent == NULL) {
- return get_menu_icon (node->icon, node->icon_scale);
+ return get_menu_icon (node->icon);
}
return get_menu_icon_for_file (node, node->file, flags);
}
@@ -1146,10 +1125,10 @@ fm_tree_model_get_column_type (GtkTreeMo
switch (index) {
case FM_TREE_MODEL_DISPLAY_NAME_COLUMN:
return G_TYPE_STRING;
- case FM_TREE_MODEL_CLOSED_SURFACE_COLUMN:
- return CAIRO_GOBJECT_TYPE_SURFACE;
- case FM_TREE_MODEL_OPEN_SURFACE_COLUMN:
- return CAIRO_GOBJECT_TYPE_SURFACE;
+ case FM_TREE_MODEL_CLOSED_PIXBUF_COLUMN:
+ return GDK_TYPE_PIXBUF;
+ case FM_TREE_MODEL_OPEN_PIXBUF_COLUMN:
+ return GDK_TYPE_PIXBUF;
case FM_TREE_MODEL_FONT_STYLE_COLUMN:
return PANGO_TYPE_STYLE;
default:
@@ -1262,25 +1241,10 @@ fm_tree_model_get_path (GtkTreeModel *mo
return path;
}
-static cairo_surface_t *
-get_surface (TreeNode *node, gboolean closed, guint scale)
-{
- GdkPixbuf *pixbuf;
- cairo_surface_t *surface;
-
- if (closed)
- pixbuf = tree_node_get_closed_pixbuf (node);
- else
- pixbuf = tree_node_get_open_pixbuf (node);
- surface = gdk_cairo_surface_create_from_pixbuf (pixbuf, scale, NULL);
- return surface;
-}
-
static void
fm_tree_model_get_value (GtkTreeModel *model, GtkTreeIter *iter, int column, GValue *value)
{
TreeNode *node, *parent;
- guint icon_scale;
g_return_if_fail (FM_IS_TREE_MODEL (model));
g_return_if_fail (iter_is_valid (FM_TREE_MODEL (model), iter));
@@ -1298,23 +1262,13 @@ fm_tree_model_get_value (GtkTreeModel *m
g_value_set_string (value, tree_node_get_display_name (node));
}
break;
- case FM_TREE_MODEL_CLOSED_SURFACE_COLUMN:
- g_value_init (value, CAIRO_GOBJECT_TYPE_SURFACE);
- icon_scale = fm_tree_model_get_icon_scale (model);
- if (node == NULL) {
- g_value_take_boxed (value, NULL);
- } else {
- g_value_take_boxed (value, get_surface (node, TRUE, icon_scale));
- }
+ case FM_TREE_MODEL_CLOSED_PIXBUF_COLUMN:
+ g_value_init (value, GDK_TYPE_PIXBUF);
+ g_value_set_object (value, node == NULL ? NULL : tree_node_get_closed_pixbuf (node));
break;
- case FM_TREE_MODEL_OPEN_SURFACE_COLUMN:
- g_value_init (value, CAIRO_GOBJECT_TYPE_SURFACE);
- icon_scale = fm_tree_model_get_icon_scale (model);
- if (node == NULL) {
- g_value_take_boxed (value, NULL);
- } else {
- g_value_take_boxed (value, get_surface (node, FALSE, icon_scale));
- }
+ case FM_TREE_MODEL_OPEN_PIXBUF_COLUMN:
+ g_value_init (value, GDK_TYPE_PIXBUF);
+ g_value_set_object (value, node == NULL ? NULL : tree_node_get_open_pixbuf (node));
break;
case FM_TREE_MODEL_FONT_STYLE_COLUMN:
g_value_init (value, PANGO_TYPE_STYLE);
@@ -1944,14 +1898,6 @@ fm_tree_model_class_init (FMTreeModelCla
g_cclosure_marshal_VOID__BOXED,
G_TYPE_NONE, 1,
GTK_TYPE_TREE_ITER);
-
- tree_model_signals[GET_ICON_SCALE] =
- g_signal_new ("get-icon-scale",
- FM_TYPE_TREE_MODEL,
- G_SIGNAL_RUN_FIRST | G_SIGNAL_RUN_LAST,
- 0, NULL, NULL,
- NULL,
- G_TYPE_INT, 0);
}
static void
Index: nemo-2.3.0/src/nemo-tree-sidebar-model.h
===================================================================
--- nemo-2.3.0.orig/src/nemo-tree-sidebar-model.h
+++ nemo-2.3.0/src/nemo-tree-sidebar-model.h
@@ -46,8 +46,8 @@
enum {
FM_TREE_MODEL_DISPLAY_NAME_COLUMN,
- FM_TREE_MODEL_CLOSED_SURFACE_COLUMN,
- FM_TREE_MODEL_OPEN_SURFACE_COLUMN,
+ FM_TREE_MODEL_CLOSED_PIXBUF_COLUMN,
+ FM_TREE_MODEL_OPEN_PIXBUF_COLUMN,
FM_TREE_MODEL_FONT_STYLE_COLUMN,
FM_TREE_MODEL_NUM_COLUMNS
};
@@ -97,4 +97,4 @@ GMount * fm_tree_model_get_mount
void fm_tree_model_set_highlight_for_files (FMTreeModel *model,
GList *files);
-#endif /* FM_TREE_MODEL_H */
\ No newline at end of file
+#endif /* FM_TREE_MODEL_H */
Index: nemo-2.3.0/src/nemo-tree-sidebar.c
===================================================================
--- nemo-2.3.0.orig/src/nemo-tree-sidebar.c
+++ nemo-2.3.0/src/nemo-tree-sidebar.c
@@ -1407,37 +1407,6 @@ create_popup_menu (FMTreeView *view)
add_action_popup_items (view);
}
-static gint
-get_icon_scale_callback (FMTreeModel *model,
- FMTreeView *view)
-{
- return gtk_widget_get_scale_factor (GTK_WIDGET (view->details->tree_widget));
-}
-
-static void
-surface_data_func (GtkTreeViewColumn *tree_column,
- GtkCellRenderer *cell,
- GtkTreeModel *tree_model,
- GtkTreeIter *iter,
- gpointer data)
-{
- gboolean expanded;
- cairo_surface_t *surface;
-
- g_object_get (cell,
- "is-expanded", &expanded,
- NULL);
-
- gtk_tree_model_get (tree_model, iter,
- expanded ? FM_TREE_MODEL_OPEN_SURFACE_COLUMN : FM_TREE_MODEL_CLOSED_SURFACE_COLUMN,
- &surface,
- -1);
-
- g_object_set (cell,
- "surface", surface,
- NULL);
-}
-
static void
create_tree (FMTreeView *view)
{
@@ -1466,8 +1435,6 @@ create_tree (FMTreeView *view)
g_signal_connect_object (view->details->child_model, "row_loaded",
G_CALLBACK (row_loaded_callback),
view, G_CONNECT_AFTER);
- g_signal_connect_object (view->details->child_model, "get-icon-scale",
- G_CALLBACK (get_icon_scale_callback), view, 0);
#ifdef NOT_YET_USABLE /* Do we really want this? */
icon = g_themed_icon_new (NEMO_ICON_COMPUTER);
@@ -1530,8 +1497,11 @@ create_tree (FMTreeView *view)
cell = gtk_cell_renderer_pixbuf_new ();
gtk_tree_view_column_pack_start (column, cell, FALSE);
- gtk_tree_view_column_set_cell_data_func (column, cell, (GtkTreeCellDataFunc) surface_data_func, NULL, NULL);
-
+ gtk_tree_view_column_set_attributes (column, cell,
+ "pixbuf", FM_TREE_MODEL_CLOSED_PIXBUF_COLUMN,
+ "pixbuf_expander_closed", FM_TREE_MODEL_CLOSED_PIXBUF_COLUMN,
+ "pixbuf_expander_open", FM_TREE_MODEL_OPEN_PIXBUF_COLUMN,
+ NULL);
cell = gtk_cell_renderer_text_new ();
gtk_tree_view_column_pack_start (column, cell, TRUE);
Index: nemo-2.3.0/src/nemo-view.c
===================================================================
--- nemo-2.3.0.orig/src/nemo-view.c
+++ nemo-2.3.0/src/nemo-view.c
@@ -5440,17 +5440,15 @@ extension_action_callback (GtkAction *ac
}
static GdkPixbuf *
-get_menu_icon_for_file (NemoFile *file,
- GtkWidget *widget)
+get_menu_icon_for_file (NemoFile *file)
{
NemoIconInfo *info;
GdkPixbuf *pixbuf;
- int size, scale;
+ int size;
size = nemo_get_icon_size_for_stock_size (GTK_ICON_SIZE_MENU);
- scale = gtk_widget_get_scale_factor (widget);
- info = nemo_file_get_icon (file, size, scale, 0);
+ info = nemo_file_get_icon (file, size, 0);
pixbuf = nemo_icon_info_get_pixbuf_nodefault_at_size (info, size);
g_object_unref (info);
@@ -5482,7 +5480,7 @@ add_extension_action_for_files (NemoView
NULL);
if (icon != NULL) {
- pixbuf = nemo_ui_get_menu_icon (icon, GTK_WIDGET (view));
+ pixbuf = nemo_ui_get_menu_icon (icon);
if (pixbuf != NULL) {
gtk_action_set_gicon (action, G_ICON (pixbuf));
g_object_unref (pixbuf);
@@ -5925,7 +5923,7 @@ add_script_to_scripts_menus (NemoView *d
tip,
NULL);
- pixbuf = get_menu_icon_for_file (file, GTK_WIDGET (directory_view));
+ pixbuf = get_menu_icon_for_file (file);
if (pixbuf != NULL) {
g_object_set_data_full (G_OBJECT (action), "menu-icon",
pixbuf,
@@ -5989,7 +5987,7 @@ add_submenu_to_directory_menus (NemoView
ui_manager = nemo_window_get_ui_manager (directory_view->details->window);
uri = nemo_file_get_uri (file);
name = nemo_file_get_display_name (file);
- pixbuf = get_menu_icon_for_file (file, GTK_WIDGET (directory_view));
+ pixbuf = get_menu_icon_for_file (file);
add_submenu (ui_manager, action_group, merge_id, menu_path, uri, name, pixbuf, TRUE);
add_submenu (ui_manager, action_group, merge_id, popup_path, uri, name, pixbuf, FALSE);
add_submenu (ui_manager, action_group, merge_id, popup_bg_path, uri, name, pixbuf, FALSE);
@@ -6304,7 +6302,7 @@ add_template_to_templates_menus (NemoVie
tip,
NULL);
- pixbuf = get_menu_icon_for_file (file, GTK_WIDGET (directory_view));
+ pixbuf = get_menu_icon_for_file (file);
if (pixbuf != NULL) {
g_object_set_data_full (G_OBJECT (action), "menu-icon",
pixbuf,
@@ -7743,7 +7741,7 @@ action_connect_to_server_link_callback (
file = NEMO_FILE (selection->data);
uri = nemo_file_get_activation_uri (file);
- icon = nemo_file_get_icon (file, NEMO_ICON_SIZE_STANDARD, gtk_widget_get_scale_factor (GTK_WIDGET (view)), 0);
+ icon = nemo_file_get_icon (file, NEMO_ICON_SIZE_STANDARD, 0);
icon_name = nemo_icon_info_get_used_name (icon);
name = nemo_file_get_display_name (file);
@@ -8292,7 +8290,7 @@ connect_proxy (NemoView *view,
if (strcmp (gtk_action_get_name (action), NEMO_ACTION_NEW_EMPTY_DOCUMENT) == 0 &&
GTK_IS_IMAGE_MENU_ITEM (proxy)) {
- pixbuf = nemo_ui_get_menu_icon ("text-x-generic", GTK_WIDGET (view));
+ pixbuf = nemo_ui_get_menu_icon ("text-x-generic");
if (pixbuf != NULL) {
image = gtk_image_new_from_pixbuf (pixbuf);
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (proxy), image);
Index: nemo-2.3.0/src/nemo-window-menus.c
===================================================================
--- nemo-2.3.0.orig/src/nemo-window-menus.c
+++ nemo-2.3.0/src/nemo-window-menus.c
@@ -1692,7 +1692,7 @@ add_extension_menu_items (NemoWindow *wi
g_object_get (item, "menu", &menu, NULL);
- action = nemo_action_from_menu_item (item, GTK_WIDGET (window));
+ action = nemo_action_from_menu_item (item);
gtk_action_group_add_action_with_accel (action_group, action, NULL);
path = g_build_path ("/", POPUP_PATH_EXTENSION_ACTIONS, subdirectory, NULL);
Index: nemo-2.3.0/src/nemo-window.c
===================================================================
--- nemo-2.3.0.orig/src/nemo-window.c
+++ nemo-2.3.0/src/nemo-window.c
@@ -2073,7 +2073,6 @@ real_get_icon (NemoWindow *window,
NemoWindowSlot *slot)
{
return nemo_file_get_icon (slot->viewed_file, 48,
- gtk_widget_get_scale_factor (GTK_WIDGET (window)),
NEMO_FILE_ICON_FLAGS_IGNORE_VISITING |
NEMO_FILE_ICON_FLAGS_USE_MOUNT_ICON);
}
Index: nemo-2.3.0/src/nemo-pathbar.c
===================================================================
--- nemo-2.3.0.orig/src/nemo-pathbar.c
+++ nemo-2.3.0/src/nemo-pathbar.c
@@ -109,11 +109,9 @@ static gboolean nemo_path_bar_slider_but
GdkEventButton *event,
NemoPathBar *path_bar);
static void nemo_path_bar_check_icon_theme (NemoPathBar *path_bar);
-static void nemo_path_bar_update_button_appearance (ButtonData *button_data,
- gint scale);
+static void nemo_path_bar_update_button_appearance (ButtonData *button_data);
static void nemo_path_bar_update_button_state (ButtonData *button_data,
- gboolean current_dir,
- gint scale);
+ gboolean current_dir);
static gboolean nemo_path_bar_update_path (NemoPathBar *path_bar,
GFile *file_path,
gboolean emit_signal);
@@ -200,8 +198,7 @@ trash_state_changed_cb (NemoTrashMonitor
GdkPixbuf *pixbuf;
icon = nemo_trash_monitor_get_icon ();
- icon_info = nemo_icon_info_lookup (icon, NEMO_PATH_BAR_ICON_SIZE,
- gtk_widget_get_scale_factor (GTK_WIDGET (path_bar)));
+ icon_info = nemo_icon_info_lookup (icon, NEMO_PATH_BAR_ICON_SIZE);
pixbuf = nemo_icon_info_get_pixbuf_at_size (icon_info, NEMO_PATH_BAR_ICON_SIZE);
gtk_image_set_from_pixbuf (GTK_IMAGE (button_data->image), pixbuf);
}
@@ -1204,8 +1201,7 @@ reload_icons (NemoPathBar *path_bar)
ButtonData *button_data;
button_data = BUTTON_DATA (list->data);
if (button_data->type != NORMAL_BUTTON || button_data->is_base_dir) {
- nemo_path_bar_update_button_appearance (button_data,
- gtk_widget_get_scale_factor (GTK_WIDGET (path_bar)));
+ nemo_path_bar_update_button_appearance (button_data);
}
}
}
@@ -1282,29 +1278,28 @@ button_clicked_cb (GtkWidget *button,
}
static NemoIconInfo *
-get_type_icon_info (ButtonData *button_data, gint scale)
+get_type_icon_info (ButtonData *button_data)
{
switch (button_data->type)
{
case ROOT_BUTTON:
return nemo_icon_info_lookup_from_name (NEMO_ICON_FILESYSTEM,
- NEMO_PATH_BAR_ICON_SIZE, scale);
+ NEMO_PATH_BAR_ICON_SIZE);
case HOME_BUTTON:
return nemo_icon_info_lookup_from_name (NEMO_ICON_HOME,
- NEMO_PATH_BAR_ICON_SIZE, scale);
+ NEMO_PATH_BAR_ICON_SIZE);
case DESKTOP_BUTTON:
return nemo_icon_info_lookup_from_name (NEMO_ICON_DESKTOP,
- NEMO_PATH_BAR_ICON_SIZE, scale);
+ NEMO_PATH_BAR_ICON_SIZE);
case XDG_BUTTON:
return nemo_icon_info_lookup_from_name (button_data->xdg_icon,
- NEMO_PATH_BAR_ICON_SIZE, scale);
+ NEMO_PATH_BAR_ICON_SIZE);
case NORMAL_BUTTON:
if (button_data->is_base_dir) {
return nemo_file_get_icon (button_data->file,
NEMO_PATH_BAR_ICON_SIZE,
- scale,
NEMO_FILE_ICON_FLAGS_NONE);
}
default:
@@ -1353,7 +1348,7 @@ get_dir_name (ButtonData *button_data)
}
static void
-nemo_path_bar_update_button_appearance (ButtonData *button_data, gint scale)
+nemo_path_bar_update_button_appearance (ButtonData *button_data)
{
NemoIconInfo *icon_info;
GdkPixbuf *pixbuf;
@@ -1368,7 +1363,7 @@ nemo_path_bar_update_button_appearance (
gtk_image_set_from_pixbuf (GTK_IMAGE (button_data->image), button_data->custom_icon);
gtk_widget_show (GTK_WIDGET (button_data->image));
} else {
- icon_info = get_type_icon_info (button_data, scale);
+ icon_info = get_type_icon_info (button_data);
pixbuf = NULL;
@@ -1378,9 +1373,7 @@ nemo_path_bar_update_button_appearance (
}
if (pixbuf != NULL) {
- cairo_surface_t *surface;
- surface = gdk_cairo_surface_create_from_pixbuf (pixbuf, scale, NULL);
- g_object_set (GTK_IMAGE (button_data->image), "surface", surface, NULL);
+ gtk_image_set_from_pixbuf (GTK_IMAGE (button_data->image), pixbuf);
gtk_widget_show (GTK_WIDGET (button_data->image));
g_object_unref (pixbuf);
} else {
@@ -1393,14 +1386,13 @@ nemo_path_bar_update_button_appearance (
static void
nemo_path_bar_update_button_state (ButtonData *button_data,
- gboolean current_dir,
- gint scale)
+ gboolean current_dir)
{
if (button_data->label != NULL) {
gtk_label_set_label (GTK_LABEL (button_data->label), NULL);
}
- nemo_path_bar_update_button_appearance (button_data, scale);
+ nemo_path_bar_update_button_appearance (button_data);
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button_data->button)) != current_dir) {
button_data->ignore_changes = TRUE;
@@ -1410,7 +1402,7 @@ nemo_path_bar_update_button_state (Butto
}
static gboolean
-setup_file_path_mounted_mount (GFile *location, ButtonData *button_data, gint scale)
+setup_file_path_mounted_mount (GFile *location, ButtonData *button_data)
{
GVolumeMonitor *volume_monitor;
GList *mounts, *l;
@@ -1440,7 +1432,7 @@ setup_file_path_mounted_mount (GFile *lo
if (icon == NULL) {
icon = g_themed_icon_new (NEMO_ICON_FOLDER);
}
- info = nemo_icon_info_lookup (icon, NEMO_PATH_BAR_ICON_SIZE, scale);
+ info = nemo_icon_info_lookup (icon, NEMO_PATH_BAR_ICON_SIZE);
g_object_unref (icon);
button_data->custom_icon = nemo_icon_info_get_pixbuf_at_size (info, NEMO_PATH_BAR_ICON_SIZE);
g_object_unref (info);
@@ -1461,7 +1453,7 @@ setup_file_path_mounted_mount (GFile *lo
if (icon == NULL) {
icon = g_themed_icon_new (NEMO_ICON_FOLDER);
}
- info = nemo_icon_info_lookup (icon, NEMO_PATH_BAR_ICON_SIZE, scale);
+ info = nemo_icon_info_lookup (icon, NEMO_PATH_BAR_ICON_SIZE);
g_object_unref (icon);
button_data->custom_icon = nemo_icon_info_get_pixbuf_at_size (info, NEMO_PATH_BAR_ICON_SIZE);
g_object_unref (info);
@@ -1516,8 +1508,7 @@ setup_button_type (ButtonData *but
} else if (path_bar->xdg_public_path != NULL && g_file_equal (location, path_bar->xdg_public_path)) {
button_data->type = XDG_BUTTON;
button_data->xdg_icon = g_strdup (NEMO_ICON_FOLDER_PUBLIC_SHARE);
- } else if (setup_file_path_mounted_mount (location, button_data,
- gtk_widget_get_scale_factor (GTK_WIDGET (path_bar)))) {
+ } else if (setup_file_path_mounted_mount (location, button_data)) {
/* already setup */
} else {
button_data->type = NORMAL_BUTTON;
@@ -1681,8 +1672,7 @@ button_data_file_changed (NemoFile *file
g_free (display_name);
}
- nemo_path_bar_update_button_appearance (button_data,
- gtk_widget_get_scale_factor (GTK_WIDGET (path_bar)));
+ nemo_path_bar_update_button_appearance (button_data);
}
static GtkWidget *
@@ -1780,8 +1770,7 @@ make_directory_button (NemoPathBar *pat
gtk_container_add (GTK_CONTAINER (button_data->button), child);
gtk_widget_show_all (button_data->button);
- nemo_path_bar_update_button_state (button_data, current_dir,
- gtk_widget_get_scale_factor (GTK_WIDGET (path_bar)));
+ nemo_path_bar_update_button_state (button_data, current_dir);
g_signal_connect (button_data->button, "clicked", G_CALLBACK (button_clicked_cb), button_data);
g_object_weak_ref (G_OBJECT (button_data->button), (GWeakNotify) button_data_free, button_data);
@@ -1847,8 +1836,7 @@ nemo_path_bar_check_parent_path (NemoPat
for (list = path_bar->button_list; list; list = list->next) {
nemo_path_bar_update_button_state (BUTTON_DATA (list->data),
- (list == current_path) ? TRUE : FALSE,
- gtk_widget_get_scale_factor (GTK_WIDGET (path_bar)));
+ (list == current_path) ? TRUE : FALSE);
}
if (!gtk_widget_get_child_visible (BUTTON_DATA (current_path->data)->button)) {
Index: nemo-2.3.0/libnemo-private/nemo-icon-info.c
===================================================================
--- nemo-2.3.0.orig/libnemo-private/nemo-icon-info.c
+++ nemo-2.3.0/libnemo-private/nemo-icon-info.c
@@ -39,8 +39,7 @@ struct _NemoIconInfo
gint n_attach_points;
GdkPoint *attach_points;
char *display_name;
- char *icon_name;
- gint orig_scale;
+ char *icon_name;
};
struct _NemoIconInfoClass
@@ -119,8 +118,7 @@ nemo_icon_info_class_init (NemoIconInfoC
}
NemoIconInfo *
-nemo_icon_info_new_for_pixbuf (GdkPixbuf *pixbuf,
- gint scale)
+nemo_icon_info_new_for_pixbuf (GdkPixbuf *pixbuf)
{
NemoIconInfo *icon;
@@ -130,14 +128,11 @@ nemo_icon_info_new_for_pixbuf (GdkPixbuf
icon->pixbuf = g_object_ref (pixbuf);
}
- icon->orig_scale = scale;
-
return icon;
}
static NemoIconInfo *
-nemo_icon_info_new_for_icon_info (GtkIconInfo *icon_info,
- gint scale)
+nemo_icon_info_new_for_icon_info (GtkIconInfo *icon_info)
{
NemoIconInfo *icon;
GdkPoint *points;
@@ -169,8 +164,6 @@ nemo_icon_info_new_for_icon_info (GtkIco
icon->icon_name = basename;
}
- icon->orig_scale = scale;
-
return icon;
}
@@ -333,8 +326,7 @@ themed_icon_key_free (ThemedIconKey *key
NemoIconInfo *
nemo_icon_info_lookup (GIcon *icon,
- int size,
- int scale)
+ int size)
{
NemoIconInfo *icon_info;
GdkPixbuf *pixbuf;
@@ -362,18 +354,18 @@ nemo_icon_info_lookup (GIcon *icon,
pixbuf = NULL;
stream = g_loadable_icon_load (G_LOADABLE_ICON (icon),
- size * scale,
+ size,
NULL, NULL, NULL);
if (stream) {
pixbuf = gdk_pixbuf_new_from_stream_at_scale (stream,
- size * scale, size * scale,
+ size, size,
TRUE,
NULL, NULL);
g_input_stream_close (stream, NULL, NULL);
g_object_unref (stream);
}
- icon_info = nemo_icon_info_new_for_pixbuf (pixbuf, scale);
+ icon_info = nemo_icon_info_new_for_pixbuf (pixbuf);
key = loadable_icon_key_new (icon, size);
g_hash_table_insert (loadable_icon_cache, key, icon_info);
@@ -398,20 +390,19 @@ nemo_icon_info_lookup (GIcon *icon,
names = g_themed_icon_get_names (G_THEMED_ICON (icon));
icon_theme = gtk_icon_theme_get_default ();
- gtkicon_info = gtk_icon_theme_choose_icon_for_scale (icon_theme,
+ gtkicon_info = gtk_icon_theme_choose_icon (icon_theme,
(const char **)names,
size,
- scale,
0);
if (gtkicon_info == NULL) {
- return nemo_icon_info_new_for_pixbuf (NULL, scale);
+ return nemo_icon_info_new_for_pixbuf (NULL);
}
filename = gtk_icon_info_get_filename (gtkicon_info);
if (filename == NULL) {
gtk_icon_info_free (gtkicon_info);
- return nemo_icon_info_new_for_pixbuf (NULL, scale);
+ return nemo_icon_info_new_for_pixbuf (NULL);
}
lookup_key.filename = (char *)filename;
@@ -423,7 +414,7 @@ nemo_icon_info_lookup (GIcon *icon,
return g_object_ref (icon_info);
}
- icon_info = nemo_icon_info_new_for_icon_info (gtkicon_info, scale);
+ icon_info = nemo_icon_info_new_for_icon_info (gtkicon_info);
key = themed_icon_key_new (filename, size);
g_hash_table_insert (themed_icon_cache, key, icon_info);
@@ -435,10 +426,9 @@ nemo_icon_info_lookup (GIcon *icon,
GdkPixbuf *pixbuf;
GtkIconInfo *gtk_icon_info;
- gtk_icon_info = gtk_icon_theme_lookup_by_gicon_for_scale (gtk_icon_theme_get_default (),
+ gtk_icon_info = gtk_icon_theme_lookup_by_gicon (gtk_icon_theme_get_default (),
icon,
size,
- scale,
GTK_ICON_LOOKUP_GENERIC_FALLBACK);
if (gtk_icon_info != NULL) {
pixbuf = gtk_icon_info_load_icon (gtk_icon_info, NULL);
@@ -447,7 +437,7 @@ nemo_icon_info_lookup (GIcon *icon,
pixbuf = NULL;
}
- icon_info = nemo_icon_info_new_for_pixbuf (pixbuf, scale);
+ icon_info = nemo_icon_info_new_for_pixbuf (pixbuf);
if (pixbuf != NULL) {
g_object_unref (pixbuf);
@@ -459,22 +449,20 @@ nemo_icon_info_lookup (GIcon *icon,
NemoIconInfo *
nemo_icon_info_lookup_from_name (const char *name,
- int size,
- int scale)
+ int size)
{
GIcon *icon;
NemoIconInfo *info;
icon = g_themed_icon_new (name);
- info = nemo_icon_info_lookup (icon, size, scale);
+ info = nemo_icon_info_lookup (icon, size);
g_object_unref (icon);
return info;
}
NemoIconInfo *
nemo_icon_info_lookup_from_path (const char *path,
- int size,
- int scale)
+ int size)
{
GFile *icon_file;
GIcon *icon;
@@ -482,7 +470,7 @@ nemo_icon_info_lookup_from_path (const c
icon_file = g_file_new_for_path (path);
icon = g_file_icon_new (icon_file);
- info = nemo_icon_info_lookup (icon, size, scale);
+ info = nemo_icon_info_lookup (icon, size);
g_object_unref (icon);
g_object_unref (icon_file);
return info;
@@ -544,8 +532,8 @@ nemo_icon_info_get_pixbuf_nodefault_at_s
if (pixbuf == NULL)
return NULL;
- w = gdk_pixbuf_get_width (pixbuf) / icon->orig_scale;
- h = gdk_pixbuf_get_height (pixbuf) / icon->orig_scale;
+ w = gdk_pixbuf_get_width (pixbuf);
+ h = gdk_pixbuf_get_height (pixbuf);
s = MAX (w, h);
if (s == forced_size) {
return pixbuf;
@@ -570,8 +558,8 @@ nemo_icon_info_get_pixbuf_at_size (NemoI
pixbuf = nemo_icon_info_get_pixbuf (icon);
- w = gdk_pixbuf_get_width (pixbuf) / icon->orig_scale;
- h = gdk_pixbuf_get_height (pixbuf) / icon->orig_scale;
+ w = gdk_pixbuf_get_width (pixbuf);
+ h = gdk_pixbuf_get_height (pixbuf);
s = MAX (w, h);
if (s == forced_size) {
return pixbuf;
Index: nemo-2.3.0/src/nemo-toolbar.c
===================================================================
--- nemo-2.3.0.orig/src/nemo-toolbar.c
+++ nemo-2.3.0/src/nemo-toolbar.c
@@ -44,7 +44,6 @@ struct _NemoToolbarPriv {
GtkWidget *path_bar;
GtkWidget *location_bar;
GtkWidget *search_bar;
- GtkWidget *search_bar_revealer;
GtkWidget *root_bar;
gboolean show_main_bar;
@@ -96,7 +95,7 @@ toolbar_update_appearance (NemoToolbar *
gtk_widget_set_visible (self->priv->path_bar,
!show_location_entry);
- gtk_revealer_set_reveal_child (self->priv->search_bar_revealer,
+ gtk_widget_set_visible (self->priv->search_bar,
self->priv->show_search_bar);
gtk_widget_set_visible (self->priv->root_bar,
@@ -233,13 +232,7 @@ nemo_toolbar_constructed (GObject *obj)
setup_root_info_bar (self);
/* search bar */
- self->priv->search_bar = nemo_search_bar_new ();
- self->priv->search_bar_revealer = gtk_revealer_new ();
- gtk_container_add (GTK_CONTAINER (self->priv->search_bar_revealer),
- GTK_WIDGET (self->priv->search_bar));
- gtk_widget_show_all (self->priv->search_bar_revealer);
-
- gtk_box_pack_start (GTK_BOX (self), self->priv->search_bar_revealer, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (self), self->priv->search_bar, TRUE, TRUE, 0);
/* nemo patch */
g_signal_connect_swapped (nemo_preferences,