29#define _NET_WM_STATE_REMOVE 0
30#define _NET_WM_STATE_ADD 1
31#define _NET_WM_STATE_TOGGLE 2
39 unsigned long *nitems_return,
unsigned char **prop_return,
int nowarn)
43 Atom actual_type_return;
44 int actual_format_return;
45 unsigned long bytes_after_return;
47 property = XInternAtom(
This->display, propname,
True);
59 &actual_format_return,
60 nitems_return, &bytes_after_return, prop_return);
68 if (actual_type_return ==
None || actual_format_return == 0)
75 if (bytes_after_return)
81 if (actual_format_return != 32)
97 unsigned long nitems_return;
98 unsigned char *prop_return;
102 (
This, DefaultRootWindow(
This->display),
"_NET_CURRENT_DESKTOP", 1, &nitems_return,
103 &prop_return, 0) < 0)
106 if (nitems_return != 1)
112 current_desktop = *prop_return;
114 return current_desktop;
126 unsigned long nitems_return;
127 unsigned char *prop_return;
129 const uint32 net_workarea_x_offset = 0;
130 const uint32 net_workarea_y_offset = 1;
131 const uint32 net_workarea_width_offset = 2;
132 const uint32 net_workarea_height_offset = 3;
133 const uint32 max_prop_length = 32 * 4;
136 (
This, DefaultRootWindow(
This->display),
"_NET_WORKAREA", max_prop_length, &nitems_return,
137 &prop_return, 0) < 0)
140 if (nitems_return % 4)
148 if (current_desktop < 0)
151 return_words = (
uint32 *) prop_return;
153 *
x = return_words[current_desktop * 4 + net_workarea_x_offset];
154 *
y = return_words[current_desktop * 4 + net_workarea_y_offset];
155 *
width = return_words[current_desktop * 4 + net_workarea_width_offset];
156 *
height = return_words[current_desktop * 4 + net_workarea_height_offset];
170 This->ewmhints.state_maximized_vert_atom =
171 XInternAtom(
This->display,
"_NET_WM_STATE_MAXIMIZED_VERT",
False);
172 This->ewmhints.state_maximized_horz_atom =
173 XInternAtom(
This->display,
"_NET_WM_STATE_MAXIMIZED_HORZ",
False);
174 This->ewmhints.state_hidden_atom = XInternAtom(
This->display,
"_NET_WM_STATE_HIDDEN",
False);
175 This->ewmhints.state_skip_taskbar_atom =
176 XInternAtom(
This->display,
"_NET_WM_STATE_SKIP_TASKBAR",
False);
177 This->ewmhints.state_skip_pager_atom = XInternAtom(
This->display,
"_NET_WM_STATE_SKIP_PAGER",
False);
178 This->ewmhints.state_modal_atom = XInternAtom(
This->display,
"_NET_WM_STATE_MODAL",
False);
179 This->net_wm_state_atom = XInternAtom(
This->display,
"_NET_WM_STATE",
False);
180 This->net_wm_desktop_atom = XInternAtom(
This->display,
"_NET_WM_DESKTOP",
False);
181 This->ewmhints.name_atom = XInternAtom(
This->display,
"_NET_WM_NAME",
False);
182 This->ewmhints.utf8_string_atom = XInternAtom(
This->display,
"UTF8_STRING",
False);
193 unsigned long nitems_return;
194 unsigned char *prop_return;
204 return_words = (
uint32 *) prop_return;
208 if (return_words[
item] ==
This->ewmhints.state_maximized_vert_atom)
209 maximized_vert =
True;
210 if (return_words[
item] ==
This->ewmhints.state_maximized_horz_atom)
211 maximized_horz =
True;
212 if (return_words[
item] ==
This->ewmhints.state_hidden_atom)
218 if (maximized_vert && maximized_horz)
233 unsigned long nitems;
234 unsigned char *
props;
242 if ((
result >= 0) && nitems)
248 if (
state == WithdrawnState)
262 XChangeProperty(
This->display, wnd,
This->net_wm_state_atom, XA_ATOM,
263 32, PropModeAppend, (
unsigned char *) atoms, nitems);
275 for (
i = 0;
i < nitems;
i++)
277 if ((atoms[
i] == atom1) || (atom2 && (atoms[
i] == atom2)))
279 if (
i != (nitems - 1))
281 sizeof(
Atom) * (nitems -
i - 1));
287 XChangeProperty(
This->display, wnd,
This->net_wm_state_atom, XA_ATOM,
288 32, PropModeReplace, (
unsigned char *) atoms, nitems);
296 xevent.type = ClientMessage;
297 xevent.xclient.window = wnd;
298 xevent.xclient.message_type =
This->net_wm_state_atom;
299 xevent.xclient.format = 32;
304 xevent.xclient.data.l[1] = atom1;
305 xevent.xclient.data.l[2] = atom2;
306 xevent.xclient.data.l[3] = 0;
307 xevent.xclient.data.l[4] = 0;
309 SubstructureNotifyMask | SubstructureRedirectMask, &xevent);
329 (
This, wnd, 1,
This->ewmhints.state_maximized_vert_atom,
330 This->ewmhints.state_maximized_horz_atom) < 0)
336 (
This, wnd, 0,
This->ewmhints.state_maximized_vert_atom,
337 This->ewmhints.state_maximized_horz_atom) < 0)
348 unsigned long nitems_return;
349 unsigned char *prop_return;
355 if (nitems_return != 1)
361 desktop = *prop_return;
373 xevent.type = ClientMessage;
374 xevent.xclient.window = wnd;
375 xevent.xclient.message_type =
This->net_wm_desktop_atom;
376 xevent.xclient.format = 32;
377 xevent.xclient.data.l[0] = desktop;
378 xevent.xclient.data.l[1] = 0;
379 xevent.xclient.data.l[2] = 0;
380 xevent.xclient.data.l[3] = 0;
381 xevent.xclient.data.l[4] = 0;
383 SubstructureNotifyMask | SubstructureRedirectMask, &xevent);
396 XChangeProperty(
This->display, wnd,
This->ewmhints.name_atom,
This->ewmhints.utf8_string_atom,
397 8, PropModeReplace, (
unsigned char *)
title,
len);
405 (
This, wnd, 1,
This->ewmhints.state_skip_taskbar_atom,
This->ewmhints.state_skip_pager_atom) < 0)
433 moveresize = XInternAtom(
This->display,
"_NET_MOVERESIZE_WINDOW",
False);
439 xevent.type = ClientMessage;
440 xevent.xclient.window = wnd;
441 xevent.xclient.message_type = moveresize;
442 xevent.xclient.format = 32;
443 xevent.xclient.data.l[0] = StaticGravity | (1 << 8) | (1 << 9) | (1 << 10) | (1 << 11);
444 xevent.xclient.data.l[1] =
x;
445 xevent.xclient.data.l[2] =
y;
446 xevent.xclient.data.l[3] =
width;
447 xevent.xclient.data.l[4] =
height;
450 SubstructureNotifyMask | SubstructureRedirectMask, &xevent);
ACPI_SIZE strlen(const char *String)
#define SEAMLESSRDP_MAXIMIZED
#define SEAMLESSRDP_MINIMIZED
#define SEAMLESSRDP_NORMAL
void ewmh_set_wm_name(RDPCLIENT *This, Window wnd, const char *title)
#define _NET_WM_STATE_REMOVE
int ewmh_move_to_desktop(RDPCLIENT *This, Window wnd, unsigned int desktop)
int ewmh_set_window_modal(RDPCLIENT *This, Window wnd)
int ewmh_set_window_popup(RDPCLIENT *This, Window wnd)
static int ewmh_modify_state(RDPCLIENT *This, Window wnd, int add, Atom atom1, Atom atom2)
static int get_property_value(RDPCLIENT *This, Window wnd, char *propname, long max_length, unsigned long *nitems_return, unsigned char **prop_return, int nowarn)
int ewmh_change_state(RDPCLIENT *This, Window wnd, int state)
int get_current_workarea(RDPCLIENT *This, uint32 *x, uint32 *y, uint32 *width, uint32 *height)
static int get_current_desktop(RDPCLIENT *This)
int ewmh_get_window_state(RDPCLIENT *This, Window w)
#define _NET_WM_STATE_ADD
int ewmh_get_window_desktop(RDPCLIENT *This, Window wnd)
GLint GLint GLint GLint GLint x
GLint GLint GLint GLint GLint GLint y
GLint GLint GLsizei GLsizei height
GLint GLint GLsizei width
GLubyte GLubyte GLubyte GLubyte w
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
#define memmove(s1, s2, n)
static const WCHAR props[]