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 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);

@ -38,7 +38,6 @@ struct transformed {
struct widget *widget;
int width, height;
int fullscreen;
enum wl_shell_surface_fullscreen_method fullscreen_method;
};
static void
@ -99,16 +98,6 @@ fullscreen_handler(struct window *window, void *data)
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
redraw_handler(struct widget *widget, void *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);

@ -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;

@ -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);

Loading…
Cancel
Save