Add support for setting the _NET_WM_WORKAREA hint. No code does it yet

2002-04-28  Anders Carlsson  <andersca@gnu.org>

	* src/display.c: (meta_display_open):
	* src/display.h:
	* src/screen.c: (set_supported_hint):
	* src/workspace.c: (set_number_of_spaces_hint),
	(set_workarea_hint):
	Add support for setting the _NET_WM_WORKAREA hint. No code
	does it yet though.
This commit is contained in:
Anders Carlsson 2002-04-28 15:47:21 +00:00 committed by Anders Carlsson
parent e4e200a1dc
commit 53268f985f
5 changed files with 55 additions and 3 deletions

View File

@ -1,3 +1,13 @@
2002-04-28 Anders Carlsson <andersca@gnu.org>
* src/display.c: (meta_display_open):
* src/display.h:
* src/screen.c: (set_supported_hint):
* src/workspace.c: (set_number_of_spaces_hint),
(set_workarea_hint):
Add support for setting the _NET_WM_WORKAREA hint. No code
does it yet though.
2002-04-28 Havoc Pennington <hp@pobox.com>
* README: remove caveats about keybindings

View File

@ -204,7 +204,8 @@ meta_display_open (const char *name)
"_NET_WM_STATE_FULLSCREEN",
"_NET_WM_PING",
"_NET_WM_PID",
"WM_CLIENT_MACHINE"
"WM_CLIENT_MACHINE",
"_NET_WM_WORKAREA"
};
Atom atoms[G_N_ELEMENTS(atom_names)];
@ -311,6 +312,7 @@ meta_display_open (const char *name)
display->atom_net_wm_ping = atoms[53];
display->atom_net_wm_pid = atoms[54];
display->atom_wm_client_machine = atoms[55];
display->atom_net_wm_workarea = atoms[56];
/* Offscreen unmapped window used for _NET_SUPPORTING_WM_CHECK,
* created in screen_new

View File

@ -128,6 +128,7 @@ struct _MetaDisplay
Atom atom_net_wm_pid;
Atom atom_wm_client_machine;
Atom atom_net_wm_state_fullscreen;
Atom atom_net_wm_workarea;
/* This is the actual window from focus events,
* not the one we last set

View File

@ -82,7 +82,7 @@ set_wm_check_hint (MetaScreen *screen)
static int
set_supported_hint (MetaScreen *screen)
{
#define N_SUPPORTED 29
#define N_SUPPORTED 30
#define N_WIN_SUPPORTED 1
Atom atoms[N_SUPPORTED];
@ -115,6 +115,7 @@ set_supported_hint (MetaScreen *screen)
atoms[26] = screen->display->atom_net_wm_state_fullscreen;
atoms[27] = screen->display->atom_net_wm_ping;
atoms[28] = screen->display->atom_net_active_window;
atoms[29] = screen->display->atom_net_wm_workarea;
XChangeProperty (screen->display->xdisplay, screen->xroot,
screen->display->atom_net_supported,

View File

@ -27,6 +27,7 @@ void meta_workspace_queue_calc_showing (MetaWorkspace *workspace);
static int set_number_of_spaces_hint (MetaScreen *screen);
static int set_active_space_hint (MetaScreen *screen);
static int set_workarea_hint (MetaScreen *screen);
MetaWorkspace*
meta_workspace_new (MetaScreen *screen)
@ -313,6 +314,43 @@ set_number_of_spaces_hint (MetaScreen *screen)
return meta_error_trap_pop (screen->display);
}
static int
set_workarea_hint (MetaScreen *screen)
{
int num_workspaces;
GList *tmp_list;
unsigned long *data, *tmp;
MetaRectangle area;
num_workspaces = g_list_length (screen->display->workspaces);
data = g_new (unsigned long, num_workspaces);
tmp_list = screen->display->workspaces;
tmp = data;
while (tmp_list != NULL)
{
MetaWorkspace *workspace = tmp_list->data;
meta_workspace_get_work_area (workspace, &area);
tmp[0] = area.x;
tmp[1] = area.y;
tmp[2] = area.width;
tmp[3] = area.height;
tmp += sizeof (unsigned long) * 4;
tmp_list = tmp_list->next;
}
meta_error_trap_push (screen->display);
XChangeProperty (screen->display->xdisplay, screen->xroot,
screen->display->atom_net_wm_workarea,
XA_CARDINAL, 32, PropModeReplace,
(guchar*) data, num_workspaces * 4);
g_free (data);
return meta_error_trap_pop (screen->display);
}
static int
set_active_space_hint (MetaScreen *screen)
{