mirror of
https://github.com/brl/mutter.git
synced 2024-11-21 23:50:41 -05:00
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:
parent
e4e200a1dc
commit
53268f985f
10
ChangeLog
10
ChangeLog
@ -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
|
||||
|
@ -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,7 +312,8 @@ 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
|
||||
*/
|
||||
|
@ -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
|
||||
|
@ -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,
|
||||
|
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user