Compare commits

...

2 Commits

Author SHA1 Message Date
Jasper St. Pierre
2c3b5781e1 gtkwindow: Always report _GTK_FRAME_EXTENTS for the normal, unmaximized, untiled state 2014-01-10 15:12:50 -05:00
Jasper St. Pierre
1d9b061c90 updateiconcache: Don't include image data by default anymore
Since large images are in the icon cache, and apps don't tend to use that
many icons anymore, simply don't include image data and instead make apps
load files from disk. Additionally, since they're stored in GdkPixbuf data,
that means that we have to first convert them either to a cairo_surface_t,
which requires converting pixel data to be premulitplied, or an OpenGL
texture, which requires a whole GPU upload anyway.

So, even with the icon cache, the goal of icons through zero-copy, mmap()'d
data from disk just isn't doable with the icon cache format we have. The
icon cache on my disk is nearing 100MB, since we include a bunch of
high-resolution application icons, that I doubt would be used by apps at all.
Removing this inefficient pixel data makes memory usage for all applications
go down, with no speed loss.

The icon cache also, however, has an index of what icons are in each folder,
which prevents a readdir() and allows GTK+ to know what icon is where without
having to do a bunch of stat(); calls. Keeping this data is good for GTK+,
so we should still keep the index.

It doesn't make sense to remove any code for mapping pixel data from the icon
cache. There's a plan in the works to have a symbolic icon cache that does
pixel math on 16x16 icons to prevent slow SVG rendering. 16x16 pixels are
fairly small, and such images are flat colors, which should compress easily,
so the icon cache would be worthwhile here. So let's keep the code around
in preparation for that case.

https://bugzilla.gnome.org/show_bug.cgi?id=721895
2014-01-10 14:14:17 -05:00
2 changed files with 41 additions and 24 deletions

View File

@@ -6140,10 +6140,9 @@ update_window_style_classes (GtkWindow *window)
}
static void
get_shadow_width (GtkWidget *widget,
GtkBorder *shadow_width)
get_shadow_width_internal (GtkWidget *widget,
GtkBorder *shadow_width)
{
GtkWindowPrivate *priv = GTK_WINDOW (widget)->priv;
GtkBorder border = { 0 };
GtkBorder d = { 0 };
GtkBorder margin;
@@ -6154,14 +6153,6 @@ get_shadow_width (GtkWidget *widget,
*shadow_width = border;
if (!priv->client_decorated)
return;
if (priv->maximized ||
priv->fullscreen ||
priv->tiled)
return;
state = gtk_widget_get_state_flags (widget);
context = gtk_widget_get_style_context (widget);
@@ -6200,6 +6191,26 @@ get_shadow_width (GtkWidget *widget,
gtk_style_context_restore (context);
}
static void
get_shadow_width (GtkWidget *widget,
GtkBorder *shadow_width)
{
GtkWindowPrivate *priv = GTK_WINDOW (widget)->priv;
GtkBorder nothing = { 0 };
*shadow_width = nothing;
if (!priv->client_decorated)
return;
if (priv->maximized ||
priv->fullscreen ||
priv->tiled)
return;
get_shadow_width_internal (widget, shadow_width);
}
/* We're placing 8 input-only windows around
* the window content as resize handles, as
* follows:
@@ -6438,19 +6449,27 @@ update_border_windows (GtkWindow *window)
}
static void
update_shadow_width (GtkWindow *window,
GtkBorder *border)
update_shadow_width (GtkWindow *window)
{
GtkWidget *widget = GTK_WIDGET (window);
GtkWindowPrivate *priv = window->priv;
GdkWindow *gdk_window;
GtkBorder border;
gdk_window = gtk_widget_get_window (GTK_WIDGET (window));
if (!priv->client_decorated)
return;
if (gdk_window)
gdk_window_set_shadow_width (gdk_window,
border->left,
border->right,
border->top,
border->bottom);
gdk_window = gtk_widget_get_window (widget);
if (gdk_window == NULL)
return;
get_shadow_width_internal (widget, &border);
gdk_window_set_shadow_width (gdk_window,
border.left,
border.right,
border.top,
border.bottom);
}
static void
@@ -6584,9 +6603,6 @@ _gtk_window_set_allocation (GtkWindow *window,
priv->title_height = 0;
if (priv->client_decorated)
update_shadow_width (window, &window_border);
update_opaque_region (window, &window_border, &child_allocation);
if (priv->title_box != NULL &&
@@ -6821,6 +6837,7 @@ gtk_window_style_updated (GtkWidget *widget)
gdk_window_set_background_rgba (gtk_widget_get_window (widget),
&transparent);
gtk_widget_queue_resize (widget);
update_shadow_width (window);
}
}

View File

@@ -44,7 +44,7 @@
static gboolean force_update = FALSE;
static gboolean ignore_theme_index = FALSE;
static gboolean quiet = FALSE;
static gboolean index_only = FALSE;
static gboolean index_only = TRUE;
static gboolean validate = FALSE;
static gchar *var_name = "-";