When InputHint is not in WM_HINTS (i.e., the flag is not set), treat the window
as if the InputHint was set (the default behavior). This means that i3 will
focus the window when it becomes managed.
fixes #1676
- win->doesnt_accept_focus = !hints.input;
- LOG("WM_HINTS.input changed to \"%d\"\n", hints.input);
+ if (hints.flags & XCB_ICCCM_WM_HINT_INPUT) {
+ win->doesnt_accept_focus = !hints.input;
+ LOG("WM_HINTS.input changed to \"%d\"\n", hints.input);
+ }
if (urgency_hint != NULL)
*urgency_hint = (xcb_icccm_wm_hints_get_urgency(&hints) != 0);
if (urgency_hint != NULL)
*urgency_hint = (xcb_icccm_wm_hints_get_urgency(&hints) != 0);
}
subtest 'Window without WM_TAKE_FOCUS', sub {
}
subtest 'Window without WM_TAKE_FOCUS', sub {
+ my $ws = fresh_workspace;
my $window = open_window;
ok(!recv_take_focus($window), 'did not receive ClientMessage');
my $window = open_window;
ok(!recv_take_focus($window), 'did not receive ClientMessage');
+ my $con = shift get_ws_content($ws);
+ ok($con->{focused}, 'con is focused');
+
# list), the window cannot accept input focus, so we should not try to focus
# the window at all.
subtest 'Window with WM_TAKE_FOCUS and without InputHint', sub {
# list), the window cannot accept input focus, so we should not try to focus
# the window at all.
subtest 'Window with WM_TAKE_FOCUS and without InputHint', sub {
+ my $ws = fresh_workspace;
my $take_focus = $x->atom(name => 'WM_TAKE_FOCUS');
my $take_focus = $x->atom(name => 'WM_TAKE_FOCUS');
ok(!recv_take_focus($window), 'did not receive ClientMessage');
ok(!recv_take_focus($window), 'did not receive ClientMessage');
+ my $con = shift get_ws_content($ws);
+ ok($con->{focused}, 'con is focused');
+
# nearly identical presently, so this is currently used also as a proxy test
# for the latter case.
subtest 'Window with WM_TAKE_FOCUS and unspecified InputHint', sub {
# nearly identical presently, so this is currently used also as a proxy test
# for the latter case.
subtest 'Window with WM_TAKE_FOCUS and unspecified InputHint', sub {
+ my $ws = fresh_workspace;
my $take_focus = $x->atom(name => 'WM_TAKE_FOCUS');
my $take_focus = $x->atom(name => 'WM_TAKE_FOCUS');
ok(!recv_take_focus($window), 'did not receive ClientMessage');
ok(!recv_take_focus($window), 'did not receive ClientMessage');
+ my $con = shift get_ws_content($ws);
+ ok($con->{focused}, 'con is focused');
+