aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xwin/winprefs.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-03-07 07:56:07 +0000
committermarha <marha@users.sourceforge.net>2011-03-07 07:56:07 +0000
commit43ac73d271f697d91670fd6cb120489acc03aaeb (patch)
tree2109e1e6eac063c74cc146842aeeeb27a86cec02 /xorg-server/hw/xwin/winprefs.c
parent4f70194d203322cf1ec38767098976797c116f0c (diff)
downloadvcxsrv-43ac73d271f697d91670fd6cb120489acc03aaeb.tar.gz
vcxsrv-43ac73d271f697d91670fd6cb120489acc03aaeb.tar.bz2
vcxsrv-43ac73d271f697d91670fd6cb120489acc03aaeb.zip
Made winOverrideStyle thread safe
Diffstat (limited to 'xorg-server/hw/xwin/winprefs.c')
-rw-r--r--xorg-server/hw/xwin/winprefs.c26
1 files changed, 3 insertions, 23 deletions
diff --git a/xorg-server/hw/xwin/winprefs.c b/xorg-server/hw/xwin/winprefs.c
index f24074636..e92e95f2b 100644
--- a/xorg-server/hw/xwin/winprefs.c
+++ b/xorg-server/hw/xwin/winprefs.c
@@ -821,40 +821,20 @@ LoadPreferences (void)
* STYLES{} section in the prefs file, and return the style type
*/
unsigned long
-winOverrideStyle (unsigned long longpWin)
+winOverrideStyle (char *res_name, char *res_class, char *wmName)
{
- WindowPtr pWin = (WindowPtr) longpWin;
- char *res_name, *res_class;
int i;
- char *wmName;
-
- if (pWin==NULL)
- return STYLE_NONE;
-
- /* If we can't find the class, we can't override from default! */
- if (!winMultiWindowGetClassHint (pWin, &res_name, &res_class))
- return STYLE_NONE;
-
- winMultiWindowGetWMName (pWin, &wmName);
for (i=0; i<pref.styleItems; i++) {
- if (!strcmp(pref.style[i].match, res_name) ||
- !strcmp(pref.style[i].match, res_class) ||
+ if ((res_name && !strcmp(pref.style[i].match, res_name)) ||
+ (res_class && !strcmp(pref.style[i].match, res_class)) ||
(wmName && strstr(wmName, pref.style[i].match)))
{
- free (res_name);
- free (res_class);
- free(wmName);
-
if (pref.style[i].type)
return pref.style[i].type;
}
}
/* Didn't find the style, fail gracefully */
- free (res_name);
- free (res_class);
- free(wmName);
-
return STYLE_NONE;
}