~compiz-team/compiz-core/oneiric.force_output_detection

« back to all changes in this revision

Viewing changes to gtk/window-decorator/src/util.c

  • Committer: Sam Spilsbury
  • Date: 2011-08-19 18:23:21 UTC
  • Revision ID: sam.spilsbury@canonical.com-20110819182321-iqbupv0eodx3jlyb
Unmerge the new decorator

Show diffs side-by-side

added added

removed removed

Lines of Context:
59
59
                                 &bytes_after, (void*) &w);
60
60
    err = gdk_error_trap_pop ();
61
61
    if (err != Success || result != Success)
62
 
    {
63
62
        return FALSE;
64
 
    }
65
63
 
66
64
    if (type != XA_WINDOW)
67
65
    {
113
111
    return decor;
114
112
}
115
113
 
116
 
Atom
117
 
get_atom_prop (Window xwindow,
118
 
               Atom   property,
119
 
               Atom   req)
120
 
{
121
 
    Atom              actual;
122
 
    int       result, format;
123
 
    unsigned long n, left;
124
 
    unsigned char *prop_data;
125
 
    Atom          *data;
126
 
    gint          err;
127
 
 
128
 
    gdk_error_trap_push ();
129
 
 
130
 
    result = XGetWindowProperty (gdk_x11_get_default_xdisplay (),
131
 
                                 xwindow,
132
 
                                 property,
133
 
                                 0L, 1024L, FALSE, XA_ATOM, &actual, &format,
134
 
                                 &n, &left, &prop_data);
135
 
 
136
 
    err = gdk_error_trap_pop ();
137
 
    if (err != Success || result != Success)
138
 
    {
139
 
        g_warning ("X Error while trying to fetch property");
140
 
        return 0;
141
 
    }
142
 
 
143
 
    data = (Atom *) prop_data;
144
 
 
145
 
    if (result == Success && data)
146
 
    {
147
 
        Atom *a = data;
148
 
 
149
 
        while (n--)
150
 
        {
151
 
            if (*a++ == req)
152
 
            {
153
 
                XFree (prop_data);
154
 
                return req;
155
 
                break;
156
 
            }
157
 
 
158
 
            data++;
159
 
        }
160
 
 
161
 
        XFree (prop_data);
162
 
    }
163
 
 
164
 
    return 0;
165
 
}
166
 
 
167
114
/* from clearlooks theme */
168
115
static void
169
116
rgb_to_hls (gdouble *r,