1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-22 05:48:01 +01:00
Files
wmaker/src/icon.h
Rodolfo García Peñas (kix) 7a2eb68aa4 Remove cache icon when detached
This pach removes the icon from the icon cache when the icon is
detached from the dock/clip.

That helps to hold tidy the icon cache folder.

-------8<-------
Also app icon caching was broken around the same time. The app icon cache
in CachedPixmaps was meant to store icons retrieved from X clients so the
dock or clip can display those when the client is not running like after
startup. The cache should contain only such icons and the path should never
appear in WMWindowAttributes because the cache is an internal thing used to
look up icons not otherwise available. If you look at your WMWindowAttributes
now it is full of entries referring to the cache that should not be there and
if you look at the cache dir you'll find a lot of icons from all apps you've
ever started while there should be only the few docked ones that use client
side icons. Also the cache is never cleaned up only new icons are added to it.
-------8<-------

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2015-08-23 22:08:30 +01:00

85 lines
2.7 KiB
C

/*
* Window Maker window manager
*
* Copyright (c) 1997-2003 Alfredo K. Kojima
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef WMICON_H_
#define WMICON_H_
#include "wcore.h"
#include "window.h"
#define TILE_NORMAL 0
#define TILE_CLIP 1
#define TILE_DRAWER 2
/* This is the border, in pixel, drawn around a Mini-Preview */
#define MINIPREVIEW_BORDER 1
typedef struct WIcon {
WCoreWindow *core;
WWindow *owner; /* owner window */
char *icon_name; /* the icon name hint */
Window icon_win; /* client suplied icon window */
char *file; /* the file with the icon image */
RImage *file_image; /* the image from the file */
unsigned int tile_type:4;
unsigned int show_title:1;
unsigned int selected:1;
unsigned int step:3; /* selection cycle step */
unsigned int shadowed:1; /* If the icon is to be blured */
unsigned int mapped:1;
unsigned int highlighted:1;
Pixmap pixmap;
Pixmap mini_preview;
WMHandlerID handlerID; /* timer handler ID for cycling select
* color */
} WIcon;
WIcon *icon_create_for_dock(WScreen *scr, const char *command, const char *wm_instance, const char *wm_class, int tile);
WIcon *icon_create_for_wwindow(WWindow *wwin);
void set_icon_image_from_database(WIcon *icon, const char *wm_instance, const char *wm_class, const char *command);
void wIconDestroy(WIcon *icon);
void wIconPaint(WIcon *icon);
void wIconUpdate(WIcon *icon);
void wIconSelect(WIcon *icon);
void wIconChangeTitle(WIcon *icon, WWindow *wwin);
void update_icon_pixmap(WIcon *icon);
int wIconChangeImageFile(WIcon *icon, const char *file);
RImage *wIconValidateIconSize(RImage *icon, int max_size);
RImage *get_rimage_icon_from_wm_hints(WIcon *icon);
char *wIconStore(WIcon *icon);
char *get_name_for_instance_class(const char *wm_instance, const char *wm_class);
void wIconSetHighlited(WIcon *icon, Bool flag);
void set_icon_image_from_image(WIcon *icon, RImage *image);
void set_icon_minipreview(WIcon *icon, RImage *image);
void remove_cache_icon(char *filename);
#endif /* WMICON_H_ */