simple-egl: Set the opaque region if windowed and -o is passed

Since commit 6a615d2621 [1], the opaque
region would be set only when running fullscreen. Having it set
properly for the windowed case is helpful to test the overlay path in
compositor-drm.

What this patch does is:

 - reverts the above commit;
 - remove the "if fullscreen make the window opaque" conditional, that
   should have been removed when -o was introduced and was actually the
   cause for the bug solved in [1];
 - sets the opaque region when running fullscreen, regardless of the -o
   switch.

[1] commit 6a615d2621
    Author: Scott Moreau <oreaus@gmail.com>
    Date:   Thu Aug 30 14:44:16 2012 -0600

        simple-egl: Only set alpha_size=0 when -o is passed.

v2: - Clarify in the commit message that this does not regress the bug
      solved in [1].
    - Use the correct sha1 for the reverted commit.
Ander Conselvan de Oliveira 12 years ago committed by Kristian Høgsberg
parent 231ba171c6
commit d7f282b84e
  1. 13
      clients/simple-egl.c

@ -280,12 +280,10 @@ 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,
@ -403,7 +401,7 @@ redraw(void *data, struct wl_callback *callback, uint32_t time)
eglSwapBuffers(window->display->egl.dpy, window->egl_surface); eglSwapBuffers(window->display->egl.dpy, window->egl_surface);
if (window->opaque) { if (window->opaque || window->fullscreen) {
region = wl_compositor_create_region(window->display->compositor); region = wl_compositor_create_region(window->display->compositor);
wl_region_add(region, 0, 0, wl_region_add(region, 0, 0,
window->window_size.width, window->window_size.width,
@ -594,7 +592,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, opaque = 0; int i;
window.display = &display; window.display = &display;
display.window = &window; display.window = &window;
@ -605,7 +603,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)
opaque = 1; window.opaque = 1;
else if (strcmp("-h", argv[i]) == 0) else if (strcmp("-h", argv[i]) == 0)
usage(EXIT_SUCCESS); usage(EXIT_SUCCESS);
else else
@ -621,10 +619,7 @@ main(int argc, char **argv)
wl_display_get_fd(display.display, event_mask_update, &display); wl_display_get_fd(display.display, event_mask_update, &display);
wl_display_iterate(display.display, WL_DISPLAY_READABLE); wl_display_iterate(display.display, WL_DISPLAY_READABLE);
if (window.fullscreen) init_egl(&display, window.opaque);
window.opaque = 1;
init_egl(&display, opaque);
create_surface(&window); create_surface(&window);
init_gl(&window); init_gl(&window);

Loading…
Cancel
Save