1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 20:38:08 +01:00

wmaker: Moved global domain definition to the global namespace

The default domains were originally defined in different global
variables in C files; This patches groups them in a single
structure placed in global namespace.
This commit is contained in:
Christophe CURIS
2013-10-10 23:55:54 +02:00
committed by Carlos R. Mafra
parent f751cc6a50
commit d9832e578f
10 changed files with 65 additions and 84 deletions

View File

@@ -481,6 +481,14 @@ extern struct wmaker_global_variables {
} timestamp; } timestamp;
/* Global Domains, for storing dictionaries */
struct {
/* Note: you must #include <defaults.h> if you want to use them */
struct WDDomain *wmaker;
struct WDDomain *window_attr;
struct WDDomain *root_menu;
} domain;
/* Screens related */ /* Screens related */
int screen_count; int screen_count;

View File

@@ -60,9 +60,6 @@
* using the classname/instancename * using the classname/instancename
*/ */
/**** Global variables ****/
extern WDDomain *WDWindowAttributes;
#define MOD_MASK wPreferences.modifier_mask #define MOD_MASK wPreferences.modifier_mask
#define ICON_SIZE wPreferences.icon_size #define ICON_SIZE wPreferences.icon_size
@@ -1084,7 +1081,7 @@ Bool wHandleAppIconMove(WAppIcon *aicon, XEvent *event)
/* This function save the application icon and store the path in the Dictionary */ /* This function save the application icon and store the path in the Dictionary */
static void wApplicationSaveIconPathFor(const char *iconPath, const char *wm_instance, const char *wm_class) static void wApplicationSaveIconPathFor(const char *iconPath, const char *wm_instance, const char *wm_class)
{ {
WMPropList *dict = WDWindowAttributes->dictionary; WMPropList *dict = w_global.domain.window_attr->dictionary;
WMPropList *adict, *key, *iconk; WMPropList *adict, *key, *iconk;
WMPropList *val; WMPropList *val;
char *tmp; char *tmp;
@@ -1118,7 +1115,7 @@ static void wApplicationSaveIconPathFor(const char *iconPath, const char *wm_ins
WMReleasePropList(iconk); WMReleasePropList(iconk);
if (val && !wPreferences.flags.noupdates) if (val && !wPreferences.flags.noupdates)
UpdateDomainFile(WDWindowAttributes); UpdateDomainFile(w_global.domain.window_attr);
} }
static WAppIcon *findDockIconFor(WDock *dock, Window main_window) static WAppIcon *findDockIconFor(WDock *dock, Window main_window)

View File

@@ -72,9 +72,6 @@
#endif #endif
/***** Global *****/ /***** Global *****/
extern WDDomain *WDWindowMaker;
extern WDDomain *WDWindowAttributes;
extern WDDomain *WDRootMenu;
extern WShortKey wKeyBindings[WKBD_LAST]; extern WShortKey wKeyBindings[WKBD_LAST];
typedef struct _WDefaultEntry WDefaultEntry; typedef struct _WDefaultEntry WDefaultEntry;
@@ -971,21 +968,21 @@ void wDefaultsCheckDomains(void* arg)
WMPropList *dict; WMPropList *dict;
int i; int i;
if (stat(WDWindowMaker->path, &stbuf) >= 0 && WDWindowMaker->timestamp < stbuf.st_mtime) { if (stat(w_global.domain.wmaker->path, &stbuf) >= 0 && w_global.domain.wmaker->timestamp < stbuf.st_mtime) {
WDWindowMaker->timestamp = stbuf.st_mtime; w_global.domain.wmaker->timestamp = stbuf.st_mtime;
/* Global dictionary */ /* Global dictionary */
shared_dict = readGlobalDomain("WindowMaker", True); shared_dict = readGlobalDomain("WindowMaker", True);
/* User dictionary */ /* User dictionary */
dict = WMReadPropListFromFile(WDWindowMaker->path); dict = WMReadPropListFromFile(w_global.domain.wmaker->path);
if (dict) { if (dict) {
if (!WMIsPLDictionary(dict)) { if (!WMIsPLDictionary(dict)) {
WMReleasePropList(dict); WMReleasePropList(dict);
dict = NULL; dict = NULL;
wwarning(_("Domain %s (%s) of defaults database is corrupted!"), wwarning(_("Domain %s (%s) of defaults database is corrupted!"),
"WindowMaker", WDWindowMaker->path); "WindowMaker", w_global.domain.wmaker->path);
} else { } else {
if (shared_dict) { if (shared_dict) {
WMMergePLDictionaries(shared_dict, dict, True); WMMergePLDictionaries(shared_dict, dict, True);
@@ -1000,10 +997,10 @@ void wDefaultsCheckDomains(void* arg)
wReadDefaults(scr, dict); wReadDefaults(scr, dict);
} }
if (WDWindowMaker->dictionary) if (w_global.domain.wmaker->dictionary)
WMReleasePropList(WDWindowMaker->dictionary); WMReleasePropList(w_global.domain.wmaker->dictionary);
WDWindowMaker->dictionary = dict; w_global.domain.wmaker->dictionary = dict;
} }
} else { } else {
wwarning(_("could not load domain %s from user defaults database"), "WindowMaker"); wwarning(_("could not load domain %s from user defaults database"), "WindowMaker");
@@ -1014,17 +1011,17 @@ void wDefaultsCheckDomains(void* arg)
} }
if (stat(WDWindowAttributes->path, &stbuf) >= 0 && WDWindowAttributes->timestamp < stbuf.st_mtime) { if (stat(w_global.domain.window_attr->path, &stbuf) >= 0 && w_global.domain.window_attr->timestamp < stbuf.st_mtime) {
/* global dictionary */ /* global dictionary */
shared_dict = readGlobalDomain("WMWindowAttributes", True); shared_dict = readGlobalDomain("WMWindowAttributes", True);
/* user dictionary */ /* user dictionary */
dict = WMReadPropListFromFile(WDWindowAttributes->path); dict = WMReadPropListFromFile(w_global.domain.window_attr->path);
if (dict) { if (dict) {
if (!WMIsPLDictionary(dict)) { if (!WMIsPLDictionary(dict)) {
WMReleasePropList(dict); WMReleasePropList(dict);
dict = NULL; dict = NULL;
wwarning(_("Domain %s (%s) of defaults database is corrupted!"), wwarning(_("Domain %s (%s) of defaults database is corrupted!"),
"WMWindowAttributes", WDWindowAttributes->path); "WMWindowAttributes", w_global.domain.window_attr->path);
} else { } else {
if (shared_dict) { if (shared_dict) {
WMMergePLDictionaries(shared_dict, dict, True); WMMergePLDictionaries(shared_dict, dict, True);
@@ -1033,10 +1030,10 @@ void wDefaultsCheckDomains(void* arg)
shared_dict = NULL; shared_dict = NULL;
} }
if (WDWindowAttributes->dictionary) if (w_global.domain.window_attr->dictionary)
WMReleasePropList(WDWindowAttributes->dictionary); WMReleasePropList(w_global.domain.window_attr->dictionary);
WDWindowAttributes->dictionary = dict; w_global.domain.window_attr->dictionary = dict;
for (i = 0; i < w_global.screen_count; i++) { for (i = 0; i < w_global.screen_count; i++) {
scr = wScreenWithNumber(i); scr = wScreenWithNumber(i);
if (scr) { if (scr) {
@@ -1053,30 +1050,30 @@ void wDefaultsCheckDomains(void* arg)
wwarning(_("could not load domain %s from user defaults database"), "WMWindowAttributes"); wwarning(_("could not load domain %s from user defaults database"), "WMWindowAttributes");
} }
WDWindowAttributes->timestamp = stbuf.st_mtime; w_global.domain.window_attr->timestamp = stbuf.st_mtime;
if (shared_dict) if (shared_dict)
WMReleasePropList(shared_dict); WMReleasePropList(shared_dict);
} }
if (stat(WDRootMenu->path, &stbuf) >= 0 && WDRootMenu->timestamp < stbuf.st_mtime) { if (stat(w_global.domain.root_menu->path, &stbuf) >= 0 && w_global.domain.root_menu->timestamp < stbuf.st_mtime) {
dict = WMReadPropListFromFile(WDRootMenu->path); dict = WMReadPropListFromFile(w_global.domain.root_menu->path);
if (dict) { if (dict) {
if (!WMIsPLArray(dict) && !WMIsPLString(dict)) { if (!WMIsPLArray(dict) && !WMIsPLString(dict)) {
WMReleasePropList(dict); WMReleasePropList(dict);
dict = NULL; dict = NULL;
wwarning(_("Domain %s (%s) of defaults database is corrupted!"), wwarning(_("Domain %s (%s) of defaults database is corrupted!"),
"WMRootMenu", WDRootMenu->path); "WMRootMenu", w_global.domain.root_menu->path);
} else { } else {
if (WDRootMenu->dictionary) if (w_global.domain.root_menu->dictionary)
WMReleasePropList(WDRootMenu->dictionary); WMReleasePropList(w_global.domain.root_menu->dictionary);
WDRootMenu->dictionary = dict; w_global.domain.root_menu->dictionary = dict;
wDefaultsMergeGlobalMenus(WDRootMenu); wDefaultsMergeGlobalMenus(w_global.domain.root_menu);
} }
} else { } else {
wwarning(_("could not load domain %s from user defaults database"), "WMRootMenu"); wwarning(_("could not load domain %s from user defaults database"), "WMRootMenu");
} }
WDRootMenu->timestamp = stbuf.st_mtime; w_global.domain.root_menu->timestamp = stbuf.st_mtime;
} }
#ifndef HAVE_INOTIFY #ifndef HAVE_INOTIFY
if (!arg) if (!arg)
@@ -1092,7 +1089,7 @@ void wReadDefaults(WScreen * scr, WMPropList * new_dict)
int update_workspace_back = 0; /* kluge :/ */ int update_workspace_back = 0; /* kluge :/ */
unsigned int needs_refresh; unsigned int needs_refresh;
void *tdata; void *tdata;
WMPropList *old_dict = (WDWindowMaker->dictionary != new_dict ? WDWindowMaker->dictionary : NULL); WMPropList *old_dict = (w_global.domain.wmaker->dictionary != new_dict ? w_global.domain.wmaker->dictionary : NULL);
needs_refresh = 0; needs_refresh = 0;
@@ -1995,7 +1992,7 @@ getWSSpecificBackground(WScreen * scr, WDefaultEntry * entry, WMPropList * value
if (!scr->flags.backimage_helper_launched && !scr->flags.startup) { if (!scr->flags.backimage_helper_launched && !scr->flags.startup) {
WMPropList *key = WMCreatePLString("WorkspaceBack"); WMPropList *key = WMCreatePLString("WorkspaceBack");
WMRemoveFromPLDictionary(WDWindowMaker->dictionary, key); WMRemoveFromPLDictionary(w_global.domain.wmaker->dictionary, key);
WMReleasePropList(key); WMReleasePropList(key);
} }

View File

@@ -1454,8 +1454,6 @@ void wShowLegalPanel(WScreen * scr)
*********************************************************************** ***********************************************************************
*/ */
extern WDDomain *WDWindowAttributes;
typedef struct _CrashPanel { typedef struct _CrashPanel {
WMWindow *win; /* main window */ WMWindow *win; /* main window */

View File

@@ -76,11 +76,6 @@ struct WPreferences wPreferences;
WShortKey wKeyBindings[WKBD_LAST]; WShortKey wKeyBindings[WKBD_LAST];
/* defaults domains */
WDDomain *WDWindowMaker = NULL;
WDDomain *WDWindowAttributes = NULL;
WDDomain *WDRootMenu = NULL;
/* notifications */ /* notifications */
const char WMNManaged[] = "WMNManaged"; const char WMNManaged[] = "WMNManaged";
const char WMNUnmanaged[] = "WMNUnmanaged"; const char WMNUnmanaged[] = "WMNUnmanaged";

View File

@@ -60,7 +60,6 @@
#define MAX_SHORTCUT_LENGTH 32 #define MAX_SHORTCUT_LENGTH 32
extern WDDomain *WDRootMenu;
static WMenu *readMenuPipe(WScreen * scr, char **file_name); static WMenu *readMenuPipe(WScreen * scr, char **file_name);
static WMenu *readPLMenuPipe(WScreen * scr, char **file_name); static WMenu *readPLMenuPipe(WScreen * scr, char **file_name);
@@ -1462,7 +1461,7 @@ static WMenu *configureMenu(WScreen * scr, WMPropList * definition, Bool include
if (!scr->root_menu || stat_buf.st_mtime > scr->root_menu->timestamp if (!scr->root_menu || stat_buf.st_mtime > scr->root_menu->timestamp
/* if the pointer in WMRootMenu has changed */ /* if the pointer in WMRootMenu has changed */
|| WDRootMenu->timestamp > scr->root_menu->timestamp) { || w_global.domain.root_menu->timestamp > scr->root_menu->timestamp) {
if (menu_is_default) { if (menu_is_default) {
wwarning(_ wwarning(_
@@ -1472,7 +1471,7 @@ static WMenu *configureMenu(WScreen * scr, WMPropList * definition, Bool include
menu = readMenuFile(scr, path); menu = readMenuFile(scr, path);
if (menu) if (menu)
menu->timestamp = WMAX(stat_buf.st_mtime, WDRootMenu->timestamp); menu->timestamp = WMAX(stat_buf.st_mtime, w_global.domain.root_menu->timestamp);
} else { } else {
menu = NULL; menu = NULL;
} }
@@ -1617,17 +1616,17 @@ void OpenRootMenu(WScreen * scr, int x, int y, int keyboard)
return; return;
} }
definition = WDRootMenu->dictionary; definition = w_global.domain.root_menu->dictionary;
/* /*
definition = PLGetDomain(domain); definition = PLGetDomain(domain);
*/ */
if (definition) { if (definition) {
if (WMIsPLArray(definition)) { if (WMIsPLArray(definition)) {
if (!scr->root_menu || WDRootMenu->timestamp > scr->root_menu->timestamp) { if (!scr->root_menu || w_global.domain.root_menu->timestamp > scr->root_menu->timestamp) {
menu = configureMenu(scr, definition, True); menu = configureMenu(scr, definition, True);
if (menu) if (menu)
menu->timestamp = WDRootMenu->timestamp; menu->timestamp = w_global.domain.root_menu->timestamp;
} else } else
menu = NULL; menu = NULL;

View File

@@ -69,11 +69,6 @@
|SubstructureRedirectMask|ButtonPressMask|ButtonReleaseMask\ |SubstructureRedirectMask|ButtonPressMask|ButtonReleaseMask\
|KeyPressMask|KeyReleaseMask) |KeyPressMask|KeyReleaseMask)
/**** Global variables ****/
extern WDDomain *WDWindowMaker;
/**** Local ****/
#define STIPPLE_WIDTH 2 #define STIPPLE_WIDTH 2
#define STIPPLE_HEIGHT 2 #define STIPPLE_HEIGHT 2
static char STIPPLE_DATA[] = { 0x02, 0x01 }; static char STIPPLE_DATA[] = { 0x02, 0x01 };
@@ -619,7 +614,7 @@ WScreen *wScreenInit(int screen_number)
scr->info_window = XCreateSimpleWindow(dpy, scr->root_win, 0, 0, 10, 10, 0, 0, 0); scr->info_window = XCreateSimpleWindow(dpy, scr->root_win, 0, 0, 10, 10, 0, 0, 0);
/* read defaults for this screen */ /* read defaults for this screen */
wReadDefaults(scr, WDWindowMaker->dictionary); wReadDefaults(scr, w_global.domain.wmaker->dictionary);
{ {
XColor xcol; XColor xcol;

View File

@@ -85,9 +85,6 @@
#endif #endif
/****** Global Variables ******/ /****** Global Variables ******/
extern WDDomain *WDWindowMaker;
extern WDDomain *WDRootMenu;
extern WDDomain *WDWindowAttributes;
extern WShortKey wKeyBindings[WKBD_LAST]; extern WShortKey wKeyBindings[WKBD_LAST];
/***** Local *****/ /***** Local *****/
@@ -560,13 +557,13 @@ void StartUp(Bool defaultScreenOnly)
WMHookEventHandler(DispatchEvent); WMHookEventHandler(DispatchEvent);
/* initialize defaults stuff */ /* initialize defaults stuff */
WDWindowMaker = wDefaultsInitDomain("WindowMaker", True); w_global.domain.wmaker = wDefaultsInitDomain("WindowMaker", True);
if (!WDWindowMaker->dictionary) if (!w_global.domain.wmaker->dictionary)
wwarning(_("could not read domain \"%s\" from defaults database"), "WindowMaker"); wwarning(_("could not read domain \"%s\" from defaults database"), "WindowMaker");
/* read defaults that don't change until a restart and are /* read defaults that don't change until a restart and are
* screen independent */ * screen independent */
wReadStaticDefaults(WDWindowMaker ? WDWindowMaker->dictionary : NULL); wReadStaticDefaults(w_global.domain.wmaker ? w_global.domain.wmaker->dictionary : NULL);
/* check sanity of some values */ /* check sanity of some values */
if (wPreferences.icon_size < 16) { if (wPreferences.icon_size < 16) {
@@ -576,14 +573,14 @@ void StartUp(Bool defaultScreenOnly)
} }
/* init other domains */ /* init other domains */
WDRootMenu = wDefaultsInitDomain("WMRootMenu", False); w_global.domain.root_menu = wDefaultsInitDomain("WMRootMenu", False);
if (!WDRootMenu->dictionary) if (!w_global.domain.root_menu->dictionary)
wwarning(_("could not read domain \"%s\" from defaults database"), "WMRootMenu"); wwarning(_("could not read domain \"%s\" from defaults database"), "WMRootMenu");
wDefaultsMergeGlobalMenus(WDRootMenu); wDefaultsMergeGlobalMenus(w_global.domain.root_menu);
WDWindowAttributes = wDefaultsInitDomain("WMWindowAttributes", True); w_global.domain.window_attr = wDefaultsInitDomain("WMWindowAttributes", True);
if (!WDWindowAttributes->dictionary) if (!w_global.domain.window_attr->dictionary)
wwarning(_("could not read domain \"%s\" from defaults database"), "WMWindowAttributes"); wwarning(_("could not read domain \"%s\" from defaults database"), "WMWindowAttributes");
XSetErrorHandler((XErrorHandler) catchXError); XSetErrorHandler((XErrorHandler) catchXError);

View File

@@ -47,9 +47,6 @@
if (value) {attr->flag = getBool(attrib, value); \ if (value) {attr->flag = getBool(attrib, value); \
if (mask) mask->flag = 1;} if (mask) mask->flag = 1;}
/* Global stuff */
extern WDDomain *WDWindowAttributes;
/* Local stuff */ /* Local stuff */
/* type converters */ /* type converters */
@@ -177,8 +174,8 @@ static WMPropList *get_value_from_instanceclass(const char *value)
WMPLSetCaseSensitive(True); WMPLSetCaseSensitive(True);
if (WDWindowAttributes->dictionary) if (w_global.domain.window_attr->dictionary)
val = key ? WMGetFromPLDictionary(WDWindowAttributes->dictionary, key) : NULL; val = key ? WMGetFromPLDictionary(w_global.domain.window_attr->dictionary, key) : NULL;
if (key) if (key)
WMReleasePropList(key); WMReleasePropList(key);
@@ -222,8 +219,8 @@ void wDefaultFillAttributes(const char *instance, const char *class,
WMPLSetCaseSensitive(True); WMPLSetCaseSensitive(True);
if ((WDWindowAttributes->dictionary) && (useGlobalDefault)) if ((w_global.domain.window_attr->dictionary) && (useGlobalDefault))
da = WMGetFromPLDictionary(WDWindowAttributes->dictionary, AnyWindow); da = WMGetFromPLDictionary(w_global.domain.window_attr->dictionary, AnyWindow);
/* get the data */ /* get the data */
value = get_value(dw, dc, dn, da, ANoTitlebar, No, useGlobalDefault); value = get_value(dw, dc, dn, da, ANoTitlebar, No, useGlobalDefault);
@@ -331,7 +328,7 @@ static WMPropList *get_generic_value(const char *instance, const char *class,
key = WMCreatePLString(buffer); key = WMCreatePLString(buffer);
wfree(buffer); wfree(buffer);
dict = WMGetFromPLDictionary(WDWindowAttributes->dictionary, key); dict = WMGetFromPLDictionary(w_global.domain.window_attr->dictionary, key);
WMReleasePropList(key); WMReleasePropList(key);
if (dict) if (dict)
@@ -342,7 +339,7 @@ static WMPropList *get_generic_value(const char *instance, const char *class,
if (!value && instance) { if (!value && instance) {
key = WMCreatePLString(instance); key = WMCreatePLString(instance);
dict = WMGetFromPLDictionary(WDWindowAttributes->dictionary, key); dict = WMGetFromPLDictionary(w_global.domain.window_attr->dictionary, key);
WMReleasePropList(key); WMReleasePropList(key);
if (dict) if (dict)
@@ -353,7 +350,7 @@ static WMPropList *get_generic_value(const char *instance, const char *class,
if (!value && class) { if (!value && class) {
key = WMCreatePLString(class); key = WMCreatePLString(class);
dict = WMGetFromPLDictionary(WDWindowAttributes->dictionary, key); dict = WMGetFromPLDictionary(w_global.domain.window_attr->dictionary, key);
WMReleasePropList(key); WMReleasePropList(key);
if (dict) if (dict)
@@ -363,7 +360,7 @@ static WMPropList *get_generic_value(const char *instance, const char *class,
/* Search the default icon name - See default_icon argument! */ /* Search the default icon name - See default_icon argument! */
if (!value && default_icon) { if (!value && default_icon) {
/* AnyWindow is "*" - see wdefaults.c */ /* AnyWindow is "*" - see wdefaults.c */
dict = WMGetFromPLDictionary(WDWindowAttributes->dictionary, AnyWindow); dict = WMGetFromPLDictionary(w_global.domain.window_attr->dictionary, AnyWindow);
if (dict) if (dict)
value = WMGetFromPLDictionary(dict, option); value = WMGetFromPLDictionary(dict, option);
@@ -403,12 +400,12 @@ char *get_icon_filename(const char *winstance, const char *wclass, const char *c
wwarning(_("icon \"%s\" doesn't exist, check your config files"), file_name); wwarning(_("icon \"%s\" doesn't exist, check your config files"), file_name);
/* FIXME: Here, if file_path don't exists, then the icon is in the /* FIXME: Here, if file_path don't exists, then the icon is in the
* "icon database" (WDWindowAttributes->dictionary), but the icon * "icon database" (w_global.domain.window_attr->dictionary), but the icon
* is not en disk. Therefore, we should remove it from the icon * is not en disk. Therefore, we should remove it from the icon
* database. Is possible to do that using wDefaultChangeIcon() */ * database. Is possible to do that using wDefaultChangeIcon() */
/* Don't wfree(file_name) here, because is a pointer to the icon /* Don't wfree(file_name) here, because is a pointer to the icon
* dictionary (WDWindowAttributes->dictionary) value. */ * dictionary (w_global.domain.window_attr->dictionary) value. */
} }
if (!file_path && default_icon) if (!file_path && default_icon)
@@ -491,7 +488,7 @@ int wDefaultGetStartWorkspace(WScreen *scr, const char *instance, const char *cl
if (!ANoTitlebar) if (!ANoTitlebar)
init_wdefaults(); init_wdefaults();
if (!WDWindowAttributes->dictionary) if (!w_global.domain.window_attr->dictionary)
return -1; return -1;
value = get_generic_value(instance, class, AStartWorkspace, True); value = get_generic_value(instance, class, AStartWorkspace, True);
@@ -519,7 +516,7 @@ char *wDefaultGetIconFile(const char *instance, const char *class, Bool default_
if (!ANoTitlebar) if (!ANoTitlebar)
init_wdefaults(); init_wdefaults();
if (!WDWindowAttributes || !WDWindowAttributes->dictionary) if (!w_global.domain.window_attr || !w_global.domain.window_attr->dictionary)
return NULL; return NULL;
value = get_generic_value(instance, class, AIcon, default_icon); value = get_generic_value(instance, class, AIcon, default_icon);
@@ -534,7 +531,7 @@ char *wDefaultGetIconFile(const char *instance, const char *class, Bool default_
void wDefaultChangeIcon(WScreen *scr, const char *instance, const char *class, const char *file) void wDefaultChangeIcon(WScreen *scr, const char *instance, const char *class, const char *file)
{ {
WDDomain *db = WDWindowAttributes; WDDomain *db = w_global.domain.window_attr;
WMPropList *icon_value = NULL, *value, *attr, *key, *def_win, *def_icon = NULL; WMPropList *icon_value = NULL, *value, *attr, *key, *def_win, *def_icon = NULL;
WMPropList *dict = db->dictionary; WMPropList *dict = db->dictionary;
int same = 0; int same = 0;
@@ -611,15 +608,15 @@ void wDefaultPurgeInfo(WScreen *scr, const char *instance, const char *class)
sprintf(buffer, "%s.%s", instance, class); sprintf(buffer, "%s.%s", instance, class);
key = WMCreatePLString(buffer); key = WMCreatePLString(buffer);
dict = WMGetFromPLDictionary(WDWindowAttributes->dictionary, key); dict = WMGetFromPLDictionary(w_global.domain.window_attr->dictionary, key);
if (dict) { if (dict) {
value = WMGetFromPLDictionary(dict, AIcon); value = WMGetFromPLDictionary(dict, AIcon);
if (value) { if (value) {
WMRemoveFromPLDictionary(dict, AIcon); WMRemoveFromPLDictionary(dict, AIcon);
} }
WMRemoveFromPLDictionary(WDWindowAttributes->dictionary, key); WMRemoveFromPLDictionary(w_global.domain.window_attr->dictionary, key);
UpdateDomainFile(WDWindowAttributes); UpdateDomainFile(w_global.domain.window_attr);
} }
wfree(buffer); wfree(buffer);

View File

@@ -114,8 +114,6 @@ typedef struct InspectorPanel {
unsigned int choosingIcon:1; unsigned int choosingIcon:1;
} InspectorPanel; } InspectorPanel;
extern WDDomain *WDWindowAttributes;
static InspectorPanel *panelList = NULL; static InspectorPanel *panelList = NULL;
static WMPropList *ANoTitlebar = NULL; static WMPropList *ANoTitlebar = NULL;
static WMPropList *ANoResizebar; static WMPropList *ANoResizebar;
@@ -430,7 +428,7 @@ insertAttribute(WMPropList *dict, WMPropList *window, WMPropList *attr, WMPropLi
static void saveSettings(WMButton *button, InspectorPanel *panel) static void saveSettings(WMButton *button, InspectorPanel *panel)
{ {
WWindow *wwin = panel->inspected; WWindow *wwin = panel->inspected;
WDDomain *db = WDWindowAttributes; WDDomain *db = w_global.domain.window_attr;
WMPropList *dict = NULL; WMPropList *dict = NULL;
WMPropList *winDic, *appDic, *value, *value1, *key = NULL, *key2; WMPropList *winDic, *appDic, *value, *value1, *key = NULL, *key2;
char *icon_file, *buf1, *buf2; char *icon_file, *buf1, *buf2;