From 76ec0826bc390010b347da28985e68f5252f2f95 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Mon, 11 Nov 2013 19:04:29 -0500 Subject: [PATCH] westoy: Remove fullscreen methods These aren't supported under xdg_shell, at least not right now. If xdg_shell ever gets support for them, we can revert this commit and adapt it. --- clients/fullscreen.c | 19 +++---------------- clients/transformed.c | 21 +-------------------- clients/window.c | 11 +---------- clients/window.h | 3 --- 4 files changed, 5 insertions(+), 49 deletions(-) diff --git a/clients/fullscreen.c b/clients/fullscreen.c index 034a352..46a7926 100644 --- a/clients/fullscreen.c +++ b/clients/fullscreen.c @@ -40,7 +40,6 @@ struct fullscreen { int width, height; int fullscreen; float pointer_x, pointer_y; - enum wl_shell_surface_fullscreen_method fullscreen_method; }; static void @@ -114,7 +113,6 @@ redraw_handler(struct widget *widget, void *data) cairo_t *cr; int i; double x, y, border; - const char *method_name[] = { "default", "scale", "driver", "fill" }; surface = window_get_surface(fullscreen->window); if (surface == NULL || @@ -144,13 +142,13 @@ redraw_handler(struct widget *widget, void *data) "Surface size: %d, %d\n" "Scale: %d, transform: %d\n" "Pointer: %f,%f\n" - "Fullscreen: %d, method: %s\n" - "Keys: (s)cale, (t)ransform, si(z)e, (m)ethod, (f)ullscreen, (q)uit\n", + "Fullscreen: %d\n" + "Keys: (s)cale, (t)ransform, si(z)e, (f)ullscreen, (q)uit\n", fullscreen->width, fullscreen->height, window_get_buffer_scale (fullscreen->window), window_get_buffer_transform (fullscreen->window), fullscreen->pointer_x, fullscreen->pointer_y, - fullscreen->fullscreen, method_name[fullscreen->fullscreen_method]); + fullscreen->fullscreen); y = 100; i = 0; @@ -222,13 +220,6 @@ key_handler(struct window *window, struct input *input, uint32_t time, fullscreen->width, fullscreen->height); break; - case XKB_KEY_m: - fullscreen->fullscreen_method = (fullscreen->fullscreen_method + 1) % 4; - window_set_fullscreen_method(fullscreen->window, - fullscreen->fullscreen_method); - window_schedule_redraw(window); - break; - case XKB_KEY_f: fullscreen->fullscreen ^= 1; window_set_fullscreen(window, fullscreen->fullscreen); @@ -306,8 +297,6 @@ int main(int argc, char *argv[]) fullscreen.width = 640; fullscreen.height = 480; fullscreen.fullscreen = 0; - fullscreen.fullscreen_method = - WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT; for (i = 1; i < argc; i++) { if (strcmp(argv[i], "-w") == 0) { @@ -338,8 +327,6 @@ int main(int argc, char *argv[]) window_add_widget(fullscreen.window, &fullscreen); window_set_title(fullscreen.window, "Fullscreen"); - window_set_fullscreen_method(fullscreen.window, - fullscreen.fullscreen_method); widget_set_transparent(fullscreen.widget, 0); widget_set_default_cursor(fullscreen.widget, CURSOR_LEFT_PTR); diff --git a/clients/transformed.c b/clients/transformed.c index bbc1dc0..dd246a0 100644 --- a/clients/transformed.c +++ b/clients/transformed.c @@ -38,7 +38,6 @@ struct transformed { struct widget *widget; int width, height; int fullscreen; - enum wl_shell_surface_fullscreen_method fullscreen_method; }; static void @@ -100,16 +99,6 @@ fullscreen_handler(struct window *window, void *data) } static void -resize_handler(struct widget *widget, int width, int height, void *data) -{ - struct transformed *transformed = data; - - if (transformed->fullscreen_method != - WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT) - widget_set_size(widget, transformed->width, transformed->height); -} - -static void redraw_handler(struct widget *widget, void *data) { struct transformed *transformed = data; @@ -251,14 +240,9 @@ int main(int argc, char *argv[]) transformed.width = 500; transformed.height = 250; transformed.fullscreen = 0; - transformed.fullscreen_method = - WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT; for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-d") == 0) { - transformed.fullscreen_method = - WL_SHELL_SURFACE_FULLSCREEN_METHOD_DRIVER; - } else if (strcmp(argv[i], "-w") == 0) { + if (strcmp(argv[i], "-w") == 0) { if (++i >= argc) usage(EXIT_FAILURE); @@ -286,13 +270,10 @@ int main(int argc, char *argv[]) window_add_widget(transformed.window, &transformed); window_set_title(transformed.window, "Transformed"); - window_set_fullscreen_method(transformed.window, - transformed.fullscreen_method); widget_set_transparent(transformed.widget, 0); widget_set_default_cursor(transformed.widget, CURSOR_BLANK); - widget_set_resize_handler(transformed.widget, resize_handler); widget_set_redraw_handler(transformed.widget, redraw_handler); widget_set_button_handler(transformed.widget, button_handler); diff --git a/clients/window.c b/clients/window.c index 289f3c5..777e5b3 100644 --- a/clients/window.c +++ b/clients/window.c @@ -236,7 +236,6 @@ struct window { int focus_count; int resizing; - int fullscreen_method; int configure_requests; enum preferred_format preferred_format; @@ -4122,7 +4121,7 @@ window_set_fullscreen(struct window *window, int fullscreen) } window->type = TYPE_FULLSCREEN; wl_shell_surface_set_fullscreen(window->shell_surface, - window->fullscreen_method, + WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT, 0, NULL); window_defer_redraw_until_configure (window); } else { @@ -4139,13 +4138,6 @@ window_set_fullscreen(struct window *window, int fullscreen) } } -void -window_set_fullscreen_method(struct window *window, - enum wl_shell_surface_fullscreen_method method) -{ - window->fullscreen_method = method; -} - int window_is_maximized(struct window *window) { @@ -4381,7 +4373,6 @@ window_create_internal(struct display *display, int type) } window->type = type; - window->fullscreen_method = WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT; window->configure_requests = 0; window->preferred_format = WINDOW_PREFERRED_FORMAT_NONE; diff --git a/clients/window.h b/clients/window.h index 0a3ca6e..357ecdc 100644 --- a/clients/window.h +++ b/clients/window.h @@ -365,9 +365,6 @@ window_is_fullscreen(struct window *window); void window_set_fullscreen(struct window *window, int fullscreen); -void -window_set_fullscreen_method(struct window *window, - enum wl_shell_surface_fullscreen_method method); int window_is_maximized(struct window *window); -- 2.7.4