mirror of
https://github.com/i3/i3.git
synced 2025-10-29 11:25:59 +00:00
Compare commits
5 Commits
e8e063cf00
...
1cc2548027
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1cc2548027 | ||
|
|
45bfae0fc8 | ||
|
|
0d47ec22a9 | ||
|
|
389cf064e6 | ||
|
|
b3329fbb02 |
1
release-notes/bugfixes/10-tiling-drag-focused-parent
Normal file
1
release-notes/bugfixes/10-tiling-drag-focused-parent
Normal file
@ -0,0 +1 @@
|
||||
fix crash when a container parent is focused and a tiling drag causes it to be killed
|
||||
1
release-notes/bugfixes/6-for_window-reload
Normal file
1
release-notes/bugfixes/6-for_window-reload
Normal file
@ -0,0 +1 @@
|
||||
fix crash when using for_window [...] reload
|
||||
@ -18,6 +18,7 @@ void run_assignments(i3Window *window) {
|
||||
DLOG("Checking if any assignments match this window\n");
|
||||
|
||||
bool needs_tree_render = false;
|
||||
const Assignment *old_first_assignment = TAILQ_FIRST(&assignments);
|
||||
|
||||
/* Check if any assignments match */
|
||||
Assignment *current;
|
||||
@ -59,6 +60,14 @@ void run_assignments(i3Window *window) {
|
||||
}
|
||||
|
||||
command_result_free(result);
|
||||
|
||||
/* Prevent crash: if the assigned command included a reload, the
|
||||
* assignments array was re-initialized, which will lead to a SEGFAULT
|
||||
* if we continue.
|
||||
*/
|
||||
if (old_first_assignment != TAILQ_FIRST(&assignments)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* If any of the commands required re-rendering, we will do that now. */
|
||||
|
||||
@ -660,9 +660,8 @@ static bool randr_query_outputs_15(void) {
|
||||
struct output_name *output_name = scalloc(1, sizeof(struct output_name));
|
||||
output_name->name = sstrdup(oname);
|
||||
SLIST_INSERT_HEAD(&new->names_head, output_name, names);
|
||||
} else {
|
||||
free(oname);
|
||||
}
|
||||
free(oname);
|
||||
}
|
||||
FREE(info);
|
||||
}
|
||||
@ -757,12 +756,10 @@ static void handle_output(xcb_connection_t *conn, xcb_randr_output_t id,
|
||||
return;
|
||||
}
|
||||
|
||||
xcb_randr_get_crtc_info_cookie_t icookie;
|
||||
icookie = xcb_randr_get_crtc_info(conn, output->crtc, cts);
|
||||
const xcb_randr_get_crtc_info_cookie_t icookie = xcb_randr_get_crtc_info(conn, output->crtc, cts);
|
||||
if ((crtc = xcb_randr_get_crtc_info_reply(conn, icookie, NULL)) == NULL) {
|
||||
DLOG("Skipping output %s: could not get CRTC (%p)\n",
|
||||
output_primary_name(new), crtc);
|
||||
free(new);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -389,7 +389,7 @@ void tiling_drag(Con *con, xcb_button_press_event_t *event, bool use_threshold)
|
||||
/* tree_move can change the focus */
|
||||
Con *old_focus = focused;
|
||||
tree_move(con, direction);
|
||||
if (focused != old_focus) {
|
||||
if (focused != old_focus && con_exists(old_focus)) {
|
||||
con_activate(old_focus);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -56,6 +56,7 @@ is_deeply($nodes[0]->{nodes}[0]->{marks}, [ 'floating', 'floating_auto' ], "mark
|
||||
|
||||
cmd '[id=' . $A->{id} . '] floating enable';
|
||||
cmd '[id=' . $B->{id} . '] floating disable';
|
||||
sync_with_i3; # Assignments run based on the _I3_FLOATING_WINDOW property. No sync is race-y.
|
||||
|
||||
@nodes = @{get_ws($tmp)->{nodes}};
|
||||
cmp_ok(@nodes, '==', 1, 'one tiling container on this workspace');
|
||||
@ -75,6 +76,7 @@ is_deeply($nodes[0]->{nodes}[0]->{marks}, [ 'tiling_auto', 'floating', 'floating
|
||||
# Use 'mark' to clear old marks
|
||||
cmd '[id=' . $A->{id} . '] mark A, floating disable';
|
||||
cmd '[id=' . $B->{id} . '] mark B, floating enable';
|
||||
sync_with_i3;
|
||||
|
||||
@nodes = @{get_ws($tmp)->{nodes}};
|
||||
cmp_ok(@nodes, '==', 1, 'one tiling container on this workspace');
|
||||
@ -115,6 +117,7 @@ is_deeply($nodes[0]->{nodes}[0]->{marks}, [ 'floating' ], "mark set for 'floatin
|
||||
|
||||
cmd '[tiling_from="auto" con_mark="tiling"] mark --add tiling_auto';
|
||||
cmd '[floating_from="auto" con_mark="floating"] mark --add floating_auto';
|
||||
sync_with_i3;
|
||||
|
||||
@nodes = @{get_ws($tmp)->{nodes}};
|
||||
cmp_ok(@nodes, '==', 1, 'one tiling container on this workspace');
|
||||
|
||||
33
testcases/t/324-for-window-reload-crash.t
Normal file
33
testcases/t/324-for-window-reload-crash.t
Normal file
@ -0,0 +1,33 @@
|
||||
#!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)
|
||||
#
|
||||
# This test ensures that i3 does not crash when a for_window rule triggers a
|
||||
# 'reload' command.
|
||||
# Bug still in: 4.24-12-gab6a75a6
|
||||
|
||||
use i3test i3_config => <<'EOT';
|
||||
font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
|
||||
|
||||
for_window [class="special"] reload
|
||||
EOT
|
||||
|
||||
my $window = open_window(
|
||||
wm_class => 'special',
|
||||
);
|
||||
|
||||
does_i3_live;
|
||||
|
||||
done_testing;
|
||||
Loading…
x
Reference in New Issue
Block a user