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.
dev
Scott Moreau 13 years ago committed by Kristian Høgsberg
parent 1ee53e78db
commit 6a615d2621
  1. 8
      clients/simple-egl.c

@ -278,10 +278,12 @@ toggle_fullscreen(struct window *window, int fullscreen)
window->configured = 0; window->configured = 0;
if (fullscreen) { if (fullscreen) {
window->opaque = 1;
wl_shell_surface_set_fullscreen(window->shell_surface, wl_shell_surface_set_fullscreen(window->shell_surface,
WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT, WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT,
0, NULL); 0, NULL);
} else { } else {
window->opaque = 0;
wl_shell_surface_set_toplevel(window->shell_surface); wl_shell_surface_set_toplevel(window->shell_surface);
handle_configure(window, window->shell_surface, 0, handle_configure(window, window->shell_surface, 0,
window->window_size.width, window->window_size.width,
@ -587,7 +589,7 @@ main(int argc, char **argv)
struct sigaction sigint; struct sigaction sigint;
struct display display = { 0 }; struct display display = { 0 };
struct window window = { 0 }; struct window window = { 0 };
int i; int i, opaque = 0;
window.display = &display; window.display = &display;
display.window = &window; display.window = &window;
@ -598,7 +600,7 @@ main(int argc, char **argv)
if (strcmp("-f", argv[i]) == 0) if (strcmp("-f", argv[i]) == 0)
window.fullscreen = 1; window.fullscreen = 1;
else if (strcmp("-o", argv[i]) == 0) else if (strcmp("-o", argv[i]) == 0)
window.opaque = 1; opaque = 1;
else if (strcmp("-h", argv[i]) == 0) else if (strcmp("-h", argv[i]) == 0)
usage(EXIT_SUCCESS); usage(EXIT_SUCCESS);
else else
@ -617,7 +619,7 @@ main(int argc, char **argv)
if (window.fullscreen) if (window.fullscreen)
window.opaque = 1; window.opaque = 1;
init_egl(&display, window.opaque); init_egl(&display, opaque);
create_surface(&window); create_surface(&window);
init_gl(&window); init_gl(&window);

Loading…
Cancel
Save