diff --git a/README.ro.md b/README.ro.md index ba9ab34b1..b046bc2e8 100644 --- a/README.ro.md +++ b/README.ro.md @@ -14,12 +14,12 @@ Noile versiuni sunt semnate cu [B22DA89A](http://pgp.mit.edu/pks/lookup?op=vinde ### Din pachete (packages) -sway este valabil în multe distribuții. încercați a instala "sway" pe distribuția voastră. Dacă nu este valabil, uitați-vă în [această pagină wiki](https://github.com/swaywm/sway/wiki/Unsupported-packages) +sway este disponibil în multe distribuții. Încercați să instalați pachetul "sway" pe distribuția voastră. Dacă nu este disponibil, uitați-vă în [această pagină wiki](https://github.com/swaywm/sway/wiki/Unsupported-packages) pentru informații a cum puteți să instalați pentru distribuția voastră. Dacă sunteți interesați in a crea pachete pentru distribuția voastră, informați-ne prin IRC sau contactați prin email pe sir@cmpwn.com pentru ajutor. -### Construire din sursă +### Compilare din sursă Dependențe pentru instalare: @@ -31,9 +31,9 @@ Dependențe pentru instalare: * json-c * pango * cairo -* gdk-pixbuf2 (optional: system tray) -* [scdoc](https://git.sr.ht/~sircmpwn/scdoc) (optional: pagini man) \* -* git (optional: info versiune) \* +* gdk-pixbuf2 (opțional, dacă doriți să aveți system tray) +* [scdoc](https://git.sr.ht/~sircmpwn/scdoc) (opțional, pentru paginile man) \* +* git (opțional, pentru informații de versiune) \* *Dependențe doar pentru compilare* @@ -45,12 +45,13 @@ Rulați aceste comenzi: sudo ninja -C build install ``` -Pe sisteme fără logind, trebuie făcut următorul: +Pe sisteme fără logind, trebuie să folosiți următoarea comandă pentru a marca binarul de Sway ca suid: ``` sudo chmod a+s /usr/local/bin/sway ``` -Sway o să scape de permisiuni root la puțin timp după lansare. + +Imediat după pornire, Sway va renunța la permisiunile de root. ## Configurare diff --git a/include/sway/tree/workspace.h b/include/sway/tree/workspace.h index 41b597963..1adbe68a2 100644 --- a/include/sway/tree/workspace.h +++ b/include/sway/tree/workspace.h @@ -105,6 +105,9 @@ struct sway_container *workspace_find_container(struct sway_workspace *ws, */ struct sway_container *workspace_wrap_children(struct sway_workspace *ws); +void workspace_unwrap_children(struct sway_workspace *ws, + struct sway_container *wrap); + void workspace_detach(struct sway_workspace *workspace); void workspace_add_tiling(struct sway_workspace *workspace, diff --git a/meson.build b/meson.build index 2320c582f..997110601 100644 --- a/meson.build +++ b/meson.build @@ -1,7 +1,7 @@ project( 'sway', 'c', - version: '1.5-rc1', #release_version + version: 'v1.5-rc2', #release_version license: 'MIT', meson_version: '>=0.53.0', default_options: [ diff --git a/protocols/wlr-layer-shell-unstable-v1.xml b/protocols/wlr-layer-shell-unstable-v1.xml index f29eb8796..fa67001df 100644 --- a/protocols/wlr-layer-shell-unstable-v1.xml +++ b/protocols/wlr-layer-shell-unstable-v1.xml @@ -1,5 +1,5 @@ - + Copyright © 2017 Drew DeVault @@ -25,7 +25,7 @@ THIS SOFTWARE. - + Clients can use this interface to assign the surface_layer role to wl_surfaces. Such surfaces are assigned to a "layer" of the output and @@ -82,17 +82,27 @@ + + + + + + This request indicates that the client will not use the layer_shell + object any more. Objects that have been created through this instance + are not affected. + + - + An interface that may be implemented by a wl_surface, for surfaces that are designed to be rendered as a layer of a stacked desktop-like environment. - Layer surface state (size, anchor, exclusive zone, margin, interactivity) - is double-buffered, and will be applied at the time wl_surface.commit of - the corresponding wl_surface is called. + Layer surface state (layer, size, anchor, exclusive zone, + margin, interactivity) is double-buffered, and will be applied at the + time wl_surface.commit of the corresponding wl_surface is called. @@ -115,7 +125,7 @@ Requests that the compositor anchor the surface to the specified edges - and corners. If two orthoginal edges are specified (e.g. 'top' and + and corners. If two orthogonal edges are specified (e.g. 'top' and 'left'), then the anchor point will be the intersection of the edges (e.g. the top left corner of the output); otherwise the anchor point will be centered on that edge, or in the center if none is specified. @@ -127,19 +137,24 @@ - Requests that the compositor avoids occluding an area of the surface - with other surfaces. The compositor's use of this information is + Requests that the compositor avoids occluding an area with other + surfaces. The compositor's use of this information is implementation-dependent - do not assume that this region will not actually be occluded. - A positive value is only meaningful if the surface is anchored to an - edge, rather than a corner. The zone is the number of surface-local - coordinates from the edge that are considered exclusive. + A positive value is only meaningful if the surface is anchored to one + edge or an edge and both perpendicular edges. If the surface is not + anchored, anchored to only two perpendicular edges (a corner), anchored + to only two parallel edges or anchored to all edges, a positive value + will be treated the same as zero. + + A positive zone is the distance from the edge in surface-local + coordinates to consider exclusive. Surfaces that do not wish to have an exclusive zone may instead specify how they should interact with surfaces that do. If set to zero, the surface indicates that it would like to be moved to avoid occluding - surfaces with a positive excluzive zone. If set to -1, the surface + surfaces with a positive exclusive zone. If set to -1, the surface indicates that it would not like to be moved to accommodate for other surfaces, and the compositor should extend it all the way to the edges it is anchored to. @@ -281,5 +296,16 @@ + + + + + + Change the layer that the surface is rendered on. + + Layer is double-buffered, see wl_surface.commit. + + + diff --git a/sway/commands/move.c b/sway/commands/move.c index cdbad13e1..038390832 100644 --- a/sway/commands/move.c +++ b/sway/commands/move.c @@ -208,9 +208,13 @@ static void container_move_to_workspace(struct sway_container *container, } } else { container_detach(container); - container->width = container->height = 0; - container->width_fraction = container->height_fraction = 0; - workspace_add_tiling(workspace, container); + if (workspace_is_empty(workspace) && container->children) { + workspace_unwrap_children(workspace, container); + } else { + container->width = container->height = 0; + container->width_fraction = container->height_fraction = 0; + workspace_add_tiling(workspace, container); + } container_update_representation(container); } if (container->view) { @@ -271,12 +275,11 @@ static void workspace_rejigger(struct sway_workspace *ws, return; } container_detach(child); - struct sway_container *new_parent = workspace_wrap_children(ws); + workspace_wrap_children(ws); int index = move_dir == WLR_DIRECTION_LEFT || move_dir == WLR_DIRECTION_UP ? 0 : 1; workspace_insert_tiling(ws, child, index); - container_flatten(new_parent); ws->layout = move_dir == WLR_DIRECTION_LEFT || move_dir == WLR_DIRECTION_RIGHT ? L_HORIZ : L_VERT; @@ -345,8 +348,11 @@ static bool container_move_in_direction(struct sway_container *container, container_insert_child(current->parent, container, index + (offs < 0 ? 0 : 1)); } else { - workspace_insert_tiling(current->workspace, container, - index + (offs < 0 ? 0 : 1)); + struct sway_workspace *ws = current->workspace; + workspace_insert_tiling(ws, + container_split(container, + output_get_default_layout(ws->output)), + index + (offs < 0 ? 0 : 1)); } return true; } diff --git a/sway/input/input-manager.c b/sway/input/input-manager.c index 69342c731..f04a8ce09 100644 --- a/sway/input/input-manager.c +++ b/sway/input/input-manager.c @@ -70,7 +70,8 @@ char *input_device_get_identifier(struct wlr_input_device *device) { char *p = name; for (; *p; ++p) { - if (*p == ' ') { + // There are in fact input devices with unprintable characters in its name + if (*p == ' ' || !isprint(*p)) { *p = '_'; } } diff --git a/sway/input/seat.c b/sway/input/seat.c index a54bc2e7d..656e3e7e8 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c @@ -572,14 +572,6 @@ struct sway_seat *seat_create(const char *seat_name) { seat->deferred_bindings = create_list(); - if (!wl_list_empty(&server.input->seats)) { - // Since this is not the first seat, attempt to set initial focus - struct sway_seat *current_seat = input_manager_current_seat(); - struct sway_node *current_focus = - seat_get_focus_inactive(current_seat, &root->node); - seat_set_focus(seat, current_focus); - } - wl_signal_add(&root->events.new_node, &seat->new_node); seat->new_node.notify = handle_new_node; @@ -604,8 +596,17 @@ struct sway_seat *seat_create(const char *seat_name) { sway_input_method_relay_init(seat, &seat->im_relay); + bool first = wl_list_empty(&server.input->seats); wl_list_insert(&server.input->seats, &seat->link); + if (!first) { + // Since this is not the first seat, attempt to set initial focus + struct sway_seat *current_seat = input_manager_current_seat(); + struct sway_node *current_focus = + seat_get_focus_inactive(current_seat, &root->node); + seat_set_focus(seat, current_focus); + } + seatop_begin_default(seat); return seat; @@ -924,7 +925,7 @@ void seat_configure_xcursor(struct sway_seat *seat) { } #if HAVE_XWAYLAND - if (config->xwayland && (!server.xwayland.xcursor_manager || + if (server.xwayland.wlr_xwayland && (!server.xwayland.xcursor_manager || !xcursor_manager_is_named(server.xwayland.xcursor_manager, cursor_theme) || server.xwayland.xcursor_manager->size != cursor_size)) { diff --git a/sway/server.c b/sway/server.c index c036396f3..ff848450d 100644 --- a/sway/server.c +++ b/sway/server.c @@ -202,6 +202,7 @@ bool server_start(struct sway_server *server) { config->xwayland == XWAYLAND_MODE_LAZY); if (!server->xwayland.wlr_xwayland) { sway_log(SWAY_ERROR, "Failed to start Xwayland"); + unsetenv("DISPLAY"); } else { wl_signal_add(&server->xwayland.wlr_xwayland->events.new_surface, &server->xwayland_surface); diff --git a/sway/tree/container.c b/sway/tree/container.c index 4cc42747d..fa1598ef9 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c @@ -1329,6 +1329,14 @@ void container_detach(struct sway_container *child) { container_update_representation(old_parent); node_set_dirty(&old_parent->node); } else if (old_workspace) { + // We may have removed the last tiling child from the workspace. If the + // workspace layout was e.g. tabbed, then at this point it may be just + // H[]. So, reset it to the default (e.g. T[]) for next time. + if (!old_workspace->tiling->length) { + old_workspace->layout = + output_get_default_layout(old_workspace->output); + } + workspace_update_representation(old_workspace); node_set_dirty(&old_workspace->node); } diff --git a/sway/tree/view.c b/sway/tree/view.c index 9706de42b..ac3147953 100644 --- a/sway/tree/view.c +++ b/sway/tree/view.c @@ -746,6 +746,7 @@ void view_map(struct sway_view *view, struct wlr_surface *wlr_surface, } else if ((class = view_get_class(view)) != NULL) { wlr_foreign_toplevel_handle_v1_set_app_id( view->foreign_toplevel, class); + } } void view_unmap(struct sway_view *view) { @@ -1170,7 +1171,7 @@ void view_update_title(struct sway_view *view, bool force) { ipc_event_window(view->container, "title"); - if (view->foreign_toplevel) { + if (view->foreign_toplevel && title) { wlr_foreign_toplevel_handle_v1_set_title(view->foreign_toplevel, title); } } diff --git a/sway/tree/workspace.c b/sway/tree/workspace.c index 0fa28951e..3bcba8e54 100644 --- a/sway/tree/workspace.c +++ b/sway/tree/workspace.c @@ -641,6 +641,21 @@ struct sway_container *workspace_wrap_children(struct sway_workspace *ws) { return middle; } +void workspace_unwrap_children(struct sway_workspace *ws, + struct sway_container *wrap) { + if (!sway_assert(workspace_is_empty(ws), + "target workspace must be empty")) { + return; + } + + ws->layout = wrap->layout; + while (wrap->children->length) { + struct sway_container *child = wrap->children->items[0]; + container_detach(child); + workspace_add_tiling(ws, child); + } +} + void workspace_detach(struct sway_workspace *workspace) { struct sway_output *output = workspace->output; int index = list_find(output->workspaces, workspace);