mirror of
https://github.com/swaywm/sway.git
synced 2026-05-03 06:46:26 -04:00
Merge branch 'ipc-focused' into multibackend
This commit is contained in:
commit
63f6c32c8f
2 changed files with 26 additions and 11 deletions
|
|
@ -5,6 +5,8 @@
|
|||
#include "sway/ipc-json.h"
|
||||
#include "sway/container.h"
|
||||
#include "sway/output.h"
|
||||
#include "sway/input/input-manager.h"
|
||||
#include "sway/input/seat.h"
|
||||
#include <wlr/types/wlr_box.h>
|
||||
#include <wlr/types/wlr_output.h>
|
||||
|
||||
|
|
@ -95,11 +97,15 @@ json_object *ipc_json_describe_container(swayc_t *c) {
|
|||
return NULL;
|
||||
}
|
||||
|
||||
struct sway_seat *seat = sway_input_manager_get_default_seat(input_manager);
|
||||
bool focused = sway_seat_get_focus(seat) == c;
|
||||
|
||||
json_object *object = json_object_new_object();
|
||||
|
||||
json_object_object_add(object, "id", json_object_new_int((int)c->id));
|
||||
json_object_object_add(object, "name", (c->name) ? json_object_new_string(c->name) : NULL);
|
||||
json_object_object_add(object, "rect", ipc_json_create_rect(c));
|
||||
json_object_object_add(object, "focused", json_object_new_boolean(focused));
|
||||
|
||||
switch (c->type) {
|
||||
case C_ROOT:
|
||||
|
|
|
|||
|
|
@ -353,35 +353,44 @@ The default colors are:
|
|||
Prevents windows matching <criteria> from being focused automatically when
|
||||
they're created. This does not apply to the first window in a workspace.
|
||||
|
||||
**output** <name> <resolution|res> <WIDTHxHEIGHT>::
|
||||
Configures the specified output to use the given resolution.
|
||||
**output** <name> mode|resolution|res <WIDTHxHEIGHT>[@<RATE>[Hz]]::
|
||||
Configures the specified output to use the given mode. Modes are a combination
|
||||
of width and height (in pixels) and a refresh rate that your display can be
|
||||
configured to use. For a list of available modes, use swaymsg -t get_outputs.
|
||||
+
|
||||
_Note_: sway does not currently support setting the output mode. Your output's native
|
||||
resolution will be used and the screen will be scaled from the resolution
|
||||
specified to your native resolution.
|
||||
Examples:
|
||||
+
|
||||
output HDMI-A-1 mode 1920x1080
|
||||
+
|
||||
output HDMI-A-1 mode 1920x1080@60Hz
|
||||
|
||||
**output** <name> <position|pos> <X,Y>::
|
||||
**output** <name> position|pos <X,Y>::
|
||||
Configures the specified output to be arranged at the given position.
|
||||
|
||||
**output** <name> <scale> <I>::
|
||||
**output** <name> scale <I>::
|
||||
Configures the specified output to be scaled up by the specified integer
|
||||
scaling factor (usually 2 for HiDPI screens).
|
||||
scaling factor (usually 2 for HiDPI screens). Fractional scaling is supported.
|
||||
|
||||
**output** <name> <background|bg> <file> <mode>::
|
||||
**output** <name> background|bg <file> <mode>::
|
||||
Sets the wallpaper for the given output to the specified file, using the given
|
||||
scaling mode (one of "stretch", "fill", "fit", "center", "tile").
|
||||
|
||||
**output** <name> <background|bg> <color> solid_color::
|
||||
**output** <name> background|bg <color> solid_color::
|
||||
Sets the background of the given output to the specified color. _color_ should
|
||||
be specified as an _#rrggbb_ (no alpha) color.
|
||||
|
||||
**output** <name> transform <transform>::
|
||||
Sets the background transform to the given value. Can be one of "90", "180",
|
||||
"270" for rotation; or "flipped", "flipped-90", "flipped-180", "flipped-270"
|
||||
to apply a rotation and flip, or "normal" to apply no transform.
|
||||
|
||||
**output** <name> disable::
|
||||
Disables the specified output.
|
||||
|
||||
**NOTES FOR THE OUTPUT COMMAND**::
|
||||
You may combine output commands into one, like so:
|
||||
+
|
||||
output HDMI-A-1 res 1920x1080 pos 1920,0 bg ~/wallpaper.png stretch
|
||||
output HDMI-A-1 mode 1920x1080 pos 1920,0 bg ~/wallpaper.png stretch
|
||||
+
|
||||
You can get a list of output names like so:
|
||||
+
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue