Skip to content

Commit

Permalink
Merge pull request #44 from migueldeoleiros/bugfix/workspace-switch-c…
Browse files Browse the repository at this point in the history
…rash-#42

Properly delete toplevel on unmap
  • Loading branch information
migueldeoleiros authored Oct 30, 2024
2 parents fb294e5 + cf503d6 commit c0d07ea
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/toplevel.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "toplevel.h"
#include "src/server.h"
#include "src/workspace.h"
#include "wlr/util/log.h"
#include <stdlib.h>
#include <wlr/types/wlr_cursor.h>
#include <wlr/types/wlr_scene.h>
Expand Down Expand Up @@ -136,7 +137,7 @@ void xdg_toplevel_unmap(struct wl_listener *listener, void *data) {
/* Called when the surface is unmapped, and should no longer be shown. */
struct turtile_toplevel *toplevel = wl_container_of(listener, toplevel, unmap);

/* Reset the cursor mode if the grabbed toplevel was unmapped. */
/* Reset the cursor mode and focus if the grabbed toplevel was unmapped. */
if (toplevel == toplevel->server->grabbed_toplevel) {
reset_cursor_mode(toplevel->server);

Expand All @@ -145,6 +146,7 @@ void xdg_toplevel_unmap(struct wl_listener *listener, void *data) {
}

wl_list_remove(&toplevel->link);
wl_list_remove(&toplevel->flink);
}

void xdg_toplevel_commit(struct wl_listener *listener, void *data) {
Expand Down

0 comments on commit c0d07ea

Please sign in to comment.