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.
dev
Jasper St. Pierre 11 years ago committed by Kristian Høgsberg
parent 7f4386e90a
commit 76ec0826bc
  1. 19
      clients/fullscreen.c
  2. 21
      clients/transformed.c
  3. 11
      clients/window.c
  4. 3
      clients/window.h

@ -40,7 +40,6 @@ struct fullscreen {
int width, height; int width, height;
int fullscreen; int fullscreen;
float pointer_x, pointer_y; float pointer_x, pointer_y;
enum wl_shell_surface_fullscreen_method fullscreen_method;
}; };
static void static void
@ -114,7 +113,6 @@ redraw_handler(struct widget *widget, void *data)
cairo_t *cr; cairo_t *cr;
int i; int i;
double x, y, border; double x, y, border;
const char *method_name[] = { "default", "scale", "driver", "fill" };
surface = window_get_surface(fullscreen->window); surface = window_get_surface(fullscreen->window);
if (surface == NULL || if (surface == NULL ||
@ -144,13 +142,13 @@ redraw_handler(struct widget *widget, void *data)
"Surface size: %d, %d\n" "Surface size: %d, %d\n"
"Scale: %d, transform: %d\n" "Scale: %d, transform: %d\n"
"Pointer: %f,%f\n" "Pointer: %f,%f\n"
"Fullscreen: %d, method: %s\n" "Fullscreen: %d\n"
"Keys: (s)cale, (t)ransform, si(z)e, (m)ethod, (f)ullscreen, (q)uit\n", "Keys: (s)cale, (t)ransform, si(z)e, (f)ullscreen, (q)uit\n",
fullscreen->width, fullscreen->height, fullscreen->width, fullscreen->height,
window_get_buffer_scale (fullscreen->window), window_get_buffer_scale (fullscreen->window),
window_get_buffer_transform (fullscreen->window), window_get_buffer_transform (fullscreen->window),
fullscreen->pointer_x, fullscreen->pointer_y, fullscreen->pointer_x, fullscreen->pointer_y,
fullscreen->fullscreen, method_name[fullscreen->fullscreen_method]); fullscreen->fullscreen);
y = 100; y = 100;
i = 0; i = 0;
@ -222,13 +220,6 @@ key_handler(struct window *window, struct input *input, uint32_t time,
fullscreen->width, fullscreen->height); fullscreen->width, fullscreen->height);
break; 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: case XKB_KEY_f:
fullscreen->fullscreen ^= 1; fullscreen->fullscreen ^= 1;
window_set_fullscreen(window, fullscreen->fullscreen); window_set_fullscreen(window, fullscreen->fullscreen);
@ -306,8 +297,6 @@ int main(int argc, char *argv[])
fullscreen.width = 640; fullscreen.width = 640;
fullscreen.height = 480; fullscreen.height = 480;
fullscreen.fullscreen = 0; fullscreen.fullscreen = 0;
fullscreen.fullscreen_method =
WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT;
for (i = 1; i < argc; i++) { for (i = 1; i < argc; i++) {
if (strcmp(argv[i], "-w") == 0) { if (strcmp(argv[i], "-w") == 0) {
@ -338,8 +327,6 @@ int main(int argc, char *argv[])
window_add_widget(fullscreen.window, &fullscreen); window_add_widget(fullscreen.window, &fullscreen);
window_set_title(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_transparent(fullscreen.widget, 0);
widget_set_default_cursor(fullscreen.widget, CURSOR_LEFT_PTR); widget_set_default_cursor(fullscreen.widget, CURSOR_LEFT_PTR);

@ -38,7 +38,6 @@ struct transformed {
struct widget *widget; struct widget *widget;
int width, height; int width, height;
int fullscreen; int fullscreen;
enum wl_shell_surface_fullscreen_method fullscreen_method;
}; };
static void static void
@ -99,16 +98,6 @@ fullscreen_handler(struct window *window, void *data)
window_set_fullscreen(window, transformed->fullscreen); window_set_fullscreen(window, transformed->fullscreen);
} }
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 static void
redraw_handler(struct widget *widget, void *data) redraw_handler(struct widget *widget, void *data)
{ {
@ -251,14 +240,9 @@ int main(int argc, char *argv[])
transformed.width = 500; transformed.width = 500;
transformed.height = 250; transformed.height = 250;
transformed.fullscreen = 0; transformed.fullscreen = 0;
transformed.fullscreen_method =
WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT;
for (i = 1; i < argc; i++) { for (i = 1; i < argc; i++) {
if (strcmp(argv[i], "-d") == 0) { if (strcmp(argv[i], "-w") == 0) {
transformed.fullscreen_method =
WL_SHELL_SURFACE_FULLSCREEN_METHOD_DRIVER;
} else if (strcmp(argv[i], "-w") == 0) {
if (++i >= argc) if (++i >= argc)
usage(EXIT_FAILURE); usage(EXIT_FAILURE);
@ -286,13 +270,10 @@ int main(int argc, char *argv[])
window_add_widget(transformed.window, &transformed); window_add_widget(transformed.window, &transformed);
window_set_title(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_transparent(transformed.widget, 0);
widget_set_default_cursor(transformed.widget, CURSOR_BLANK); 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_redraw_handler(transformed.widget, redraw_handler);
widget_set_button_handler(transformed.widget, button_handler); widget_set_button_handler(transformed.widget, button_handler);

@ -236,7 +236,6 @@ struct window {
int focus_count; int focus_count;
int resizing; int resizing;
int fullscreen_method;
int configure_requests; int configure_requests;
enum preferred_format preferred_format; enum preferred_format preferred_format;
@ -4122,7 +4121,7 @@ window_set_fullscreen(struct window *window, int fullscreen)
} }
window->type = TYPE_FULLSCREEN; window->type = TYPE_FULLSCREEN;
wl_shell_surface_set_fullscreen(window->shell_surface, wl_shell_surface_set_fullscreen(window->shell_surface,
window->fullscreen_method, WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT,
0, NULL); 0, NULL);
window_defer_redraw_until_configure (window); window_defer_redraw_until_configure (window);
} else { } 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 int
window_is_maximized(struct window *window) window_is_maximized(struct window *window)
{ {
@ -4381,7 +4373,6 @@ window_create_internal(struct display *display, int type)
} }
window->type = type; window->type = type;
window->fullscreen_method = WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT;
window->configure_requests = 0; window->configure_requests = 0;
window->preferred_format = WINDOW_PREFERRED_FORMAT_NONE; window->preferred_format = WINDOW_PREFERRED_FORMAT_NONE;

@ -365,9 +365,6 @@ window_is_fullscreen(struct window *window);
void void
window_set_fullscreen(struct window *window, int fullscreen); window_set_fullscreen(struct window *window, int fullscreen);
void
window_set_fullscreen_method(struct window *window,
enum wl_shell_surface_fullscreen_method method);
int int
window_is_maximized(struct window *window); window_is_maximized(struct window *window);

Loading…
Cancel
Save