summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorOlivier Fourdan <fourdan.olivier@wanadoo.fr>2005-11-01 09:40:38 +0000
committerOlivier Fourdan <fourdan.olivier@wanadoo.fr>2005-11-01 09:40:38 +0000
commiteaf00f196553f95893d8fd32e45f0abf61604ba0 (patch)
tree479bd792384c45f5a42258ee980b2327ce71f7f5 /src
parent7f6f0ae059c8b5005bc58462c0331995596e5da8 (diff)
downloadxfwm4-eaf00f196553f95893d8fd32e45f0abf61604ba0.tar.gz
Don't keep the icon pixbuf to save a bit of video memory.
(Old svn revision: 18575)
Diffstat (limited to 'src')
-rw-r--r--src/client.c22
-rw-r--r--src/client.h1
-rw-r--r--src/mywindow.c11
3 files changed, 19 insertions, 15 deletions
diff --git a/src/client.c b/src/client.c
index aee4507fc..6f915aaa4 100644
--- a/src/client.c
+++ b/src/client.c
@@ -1451,6 +1451,7 @@ clientUpdateIcon (Client * c)
{
ScreenInfo *screen_info = NULL;
DisplayInfo *display_info = NULL;
+ GdkPixbuf *icon;
g_return_if_fail (c != NULL);
g_return_if_fail (c->window != None);
@@ -1458,11 +1459,7 @@ clientUpdateIcon (Client * c)
screen_info = c->screen_info;
display_info = screen_info->display_info;
- if (c->appicon)
- {
- g_object_unref (c->appicon);
- }
- c->appicon = getAppIcon (display_info, c->window, 16, 16);
+ icon = getAppIcon (display_info, c->window, 16, 16);
xfwmPixmapFree (&c->appmenu[ACTIVE]);
xfwmPixmapFree (&c->appmenu[INACTIVE]);
@@ -1475,9 +1472,11 @@ clientUpdateIcon (Client * c)
xfwmPixmapDuplicate (&screen_info->buttons[MENU_BUTTON][PRESSED],
&c->appmenu[PRESSED]);
- xfwmPixmapRenderGdkPixbuf (&c->appmenu[ACTIVE], c->appicon);
- xfwmPixmapRenderGdkPixbuf (&c->appmenu[INACTIVE], c->appicon);
- xfwmPixmapRenderGdkPixbuf (&c->appmenu[PRESSED], c->appicon);
+ xfwmPixmapRenderGdkPixbuf (&c->appmenu[ACTIVE], icon);
+ xfwmPixmapRenderGdkPixbuf (&c->appmenu[INACTIVE], icon);
+ xfwmPixmapRenderGdkPixbuf (&c->appmenu[PRESSED], icon);
+
+ g_object_unref (icon);
}
Client *
@@ -1623,7 +1622,6 @@ clientFrame (DisplayInfo *display_info, Window w, gboolean recapture)
FLAG_SET (c->flags, CLIENT_FLAG_HAS_SHAPE);
}
- c->appicon = NULL;
if (((c->size->flags & (PMinSize | PMaxSize)) != (PMinSize | PMaxSize))
|| (((c->size->flags & (PMinSize | PMaxSize)) ==
(PMinSize | PMaxSize))
@@ -1977,11 +1975,7 @@ clientUnframe (Client * c, gboolean remap)
{
workspaceUpdateArea (c->screen_info);
}
- if (c->appicon)
- {
- g_object_unref(c->appicon);
- c->appicon = NULL;
- }
+
myDisplayUngrabServer (display_info);
gdk_error_trap_pop ();
clientFree (c);
diff --git a/src/client.h b/src/client.h
index edb07a409..6337907be 100644
--- a/src/client.h
+++ b/src/client.h
@@ -209,7 +209,6 @@ struct _Client
xfwmWindow buttons[BUTTON_COUNT];
Window client_leader;
Window group_leader;
- GdkPixbuf *appicon;
xfwmPixmap appmenu[3];
Colormap cmap;
unsigned long win_hints;
diff --git a/src/mywindow.c b/src/mywindow.c
index 7356b5c0f..374f2cb3e 100644
--- a/src/mywindow.c
+++ b/src/mywindow.c
@@ -260,9 +260,20 @@ xfwmWindowCopyComposite (xfwmWindow * win, xfwmPixmap * pix)
win->window,
pix->width, pix->height, win->depth);
+ if (!temp)
+ {
+ return FALSE;
+ }
+
pict = XRenderCreatePicture (myScreenGetXDisplay (win->screen_info),
temp, win->pict_format, 0, NULL);
+ if (!pict)
+ {
+ XFreePixmap (myScreenGetXDisplay (win->screen_info), temp);
+ return FALSE;
+ }
+
XRenderComposite (myScreenGetXDisplay (win->screen_info), PictOpSrc, pix->pict, None, pict, 0, 0, 0, 0, 0, 0, pix->width, pix->height);
XRenderFreePicture (myScreenGetXDisplay (win->screen_info), pict);