diff options
author | Scott Moreau <oreaus@gmail.com> | 2012-08-30 14:44:16 -0600 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2012-08-31 19:43:08 -0400 |
commit | 6a615d262141de7cf094788203d9c044dfb9f08d (patch) | |
tree | 65047e4afc9b8a4e16de148a3da1a423f495c245 /clients/simple-egl.c | |
parent | 1ee53e78db391a8a61423d3b738044efee614d93 (diff) | |
download | weston-6a615d262141de7cf094788203d9c044dfb9f08d.tar.gz |
simple-egl: Only set alpha_size=0 when -o is passed.
When starting simple-egl with -f for fullscreen and toggling to 'windowed' mode with F11,
the surface is opaque instead of semi-trnasparent as it is when starting without -f. We
only want to create the surface with alpha_size=0 when the user explicitly passes -o
because otherwise it will never have the ability to use alpha.
Diffstat (limited to 'clients/simple-egl.c')
-rw-r--r-- | clients/simple-egl.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/clients/simple-egl.c b/clients/simple-egl.c index 5b77b9dd..a3315712 100644 --- a/clients/simple-egl.c +++ b/clients/simple-egl.c @@ -278,10 +278,12 @@ toggle_fullscreen(struct window *window, int fullscreen) window->configured = 0; if (fullscreen) { + window->opaque = 1; wl_shell_surface_set_fullscreen(window->shell_surface, WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT, 0, NULL); } else { + window->opaque = 0; wl_shell_surface_set_toplevel(window->shell_surface); handle_configure(window, window->shell_surface, 0, window->window_size.width, @@ -587,7 +589,7 @@ main(int argc, char **argv) struct sigaction sigint; struct display display = { 0 }; struct window window = { 0 }; - int i; + int i, opaque = 0; window.display = &display; display.window = &window; @@ -598,7 +600,7 @@ main(int argc, char **argv) if (strcmp("-f", argv[i]) == 0) window.fullscreen = 1; else if (strcmp("-o", argv[i]) == 0) - window.opaque = 1; + opaque = 1; else if (strcmp("-h", argv[i]) == 0) usage(EXIT_SUCCESS); else @@ -617,7 +619,7 @@ main(int argc, char **argv) if (window.fullscreen) window.opaque = 1; - init_egl(&display, window.opaque); + init_egl(&display, opaque); create_surface(&window); init_gl(&window); |