mirror of
https://github.com/i3/i3.git
synced 2026-02-04 06:25:41 +00:00
When running 'floating toggle' (or enable/disable) on an empty workspace, the focused container is the workspace itself, which has window=NULL. The command would call run_assignments(workspace->window), which would pass NULL to match_matches_window(), causing a crash when trying to access window->id. Add a NULL check at the beginning of `run_assignments` to immediately skip assignments for that case. Fixes: #6561
29 lines
702 B
Perl
29 lines
702 B
Perl
#!perl
|
|
# vim:ts=4:sw=4:expandtab
|
|
#
|
|
# Please read the following documents before working on tests:
|
|
# • https://build.i3wm.org/docs/testsuite.html
|
|
# (or docs/testsuite)
|
|
#
|
|
# • https://build.i3wm.org/docs/lib-i3test.html
|
|
# (alternatively: perldoc ./testcases/lib/i3test.pm)
|
|
#
|
|
# • https://build.i3wm.org/docs/ipc.html
|
|
# (or docs/ipc)
|
|
#
|
|
# • https://i3wm.org/downloads/modern_perl_a4.pdf
|
|
# (unless you are already familiar with Perl)
|
|
#
|
|
# Verify that i3 does not crash when a floating command is run and for_window
|
|
# rule exists.
|
|
# Ticket: #6561
|
|
# Bug still in: 4.25-6-g0e2e8290
|
|
use i3test i3_config => <<EOT;
|
|
for_window [class=xxx] nop
|
|
EOT
|
|
|
|
cmd 'floating toggle';
|
|
does_i3_live;
|
|
|
|
done_testing;
|