Skip to content
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.

xdg-shell: drop wlr_xdg_toplevel_set_fullscreen_event #3229

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions include/wlr/types/wlr_xdg_shell.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ struct wlr_xdg_toplevel_configure {
};

struct wlr_xdg_toplevel_requested {
// Note that the client has no means to unset minimization
// of a surface, so `minimized` can only be set to `true` and
// is supposed to be read on surface map.
bool maximized, minimized, fullscreen;
struct wlr_output *fullscreen_output;
struct wl_listener fullscreen_output_destroy;
Expand All @@ -133,8 +136,7 @@ struct wlr_xdg_toplevel {
struct wlr_xdg_toplevel_configure scheduled;

// Properties that the client has requested. Intended to be checked
// by the compositor on surface map and handled accordingly
// (e.g. a client might want to start already in a fullscreen state).
// by the compositor and handled accordingly.
struct wlr_xdg_toplevel_requested requested;

char *title;
Expand Down Expand Up @@ -240,12 +242,6 @@ struct wlr_xdg_toplevel_resize_event {
uint32_t edges;
};

struct wlr_xdg_toplevel_set_fullscreen_event {
struct wlr_xdg_surface *surface;
bool fullscreen;
struct wlr_output *output;
};

struct wlr_xdg_toplevel_show_window_menu_event {
struct wlr_xdg_surface *surface;
struct wlr_seat_client *seat;
Expand Down
16 changes: 2 additions & 14 deletions types/xdg_shell/wlr_xdg_toplevel.c
Original file line number Diff line number Diff line change
Expand Up @@ -378,13 +378,7 @@ static void xdg_toplevel_handle_set_fullscreen(struct wl_client *client,

store_fullscreen_requested(surface, true, output);

struct wlr_xdg_toplevel_set_fullscreen_event event = {
.surface = surface,
.fullscreen = true,
.output = output,
};

wlr_signal_emit_safe(&surface->toplevel->events.request_fullscreen, &event);
wlr_signal_emit_safe(&surface->toplevel->events.request_fullscreen, surface);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer to avoid introducing more cases where we use surface as the signal data pointer, for the reasons described in #1008 (comment).

wlr_xdg_surface_schedule_configure(surface);
}

Expand All @@ -395,13 +389,7 @@ static void xdg_toplevel_handle_unset_fullscreen(struct wl_client *client,

store_fullscreen_requested(surface, false, NULL);

struct wlr_xdg_toplevel_set_fullscreen_event event = {
.surface = surface,
.fullscreen = false,
.output = NULL,
};

wlr_signal_emit_safe(&surface->toplevel->events.request_fullscreen, &event);
wlr_signal_emit_safe(&surface->toplevel->events.request_fullscreen, surface);
wlr_xdg_surface_schedule_configure(surface);
}

Expand Down