This change adds support for the new _NET_WM_FULLSCREEN_MONITORS

property and client message.  This allows client applications to request
 	that a fullscreen window cover more than one monitor.
 	* src/include/boxes.h:
	* src/core/boxes.c: Add meta_rectangle_union
 	* src/core/window-private.h:
	* src/core/window.c:
 	(meta_window_new_with_attrs, meta_window_free, set_net_wm_state,
 	meta_window_update_fullscreen_monitors, meta_window_client_message): Add
 	MetaWindow property to store fullscreen monitors field, update
 	_NET_WM_FULLSCREEN_MONITORS property on windows, and handle client
 	message.
 	* src/core/atomnames.h: Add _NET_WM_FULLSCREEN_MONITORS atom.
 	* src/core/constraints.c (setup_constraint_info): If
 	_NET_WM_FULLSCREEN_MONITORS is interesting, use the data stored in
 	MetaWindow::fullscreen_monitors to determine the fullscreen area instead
 	of the basic xinerama_info area.


svn path=/trunk/; revision=4021
This commit is contained in:
Thomas James Alexander Thurman
2008-11-17 02:57:20 +00:00
parent 6e8c233d6a
commit a06d96316e
7 changed files with 166 additions and 2 deletions

View File

@@ -249,7 +249,7 @@ meta_window_new_with_attrs (MetaDisplay *display,
gulong existing_wm_state;
gulong event_mask;
MetaMoveResizeFlags flags;
#define N_INITIAL_PROPS 18
#define N_INITIAL_PROPS 19
Atom initial_props[N_INITIAL_PROPS];
int i;
gboolean has_shape;
@@ -461,6 +461,7 @@ meta_window_new_with_attrs (MetaDisplay *display,
window->maximize_vertically_after_placement = FALSE;
window->minimize_after_placement = FALSE;
window->fullscreen = FALSE;
window->fullscreen_monitors[0] = -1;
window->require_fully_onscreen = TRUE;
window->require_on_single_xinerama = TRUE;
window->require_titlebar_visible = TRUE;
@@ -591,6 +592,7 @@ meta_window_new_with_attrs (MetaDisplay *display,
initial_props[i++] = display->atom__MOTIF_WM_HINTS;
initial_props[i++] = XA_WM_TRANSIENT_FOR;
initial_props[i++] = display->atom__NET_WM_USER_TIME_WINDOW;
initial_props[i++] = display->atom__NET_WM_FULLSCREEN_MONITORS;
g_assert (N_INITIAL_PROPS == i);
meta_window_reload_properties (window, initial_props, N_INITIAL_PROPS);
@@ -1115,6 +1117,9 @@ meta_window_free (MetaWindow *window,
XDeleteProperty (window->display->xdisplay,
window->xwindow,
window->display->atom__NET_WM_STATE);
XDeleteProperty (window->display->xdisplay,
window->xwindow,
window->display->atom__NET_WM_FULLSCREEN_MONITORS);
set_wm_state (window, WithdrawnState);
meta_error_trap_pop (window->display, FALSE);
}
@@ -1300,6 +1305,23 @@ set_net_wm_state (MetaWindow *window)
XA_ATOM,
32, PropModeReplace, (guchar*) data, i);
meta_error_trap_pop (window->display, FALSE);
if (window->fullscreen)
{
data[0] = window->fullscreen_monitors[0];
data[1] = window->fullscreen_monitors[1];
data[2] = window->fullscreen_monitors[2];
data[3] = window->fullscreen_monitors[3];
meta_verbose ("Setting _NET_WM_FULLSCREEN_MONITORS\n");
meta_error_trap_push (window->display);
XChangeProperty (window->display->xdisplay,
window->xwindow,
window->display->atom__NET_WM_FULLSCREEN_MONITORS,
XA_CARDINAL, 32, PropModeReplace,
(guchar*) data, 4);
meta_error_trap_pop (window->display, FALSE);
}
}
gboolean
@@ -2794,6 +2816,34 @@ meta_window_unmake_fullscreen (MetaWindow *window)
}
}
void
meta_window_update_fullscreen_monitors (MetaWindow *window,
unsigned long top,
unsigned long bottom,
unsigned long left,
unsigned long right)
{
if ((int)top < window->screen->n_xinerama_infos &&
(int)bottom < window->screen->n_xinerama_infos &&
(int)left < window->screen->n_xinerama_infos &&
(int)right < window->screen->n_xinerama_infos)
{
window->fullscreen_monitors[0] = top;
window->fullscreen_monitors[1] = bottom;
window->fullscreen_monitors[2] = left;
window->fullscreen_monitors[3] = right;
}
else
{
window->fullscreen_monitors[0] = -1;
}
if (window->fullscreen)
{
meta_window_queue(window, META_QUEUE_MOVE_RESIZE);
}
}
void
meta_window_shade (MetaWindow *window,
guint32 timestamp)
@@ -5144,6 +5194,23 @@ meta_window_client_message (MetaWindow *window,
window_activate (window, timestamp, source_indication, NULL);
return TRUE;
}
else if (event->xclient.message_type ==
display->atom__NET_WM_FULLSCREEN_MONITORS)
{
MetaClientType source_indication;
gulong top, bottom, left, right;
meta_verbose ("_NET_WM_FULLSCREEN_MONITORS request for window '%s'\n",
window->desc);
top = event->xclient.data.l[0];
bottom = event->xclient.data.l[1];
left = event->xclient.data.l[2];
right = event->xclient.data.l[3];
source_indication = event->xclient.data.l[4];
meta_window_update_fullscreen_monitors (window, top, bottom, left, right);
}
return FALSE;
}