mirror of
https://github.com/swaywm/sway.git
synced 2024-12-25 22:46:31 +01:00
Compare commits
3 commits
6a13320162
...
0ad4c3c412
Author | SHA1 | Date | |
---|---|---|---|
|
0ad4c3c412 | ||
|
801bc76ce3 | ||
|
1c4d905920 |
2 changed files with 24 additions and 14 deletions
|
@ -5,27 +5,26 @@
|
||||||
#if WLR_HAS_X11_BACKEND
|
#if WLR_HAS_X11_BACKEND
|
||||||
#include <wlr/backend/x11.h>
|
#include <wlr/backend/x11.h>
|
||||||
#endif
|
#endif
|
||||||
|
#include <wlr/types/wlr_output.h>
|
||||||
#include "sway/commands.h"
|
#include "sway/commands.h"
|
||||||
|
#include "sway/output.h"
|
||||||
#include "sway/server.h"
|
#include "sway/server.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
|
||||||
static void create_output(struct wlr_backend *backend, void *data) {
|
static void create_output(struct wlr_backend *backend, void *data) {
|
||||||
bool *done = data;
|
struct wlr_output **result = data;
|
||||||
if (*done) {
|
if (*result) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wlr_backend_is_wl(backend)) {
|
if (wlr_backend_is_wl(backend)) {
|
||||||
wlr_wl_output_create(backend);
|
*result = wlr_wl_output_create(backend);
|
||||||
*done = true;
|
|
||||||
} else if (wlr_backend_is_headless(backend)) {
|
} else if (wlr_backend_is_headless(backend)) {
|
||||||
wlr_headless_add_output(backend, 1920, 1080);
|
*result = wlr_headless_add_output(backend, 1920, 1080);
|
||||||
*done = true;
|
|
||||||
}
|
}
|
||||||
#if WLR_HAS_X11_BACKEND
|
#if WLR_HAS_X11_BACKEND
|
||||||
else if (wlr_backend_is_x11(backend)) {
|
else if (wlr_backend_is_x11(backend)) {
|
||||||
wlr_x11_output_create(backend);
|
*result = wlr_x11_output_create(backend);
|
||||||
*done = true;
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -37,13 +36,24 @@ struct cmd_results *cmd_create_output(int argc, char **argv) {
|
||||||
sway_assert(wlr_backend_is_multi(server.backend),
|
sway_assert(wlr_backend_is_multi(server.backend),
|
||||||
"Expected a multi backend");
|
"Expected a multi backend");
|
||||||
|
|
||||||
bool done = false;
|
struct cmd_results *error = NULL;
|
||||||
wlr_multi_for_each_backend(server.backend, create_output, &done);
|
if ((error = checkarg(argc, "create_output", EXPECTED_AT_MOST, 1))) {
|
||||||
|
return error;
|
||||||
|
}
|
||||||
|
if (argc > 0 && all_output_by_name_or_id(argv[0])) {
|
||||||
|
return cmd_results_new(CMD_INVALID, "Output name already in use");
|
||||||
|
}
|
||||||
|
struct wlr_output *result = NULL;
|
||||||
|
wlr_multi_for_each_backend(server.backend, create_output, &result);
|
||||||
|
|
||||||
if (!done) {
|
if (!result) {
|
||||||
return cmd_results_new(CMD_INVALID,
|
return cmd_results_new(CMD_INVALID,
|
||||||
"Can only create outputs for Wayland, X11 or headless backends");
|
"Can only create outputs for Wayland, X11 or headless backends");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (argc > 0) {
|
||||||
|
wlr_output_set_name(result, argv[0]);
|
||||||
|
}
|
||||||
|
|
||||||
return cmd_results_new(CMD_SUCCESS, NULL);
|
return cmd_results_new(CMD_SUCCESS, NULL);
|
||||||
}
|
}
|
||||||
|
|
|
@ -106,9 +106,9 @@ They are expected to be used with *bindsym* or at runtime through *swaymsg*(1).
|
||||||
*border* none|normal|csd|pixel [<n>]
|
*border* none|normal|csd|pixel [<n>]
|
||||||
Set border style for focused window. _normal_ includes a border of
|
Set border style for focused window. _normal_ includes a border of
|
||||||
thickness _n_ and a title bar. _pixel_ is a border without title bar _n_
|
thickness _n_ and a title bar. _pixel_ is a border without title bar _n_
|
||||||
pixels thick. Default is _normal_ with border thickness 2. _csd_ is short
|
pixels thick. The title bar always shows in stacking or tabbed layouts.
|
||||||
for client-side-decorations, which allows the client to draw its own
|
_csd_ is short for client-side-decorations, which allows the client to draw
|
||||||
decorations.
|
its own decorations. Default is _normal_ with border thickness 2.
|
||||||
|
|
||||||
*border* toggle
|
*border* toggle
|
||||||
Cycles through the available border styles.
|
Cycles through the available border styles.
|
||||||
|
|
Loading…
Reference in a new issue