add workareas get as requested in ticket #793 but actually support

more than 1 - for multi-screen.



SVN revision: 64804
This commit is contained in:
Carsten Haitzler 2011-11-06 09:16:00 +00:00
parent be0358a4f1
commit 4bfa1caf5c
3 changed files with 41 additions and 0 deletions

View File

@ -2045,6 +2045,9 @@ EAPI void
ecore_x_netwm_desk_workareas_set(Ecore_X_Window root,
unsigned int *areas,
unsigned int n_desks);
EAPI unsigned int *
ecore_x_netwm_desk_workareas_get(Ecore_X_Window root,
unsigned int *n_desks);
EAPI void
ecore_x_netwm_desk_current_set(Ecore_X_Window root,
unsigned int desk);

View File

@ -358,6 +358,25 @@ ecore_x_netwm_desk_workareas_set(Ecore_X_Window root,
4 * n_desks);
}
EAPI unsigned int *
ecore_x_netwm_desk_workareas_get(Ecore_X_Window root, unsigned int *n_desks)
{
int ret;
unsigned int *areas = NULL;
if (!root) root = ((xcb_screen_t *)_ecore_xcb_screen)->root;
ret = ecore_x_window_prop_card32_list_get(root, ECORE_X_ATOM_NET_WORKAREA,
&areas);
if (!areas)
{
if (n_desks) *n_desks = 0;
return 0;
}
if (n_desks) *n_desks = ret / 4;
return areas;
}
EAPI void
ecore_x_netwm_desk_current_set(Ecore_X_Window root,
unsigned int desk)

View File

@ -269,6 +269,25 @@ ecore_x_netwm_desk_workareas_set(Ecore_X_Window root,
4 * n_desks);
} /* ecore_x_netwm_desk_workareas_set */
EAPI unsigned int *
ecore_x_netwm_desk_workareas_get(Ecore_X_Window root, unsigned int *n_desks)
{
int ret;
unsigned int *areas = NULL;
if (!root) root = DefaultRootWindow(_ecore_x_disp);
ret = ecore_x_window_prop_card32_list_get(root, ECORE_X_ATOM_NET_WORKAREA,
&areas);
if (!areas)
{
if (n_desks) *n_desks = 0;
return 0;
}
if (n_desks) *n_desks = ret / 4;
return areas;
}
EAPI void
ecore_x_netwm_desk_current_set(Ecore_X_Window root,
unsigned int desk)