Skip to content
This repository has been archived by the owner on Apr 18, 2023. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'vanilla/next' into gaps-next
Browse files Browse the repository at this point in the history
  • Loading branch information
Airblader committed Sep 28, 2018
2 parents 52240a0 + ebf4088 commit ccb1947
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 16 deletions.
12 changes: 8 additions & 4 deletions i3-config-wizard/main.c
Expand Up @@ -853,6 +853,7 @@ int main(int argc, char *argv[]) {
/* Init startup notification. */
SnDisplay *sndisplay = sn_xcb_display_new(conn, NULL, NULL);
SnLauncheeContext *sncontext = sn_launchee_context_new_from_environment(sndisplay, screen);
sn_display_unref(sndisplay);

root_screen = xcb_aux_get_screen(conn, screen);
root = root_screen->root;
Expand Down Expand Up @@ -886,7 +887,9 @@ int main(int argc, char *argv[]) {
0, /* back pixel: black */
XCB_EVENT_MASK_EXPOSURE |
XCB_EVENT_MASK_BUTTON_PRESS});
sn_launchee_context_setup_window(sncontext, win);
if (sncontext) {
sn_launchee_context_setup_window(sncontext, win);
}

/* Map the window (make it visible) */
xcb_map_window(conn, win);
Expand Down Expand Up @@ -949,9 +952,10 @@ int main(int argc, char *argv[]) {
}

/* Startup complete. */
sn_launchee_context_complete(sncontext);
sn_launchee_context_unref(sncontext);
sn_display_unref(sndisplay);
if (sncontext) {
sn_launchee_context_complete(sncontext);
sn_launchee_context_unref(sncontext);
}

xcb_flush(conn);

Expand Down
12 changes: 8 additions & 4 deletions i3-nagbar/main.c
Expand Up @@ -421,6 +421,7 @@ int main(int argc, char *argv[]) {
/* Init startup notification. */
SnDisplay *sndisplay = sn_xcb_display_new(conn, NULL, NULL);
SnLauncheeContext *sncontext = sn_launchee_context_new_from_environment(sndisplay, screens);
sn_display_unref(sndisplay);

root_screen = xcb_aux_get_screen(conn, screens);
root = root_screen->root;
Expand Down Expand Up @@ -491,7 +492,9 @@ int main(int argc, char *argv[]) {
XCB_EVENT_MASK_BUTTON_PRESS |
XCB_EVENT_MASK_BUTTON_RELEASE,
cursor});
sn_launchee_context_setup_window(sncontext, win);
if (sncontext) {
sn_launchee_context_setup_window(sncontext, win);
}

/* Map the window (make it visible) */
xcb_map_window(conn, win);
Expand Down Expand Up @@ -553,9 +556,10 @@ int main(int argc, char *argv[]) {
draw_util_surface_init(conn, &bar, win, get_visualtype(root_screen), win_pos.width, win_pos.height);

/* Startup complete. */
sn_launchee_context_complete(sncontext);
sn_launchee_context_unref(sncontext);
sn_display_unref(sndisplay);
if (sncontext) {
sn_launchee_context_complete(sncontext);
sn_launchee_context_unref(sncontext);
}

/* Grab the keyboard to get all input */
xcb_flush(conn);
Expand Down
1 change: 1 addition & 0 deletions include/atoms_rest.xmacro
Expand Up @@ -17,3 +17,4 @@ xmacro(I3_FLOATING_WINDOW)
xmacro(_NET_REQUEST_FRAME_EXTENTS)
xmacro(_NET_FRAME_EXTENTS)
xmacro(_MOTIF_WM_HINTS)
xmacro(WM_CHANGE_STATE)
4 changes: 4 additions & 0 deletions src/con.c
Expand Up @@ -936,6 +936,10 @@ int con_num_windows(Con *con) {
num += con_num_windows(current);
}

TAILQ_FOREACH(current, &(con->floating_head), floating_windows) {
num += con_num_windows(current);
}

return num;
}

Expand Down
12 changes: 12 additions & 0 deletions src/handlers.c
Expand Up @@ -806,6 +806,18 @@ static void handle_client_message(xcb_client_message_event_t *event) {
XCB_ATOM_CARDINAL, 32, 4,
&r);
xcb_flush(conn);
} else if (event->type == A_WM_CHANGE_STATE) {
/* http://tronche.com/gui/x/icccm/sec-4.html#s-4.1.4 */
if (event->data.data32[0] == XCB_ICCCM_WM_STATE_ICONIC) {
/* For compatiblity reasons, Wine will request iconic state and cannot ensure that the WM has agreed on it;
* immediately revert to normal to avoid being stuck in a paused state. */
DLOG("Client has requested iconic state, rejecting. (window = %d)\n", event->window);
long data[] = {XCB_ICCCM_WM_STATE_NORMAL, XCB_NONE};
xcb_change_property(conn, XCB_PROP_MODE_REPLACE, event->window,
A_WM_STATE, A_WM_STATE, 32, 2, data);
} else {
DLOG("Not handling WM_CHANGE_STATE request. (window = %d, state = %d)\n", event->window, event->data.data32[0]);
}
} else if (event->type == A__NET_CURRENT_DESKTOP) {
/* This request is used by pagers and bars to change the current
* desktop likely as a result of some user action. We interpret this as
Expand Down
9 changes: 8 additions & 1 deletion testcases/t/242-no-focus.t
Expand Up @@ -68,7 +68,7 @@ is($x->input_focus, $first->id, 'input focus has not changed');
exit_gracefully($pid);

#####################################################################
## 3: no_focus doesn't affect the first window opened on a workspace
# 3: no_focus doesn't affect the first window opened on a workspace
#####################################################################

$config = <<EOT;
Expand All @@ -87,6 +87,13 @@ $first = open_window(wm_class => 'focusme');
sync_with_i3;
is($x->input_focus, $first->id, 'input focus has changed');

# Also check that it counts floating windows
# See issue #3423.
open_floating_window(wm_class => 'focusme');

sync_with_i3;
is($x->input_focus, $first->id, 'input focus didn\'t change to floating window');

exit_gracefully($pid);

#####################################################################
Expand Down
8 changes: 1 addition & 7 deletions testcases/t/530-bug-2229.t
Expand Up @@ -24,8 +24,6 @@ fake-outputs 400x400+0+0,400x400+400+0
workspace_auto_back_and_forth no
EOT

my $i3 = i3(get_socket_path());

# Set it up such that workspace 3 is on the left output and
# workspace 4 is on the right output
cmd 'focus output fake-0';
Expand All @@ -37,10 +35,6 @@ open_window;

cmd 'move workspace to output left';

# ensure that workspace 3 has now vanished
my $get_ws = $i3->get_workspaces->recv;
my @ws_names = map { $_->{name} } @$get_ws;
# TODO get rid of smartmatch
ok(!('3' ~~ @ws_names), 'workspace 3 has been closed');
ok(!workspace_exists('3'), 'workspace 3 has been closed');

done_testing;

0 comments on commit ccb1947

Please sign in to comment.