/[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 466 by astrand, Mon Sep 8 08:27:57 2003 UTC revision 1013 by astrand, Mon Sep 12 12:36:45 2005 UTC
# Line 1  Line 1 
1  /*  /* -*- c-basic-offset: 8 -*-
2     rdesktop: A Remote Desktop Protocol client.     rdesktop: A Remote Desktop Protocol client.
3    
4     Support functions for Extended Window Manager Hints,     Support functions for Extended Window Manager Hints,
5     http://www.freedesktop.org/standards/wm-spec.html     http://www.freedesktop.org/wiki/Standards_2fwm_2dspec
6    
7     Copyright (C) Matthew Chapman 1999-2002     Copyright (C) Peter Astrand <astrand@cendio.se> 2005
    Copyright (C) Peter Astrand <peter@cendio.se> 2003  
8        
9     This program is free software; you can redistribute it and/or modify     This program is free software; you can redistribute it and/or modify
10     it under the terms of the GNU General Public License as published by     it under the terms of the GNU General Public License as published by
# Line 94  get_current_desktop(void) Line 93  get_current_desktop(void)
93          unsigned char *prop_return;          unsigned char *prop_return;
94          int current_desktop;          int current_desktop;
95    
96          if (get_property_value("_NET_CURRENT_DESKTOP", 1, &nitems_return,          if (get_property_value("_NET_CURRENT_DESKTOP", 1, &nitems_return, &prop_return) < 0)
                                &prop_return) < 0)  
97                  return (-1);                  return (-1);
98    
99          if (nitems_return != 1)          if (nitems_return != 1)
# Line 127  get_current_workarea(uint32 * x, uint32 Line 125  get_current_workarea(uint32 * x, uint32
125          const uint32 net_workarea_height_offset = 3;          const uint32 net_workarea_height_offset = 3;
126          const uint32 max_prop_length = 32 * 4;  /* Max 32 desktops */          const uint32 max_prop_length = 32 * 4;  /* Max 32 desktops */
127    
128          if (get_property_value("_NET_WORKAREA", max_prop_length, &nitems_return,          if (get_property_value("_NET_WORKAREA", max_prop_length, &nitems_return, &prop_return) < 0)
                                &prop_return) < 0)  
129                  return (-1);                  return (-1);
130    
131          if (nitems_return % 4)          if (nitems_return % 4)
# Line 142  get_current_workarea(uint32 * x, uint32 Line 139  get_current_workarea(uint32 * x, uint32
139          if (current_desktop < 0)          if (current_desktop < 0)
140                  return -1;                  return -1;
141    
142          return_words = (uint32 *)prop_return;          return_words = (uint32 *) prop_return;
143    
144          *x = return_words[current_desktop * 4 + net_workarea_x_offset];          *x = return_words[current_desktop * 4 + net_workarea_x_offset];
145          *y = return_words[current_desktop * 4 + net_workarea_y_offset];          *y = return_words[current_desktop * 4 + net_workarea_y_offset];
# Line 154  get_current_workarea(uint32 * x, uint32 Line 151  get_current_workarea(uint32 * x, uint32
151          return (0);          return (0);
152    
153  }  }
154    
155    
156    #if 0
157    
158    /* FIXME: _NET_MOVERESIZE_WINDOW is for pagers, not for
159       applications. We should implement _NET_WM_MOVERESIZE instead */
160    
161    int
162    ewmh_net_moveresize_window(Window wnd, int x, int y, int width, int height)
163    {
164            Status status;
165            XEvent xevent;
166            Atom moveresize;
167    
168            moveresize = XInternAtom(g_display, "_NET_MOVERESIZE_WINDOW", False);
169            if (!moveresize)
170            {
171                    return -1;
172            }
173    
174            xevent.type = ClientMessage;
175            xevent.xclient.window = wnd;
176            xevent.xclient.message_type = moveresize;
177            xevent.xclient.format = 32;
178            xevent.xclient.data.l[0] = StaticGravity | (1 << 8) | (1 << 9) | (1 << 10) | (1 << 11);
179            xevent.xclient.data.l[1] = x;
180            xevent.xclient.data.l[2] = y;
181            xevent.xclient.data.l[3] = width;
182            xevent.xclient.data.l[4] = height;
183    
184            status = XSendEvent(g_display, DefaultRootWindow(g_display), False,
185                                SubstructureNotifyMask | SubstructureRedirectMask, &xevent);
186            if (!status)
187                    return -1;
188            return 0;
189    }
190    
191    #endif

Legend:
Removed from v.466  
changed lines
  Added in v.1013

  ViewVC Help
Powered by ViewVC 1.1.26