View | Details | Raw Unified | Return to bug 114490
Collapse All | Expand All

(-)lib/Xcursor.orig/display.c (-8 / +29 lines)
Lines 27-32 Link Here
27
27
28
static XcursorDisplayInfo *_XcursorDisplayInfo;
28
static XcursorDisplayInfo *_XcursorDisplayInfo;
29
29
30
static void
31
_XcursorFreeDisplayInfo (XcursorDisplayInfo *info)
32
{
33
    if (info->theme)
34
	free (info->theme);
35
36
    if (info->theme_from_config)
37
	free (info->theme_from_config);
38
39
    free (info);
40
}
41
30
static int
42
static int
31
_XcursorCloseDisplay (Display *dpy, XExtCodes *codes)
43
_XcursorCloseDisplay (Display *dpy, XExtCodes *codes)
32
{
44
{
Lines 43-52 _XcursorCloseDisplay (Display *dpy, XExt Link Here
43
	    break;
55
	    break;
44
	}
56
	}
45
    _XUnlockMutex (_Xglobal_lock);
57
    _XUnlockMutex (_Xglobal_lock);
46
    
58
47
    if (info->theme)
59
    _XcursorFreeDisplayInfo (info);
48
	free (info->theme);
49
    free (info);
50
    return 0;
60
    return 0;
51
}
61
}
52
62
Lines 189-194 _XcursorGetDisplayInfo (Display *dpy) Link Here
189
    }
199
    }
190
    
200
    
191
    info->theme = 0;
201
    info->theme = 0;
202
    info->theme_from_config = 0;
192
203
193
    /*
204
    /*
194
     * Get the desired theme
205
     * Get the desired theme
Lines 198-206 _XcursorGetDisplayInfo (Display *dpy) Link Here
198
	v = XGetDefault (dpy, "Xcursor", "theme");
209
	v = XGetDefault (dpy, "Xcursor", "theme");
199
    if (v)
210
    if (v)
200
    {
211
    {
201
	info->theme = malloc (strlen (v) + 1);
212
	int len;
213
214
	len = strlen (v) + 1;
215
216
	info->theme = malloc (len);
202
	if (info->theme)
217
	if (info->theme)
203
	    strcpy (info->theme, v);
218
	    strcpy (info->theme, v);
219
220
	info->theme_from_config = malloc (len);
221
	if (info->theme_from_config)
222
	    strcpy (info->theme_from_config, v);
204
    }
223
    }
205
224
206
    /*
225
    /*
Lines 252-260 _XcursorGetDisplayInfo (Display *dpy) Link Here
252
	    break;
271
	    break;
253
    if (old)
272
    if (old)
254
    {
273
    {
255
	if (info->theme)
274
	_XcursorFreeDisplayInfo (info);
256
	    free (info->theme);
257
	free (info);
258
	info = old;
275
	info = old;
259
    }
276
    }
260
    else
277
    else
Lines 312-317 XcursorSetTheme (Display *dpy, const cha Link Here
312
329
313
    if (!info)
330
    if (!info)
314
	return XcursorFalse;
331
	return XcursorFalse;
332
333
    if (!theme)
334
	theme = info->theme_from_config;
335
315
    if (theme)
336
    if (theme)
316
    {
337
    {
317
	copy = malloc (strlen (theme) + 1);
338
	copy = malloc (strlen (theme) + 1);
(-)lib/Xcursor.orig/xcursorint.h (+1 lines)
Lines 85-90 typedef struct _XcursorDisplayInfo { Link Here
85
    int				size;
85
    int				size;
86
    XcursorFontInfo		*fonts;
86
    XcursorFontInfo		*fonts;
87
    char			*theme;
87
    char			*theme;
88
    char                        *theme_from_config;
88
    XcursorDither		dither;
89
    XcursorDither		dither;
89
    XcursorBitmapInfo		bitmaps[NUM_BITMAPS];
90
    XcursorBitmapInfo		bitmaps[NUM_BITMAPS];
90
} XcursorDisplayInfo;
91
} XcursorDisplayInfo;

Return to bug 114490