mirror of
https://github.com/swaywm/sway.git
synced 2024-12-27 15:36:29 +01:00
Merge branch 'master' into swaybar-hotplug
This commit is contained in:
commit
04862e2121
5 changed files with 33 additions and 13 deletions
|
@ -5,7 +5,7 @@ i3互換な[Wayland](http://wayland.freedesktop.org/)コンポジタです。
|
|||
[FAQ](https://github.com/swaywm/sway/wiki)も合わせてご覧ください。
|
||||
[IRC チャンネル](http://webchat.freenode.net/?channels=sway&uio=d4) (#sway on irc.freenode.net)もあります。
|
||||
|
||||
**注意**: Swayは現在*凍結中*であり、Swayとwlrootsの統合が完了するまで、新たな機能は追加されません。バグフィックスは行われます。詳しくは[この記事](https://drewdevault.com/2017/10/09/Future-of-sway.html)をご覧ください。wlrootsとの統合状況については、[このチケット](https://github.com/swaywm/sway/issues/1390)をご覧ください。
|
||||
**注意**: Swayは現在*凍結中*であり、wlcからwlrootsへの移植が完了するまで新たな機能は追加されません。2018年9月以降に発見されるバグは0.15では対応されません。詳しくは[この記事](https://drewdevault.com/2017/10/09/Future-of-sway.html)をご覧ください。wlrootsとの統合状況については、[このチケット](https://github.com/swaywm/sway/issues/1390)をご覧ください。
|
||||
|
||||
[![](https://sr.ht/ICd5.png)](https://sr.ht/ICd5.png)
|
||||
|
||||
|
|
|
@ -9,10 +9,10 @@ Read the [FAQ](https://github.com/swaywm/sway/wiki). Join the
|
|||
[IRC channel](http://webchat.freenode.net/?channels=sway&uio=d4) (#sway on
|
||||
irc.freenode.net).
|
||||
|
||||
**Notice**: You are viewing the **unstable** and **unsupported** master branch
|
||||
of sway, where work is ongoing to port it to
|
||||
[wlroots](https://github.com/swaywm/wlroots). The supported branch is the 0.15
|
||||
branch, and end users are encouraged to use the stable releases cut from it.
|
||||
**Notice**: work is well underway to port sway to
|
||||
[wlroots](https://github.com/swaywm/wlroots). This is **unstable** and
|
||||
**unsupported** - we accept patches, but are not fond of bug reports. We are no
|
||||
longer accepting bugs for 0.15.
|
||||
|
||||
If you'd like to support sway development, please contribute to [SirCmpwn's
|
||||
Patreon page](https://patreon.com/sircmpwn).
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
#include <wlr/config.h>
|
||||
#include <wlr/backend/multi.h>
|
||||
#include <wlr/backend/wayland.h>
|
||||
#ifdef WLR_HAS_X11_BACKEND
|
||||
#include <wlr/backend/x11.h>
|
||||
#endif
|
||||
#include "sway/commands.h"
|
||||
#include "sway/server.h"
|
||||
#include "log.h"
|
||||
|
@ -14,10 +17,13 @@ static void create_output(struct wlr_backend *backend, void *data) {
|
|||
if (wlr_backend_is_wl(backend)) {
|
||||
wlr_wl_output_create(backend);
|
||||
*done = true;
|
||||
} else if (wlr_backend_is_x11(backend)) {
|
||||
}
|
||||
#ifdef WLR_HAS_X11_BACKEND
|
||||
else if (wlr_backend_is_x11(backend)) {
|
||||
wlr_x11_output_create(backend);
|
||||
*done = true;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -914,12 +914,17 @@ void output_render(struct sway_output *output, struct timespec *when,
|
|||
struct wlr_output *wlr_output = output->wlr_output;
|
||||
|
||||
struct wlr_renderer *renderer =
|
||||
wlr_backend_get_renderer(wlr_output->backend);
|
||||
wlr_backend_get_renderer(wlr_output->backend);
|
||||
if (!sway_assert(renderer != NULL,
|
||||
"expected the output backend to have a renderer")) {
|
||||
return;
|
||||
}
|
||||
|
||||
struct sway_workspace *workspace = output->current.active_workspace;
|
||||
if (workspace == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
wlr_renderer_begin(renderer, wlr_output->width, wlr_output->height);
|
||||
|
||||
if (!pixman_region32_not_empty(damage)) {
|
||||
|
@ -935,13 +940,11 @@ void output_render(struct sway_output *output, struct timespec *when,
|
|||
pixman_region32_union_rect(damage, damage, 0, 0, width, height);
|
||||
}
|
||||
|
||||
struct sway_workspace *workspace = output->current.active_workspace;
|
||||
struct sway_container *fullscreen_con = workspace->current.fullscreen;
|
||||
|
||||
if (output_has_opaque_overlay_layer_surface(output)) {
|
||||
goto render_overlay;
|
||||
}
|
||||
|
||||
struct sway_container *fullscreen_con = workspace->current.fullscreen;
|
||||
if (fullscreen_con) {
|
||||
float clear_color[] = {0.0f, 0.0f, 0.0f, 1.0f};
|
||||
|
||||
|
|
|
@ -117,7 +117,9 @@ bool i3bar_handle_readable(struct status_line *status) {
|
|||
memmove(status->buffer, &status->buffer[c], status->buffer_index);
|
||||
break;
|
||||
} else if (!isspace(status->buffer[c])) {
|
||||
status_error(status, "[invalid json]");
|
||||
wlr_log(WLR_DEBUG, "Invalid i3bar json: expected '[' but encountered '%c'",
|
||||
status->buffer[c]);
|
||||
status_error(status, "[invalid i3bar json]");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -155,6 +157,8 @@ bool i3bar_handle_readable(struct status_line *status) {
|
|||
++buffer_pos;
|
||||
break;
|
||||
} else if (!isspace(status->buffer[buffer_pos])) {
|
||||
wlr_log(WLR_DEBUG, "Invalid i3bar json: expected ',' but encountered '%c'",
|
||||
status->buffer[buffer_pos]);
|
||||
status_error(status, "[invalid i3bar json]");
|
||||
return true;
|
||||
}
|
||||
|
@ -166,7 +170,8 @@ bool i3bar_handle_readable(struct status_line *status) {
|
|||
} else {
|
||||
test_object = json_tokener_parse_ex(status->tokener,
|
||||
&status->buffer[buffer_pos], status->buffer_index - buffer_pos);
|
||||
if (json_tokener_get_error(status->tokener) == json_tokener_success) {
|
||||
enum json_tokener_error err = json_tokener_get_error(status->tokener);
|
||||
if (err == json_tokener_success) {
|
||||
if (json_object_get_type(test_object) == json_type_array) {
|
||||
if (last_object) {
|
||||
json_object_put(last_object);
|
||||
|
@ -198,12 +203,14 @@ bool i3bar_handle_readable(struct status_line *status) {
|
|||
continue; // look for comma without reading more input
|
||||
}
|
||||
buffer_pos = status->buffer_index = 0;
|
||||
} else if (json_tokener_get_error(status->tokener) == json_tokener_continue) {
|
||||
} else if (err == json_tokener_continue) {
|
||||
json_tokener_reset(status->tokener);
|
||||
if (status->buffer_index < status->buffer_size) {
|
||||
// move the object to the start of the buffer
|
||||
status->buffer_index -= buffer_pos;
|
||||
memmove(status->buffer, &status->buffer[buffer_pos],
|
||||
status->buffer_index);
|
||||
buffer_pos = 0;
|
||||
} else {
|
||||
// expand buffer
|
||||
status->buffer_size *= 2;
|
||||
|
@ -217,6 +224,10 @@ bool i3bar_handle_readable(struct status_line *status) {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
char last_char = status->buffer[status->buffer_index - 1];
|
||||
status->buffer[status->buffer_index - 1] = '\0';
|
||||
wlr_log(WLR_DEBUG, "Failed to parse i3bar json - %s: '%s%c'",
|
||||
json_tokener_error_desc(err), &status->buffer[buffer_pos], last_char);
|
||||
status_error(status, "[failed to parse i3bar json]");
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue