X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Fcommands.c;h=2d8155f276a162494db56b6ce416566875b2861a;hb=a0e33c1d683ffe3b67a3967980f61f828b41fef2;hp=bef0989fa7e714895fb82373f8d298cbce62c896;hpb=f7c8e767822b209ab4ae995a128e217768d51a4d;p=i3%2Fi3 diff --git a/src/commands.c b/src/commands.c index bef0989f..2d8155f2 100644 --- a/src/commands.c +++ b/src/commands.c @@ -33,6 +33,7 @@ #include "log.h" #include "sighandler.h" #include "manage.h" +#include "ipc.h" bool focus_window_in_container(xcb_connection_t *conn, Container *container, direction_t direction) { /* If this container is empty, we’re done */ @@ -599,12 +600,30 @@ static void move_floating_window_to_workspace(xcb_connection_t *conn, Client *cl xcb_flush(conn); } + /* Configure the window above all tiling windows (or below a fullscreen + * window, if any) */ + if (t_ws->fullscreen_client != NULL) { + uint32_t values[] = { t_ws->fullscreen_client->frame, XCB_STACK_MODE_BELOW }; + xcb_configure_window(conn, client->frame, XCB_CONFIG_WINDOW_SIBLING | XCB_CONFIG_WINDOW_STACK_MODE, values); + } else { + Client *last_tiling; + SLIST_FOREACH(last_tiling, &(t_ws->focus_stack), focus_clients) + if (!client_is_floating(last_tiling)) + break; + if (last_tiling != SLIST_END(&(t_ws->focus_stack))) { + uint32_t values[] = { last_tiling->frame, XCB_STACK_MODE_ABOVE }; + xcb_configure_window(conn, client->frame, XCB_CONFIG_WINDOW_SIBLING | XCB_CONFIG_WINDOW_STACK_MODE, values); + } + } + DLOG("done\n"); render_layout(conn); - if (workspace_is_visible(t_ws)) + if (workspace_is_visible(t_ws)) { + client_warp_pointer_into(conn, client); set_focus(conn, client, true); + } } /* @@ -702,6 +721,7 @@ static void jump_to_window(xcb_connection_t *conn, const char *arguments) { } free(classtitle); + workspace_show(conn, client->workspace->num + 1); set_focus(conn, client, true); } @@ -1015,12 +1035,16 @@ void parse_command(xcb_connection_t *conn, const char *command) { if (STARTS_WITH(command, "exit")) { LOG("User issued exit-command, exiting without error.\n"); restore_geometry(global_conn); + ipc_shutdown(); exit(EXIT_SUCCESS); } /* Is it a ? */ if (STARTS_WITH(command, "reload")) { load_configuration(conn, NULL, true); + render_layout(conn); + /* Send an IPC event just in case the ws names have changed */ + ipc_send_event("workspace", I3_IPC_EVENT_WORKSPACE, "{\"change\":\"reload\"}"); return; } @@ -1147,6 +1171,9 @@ void parse_command(xcb_connection_t *conn, const char *command) { Workspace *ws = last_focused->workspace; + if (last_focused->fullscreen) + client_leave_fullscreen(conn, last_focused); + toggle_floating_mode(conn, last_focused, false); /* delete all empty columns/rows */ cleanup_table(conn, ws);