summaryrefslogtreecommitdiff
path: root/src/shell.c
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2013-02-12 20:07:05 -0500
committerKristian Høgsberg <krh@bitplanet.net>2013-02-12 21:55:51 -0500
commitb810eb57503e1cf38aeca45b97ab78e896cbc129 (patch)
treea9300ad8866c00de3c9315461b21b90da6b5ced5 /src/shell.c
parent088c62e267022bc640185f2f079b73fc420bbfcb (diff)
xwm: Support _NET_WM_STATE_FULLSCREEN
We can now handle fullscreen X windows. X clients request to go fullscreen buy sending a _NET_WM_STATE client message to the root window. When that happens we call into the shell interface and asks the shell to make the surface fullscreen. The shell will then resize the window, which causes the X wm to configure the X window appropriately. Make sure we ignore configure requests from fullscreened clients and send out the synthetic configure notify as required in that case. Finally, inspect _NET_WM_STATE before mapping so we can handle initial fullscreen correctly.
Diffstat (limited to 'src/shell.c')
-rw-r--r--src/shell.c33
1 files changed, 25 insertions, 8 deletions
diff --git a/src/shell.c b/src/shell.c
index 368fa5b7..72d2a73f 100644
--- a/src/shell.c
+++ b/src/shell.c
@@ -1754,17 +1754,15 @@ shell_map_fullscreen(struct shell_surface *shsurf)
1754} 1754}
1755 1755
1756static void 1756static void
1757shell_surface_set_fullscreen(struct wl_client *client, 1757set_fullscreen(struct shell_surface *shsurf,
1758 struct wl_resource *resource, 1758 uint32_t method,
1759 uint32_t method, 1759 uint32_t framerate,
1760 uint32_t framerate, 1760 struct weston_output *output)
1761 struct wl_resource *output_resource)
1762{ 1761{
1763 struct shell_surface *shsurf = resource->data;
1764 struct weston_surface *es = shsurf->surface; 1762 struct weston_surface *es = shsurf->surface;
1765 1763
1766 if (output_resource) 1764 if (output)
1767 shsurf->output = output_resource->data; 1765 shsurf->output = output;
1768 else if (es->output) 1766 else if (es->output)
1769 shsurf->output = es->output; 1767 shsurf->output = es->output;
1770 else 1768 else
@@ -1781,6 +1779,24 @@ shell_surface_set_fullscreen(struct wl_client *client,
1781} 1779}
1782 1780
1783static void 1781static void
1782shell_surface_set_fullscreen(struct wl_client *client,
1783 struct wl_resource *resource,
1784 uint32_t method,
1785 uint32_t framerate,
1786 struct wl_resource *output_resource)
1787{
1788 struct shell_surface *shsurf = resource->data;
1789 struct weston_output *output;
1790
1791 if (output_resource)
1792 output = output_resource->data;
1793 else
1794 output = NULL;
1795
1796 set_fullscreen(shsurf, method, framerate, output);
1797}
1798
1799static void
1784popup_grab_focus(struct wl_pointer_grab *grab, 1800popup_grab_focus(struct wl_pointer_grab *grab,
1785 struct wl_surface *surface, 1801 struct wl_surface *surface,
1786 wl_fixed_t x, 1802 wl_fixed_t x,
@@ -3832,6 +3848,7 @@ module_init(struct weston_compositor *ec)
3832 ec->shell_interface.create_shell_surface = create_shell_surface; 3848 ec->shell_interface.create_shell_surface = create_shell_surface;
3833 ec->shell_interface.set_toplevel = set_toplevel; 3849 ec->shell_interface.set_toplevel = set_toplevel;
3834 ec->shell_interface.set_transient = set_transient; 3850 ec->shell_interface.set_transient = set_transient;
3851 ec->shell_interface.set_fullscreen = set_fullscreen;
3835 ec->shell_interface.move = surface_move; 3852 ec->shell_interface.move = surface_move;
3836 ec->shell_interface.resize = surface_resize; 3853 ec->shell_interface.resize = surface_resize;
3837 3854