/[rdesktop]/sourceforge.net/branches/seamlessrdp-branch/rdesktop/ewmhints.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /sourceforge.net/branches/seamlessrdp-branch/rdesktop/ewmhints.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1182 by ossman_, Tue Mar 21 14:42:25 2006 UTC revision 1183 by ossman_, Wed Mar 22 09:49:21 2006 UTC
# Line 237  ewmh_modify_state(Window wnd, int add, A Line 237  ewmh_modify_state(Window wnd, int add, A
237          Status status;          Status status;
238          XEvent xevent;          XEvent xevent;
239    
240            int result;
241          unsigned long nitems;          unsigned long nitems;
242          unsigned char *props;          unsigned char *props;
243          uint32 *state;          uint32 state;
244    
245          /* The spec states that the window manager must respect any          /* The spec states that the window manager must respect any
246             _NET_WM_STATE attributes on a withdrawn window. In order words, we             _NET_WM_STATE attributes on a withdrawn window. In order words, we
247             modify the attributes directly for withdrawn windows and ask the WM             modify the attributes directly for withdrawn windows and ask the WM
248             to do it for active windows. */             to do it for active windows. */
249          if ((get_property_value(wnd, "WM_STATE", 64, &nitems, &props, 1) < 0)          result = get_property_value(wnd, "WM_STATE", 64, &nitems, &props, 1);
250              || ((state = (uint32 *) props)[0] == WithdrawnState))          if ((result >= 0) && nitems)
251            {
252                    state = *(uint32 *) props;
253                    XFree(props);
254            }
255    
256            if ((result < 0) || !nitems || (state == WithdrawnState))
257          {          {
258                  if (add)                  if (add)
259                  {                  {
# Line 287  ewmh_modify_state(Window wnd, int add, A Line 294  ewmh_modify_state(Window wnd, int add, A
294    
295                          XChangeProperty(g_display, wnd, g_net_wm_state_atom, XA_ATOM,                          XChangeProperty(g_display, wnd, g_net_wm_state_atom, XA_ATOM,
296                                          32, PropModeReplace, (unsigned char *) atoms, nitems);                                          32, PropModeReplace, (unsigned char *) atoms, nitems);
297    
298                            XFree(props);
299                  }                  }
300    
301                  return 0;                  return 0;

Legend:
Removed from v.1182  
changed lines
  Added in v.1183

  ViewVC Help
Powered by ViewVC 1.1.26