mirror of
https://github.com/wizbright/waybox.git
synced 2025-10-29 05:40:20 -04:00
Fixed crash on focusing non-toplevel surfaces
This commit is contained in:
parent
ead6648438
commit
d139b41259
1 changed files with 7 additions and 3 deletions
|
|
@ -30,7 +30,7 @@ struct wb_toplevel *get_toplevel_at(
|
||||||
|
|
||||||
void focus_toplevel(struct wb_toplevel *toplevel, struct wlr_surface *surface) {
|
void focus_toplevel(struct wb_toplevel *toplevel, struct wlr_surface *surface) {
|
||||||
/* Note: this function only deals with keyboard focus. */
|
/* Note: this function only deals with keyboard focus. */
|
||||||
if (toplevel == NULL) {
|
if (toplevel == NULL || toplevel->xdg_toplevel->base->role != WLR_XDG_SURFACE_ROLE_TOPLEVEL) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -166,12 +166,16 @@ static void xdg_toplevel_request_fullscreen(
|
||||||
/* This event is raised when a client would like to set itself to
|
/* This event is raised when a client would like to set itself to
|
||||||
* fullscreen. waybox currently doesn't support fullscreen, but to
|
* fullscreen. waybox currently doesn't support fullscreen, but to
|
||||||
* conform to xdg-shell protocol we still must send a configure.
|
* conform to xdg-shell protocol we still must send a configure.
|
||||||
* wlr_xdg_surface_schedule_configure() is used to send an empty reply.
|
* wlr_xdg_surface_schedule_configure() is used to send an empty reply. However, if the
|
||||||
|
* request was sent before an initial commit, we don't do anything and let the client finish
|
||||||
|
* the initial surface setup.
|
||||||
*/
|
*/
|
||||||
struct wb_toplevel *toplevel =
|
struct wb_toplevel *toplevel =
|
||||||
wl_container_of(listener, toplevel, request_fullscreen);
|
wl_container_of(listener, toplevel, request_fullscreen);
|
||||||
|
if (toplevel->xdg_toplevel->base->initialized) {
|
||||||
wlr_xdg_surface_schedule_configure(toplevel->xdg_toplevel->base);
|
wlr_xdg_surface_schedule_configure(toplevel->xdg_toplevel->base);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void xdg_toplevel_request_maximize(struct wl_listener *listener, void *data) {
|
static void xdg_toplevel_request_maximize(struct wl_listener *listener, void *data) {
|
||||||
/* This event is raised when a client would like to maximize itself,
|
/* This event is raised when a client would like to maximize itself,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue