don't use fullscreen event in fullscreennotify()

main
Leonardo Hernández Hernández 2022-03-13 20:54:44 -06:00
parent 03e167dbb7
commit 43228bd493
No known key found for this signature in database
GPG Key ID: E538897EE11B9624
2 changed files with 14 additions and 3 deletions

View File

@ -95,6 +95,16 @@ client_is_float_type(Client *c)
return 0; return 0;
} }
static inline int
client_wants_fullscreen(Client *c)
{
#ifdef XWAYLAND
if (client_is_x11(c))
return c->surface.xwayland->fullscreen;
#endif
return c->surface.xdg->toplevel->requested.fullscreen;
}
static inline int static inline int
client_is_unmanaged(Client *c) client_is_unmanaged(Client *c)
{ {

7
dwl.c
View File

@ -1042,13 +1042,14 @@ void
fullscreennotify(struct wl_listener *listener, void *data) fullscreennotify(struct wl_listener *listener, void *data)
{ {
Client *c = wl_container_of(listener, c, fullscreen); Client *c = wl_container_of(listener, c, fullscreen);
struct wlr_xdg_toplevel_set_fullscreen_event *event = data; int fullscreen = client_wants_fullscreen(c);
if (!c->mon) { if (!c->mon) {
/* if the client is not mapped yet, let mapnotify() call setfullscreen() */ /* if the client is not mapped yet, let mapnotify() call setfullscreen() */
c->isfullscreen = event->fullscreen; c->isfullscreen = fullscreen;
return; return;
} }
setfullscreen(c, event->fullscreen); setfullscreen(c, fullscreen);
} }
Monitor * Monitor *