mirror of
https://github.com/cage-kiosk/cage.git
synced 2026-02-05 04:06:24 -05:00
Merge 73025483fe into dcd64ae48b
This commit is contained in:
commit
4641ce3074
3 changed files with 1 additions and 61 deletions
11
cage.c
11
cage.c
|
|
@ -244,8 +244,6 @@ usage(FILE *file, const char *cage)
|
|||
" -d\t Don't draw client side decorations, when possible\n"
|
||||
" -D\t Enable debug logging\n"
|
||||
" -h\t Display this help message\n"
|
||||
" -m extend Extend the display across all connected outputs (default)\n"
|
||||
" -m last Use only the last connected output\n"
|
||||
" -s\t Allow VT switching\n"
|
||||
" -v\t Show the version number and exit\n"
|
||||
"\n"
|
||||
|
|
@ -257,7 +255,7 @@ static bool
|
|||
parse_args(struct cg_server *server, int argc, char *argv[])
|
||||
{
|
||||
int c;
|
||||
while ((c = getopt(argc, argv, "dDhm:sv")) != -1) {
|
||||
while ((c = getopt(argc, argv, "dDhsv")) != -1) {
|
||||
switch (c) {
|
||||
case 'd':
|
||||
server->xdg_decoration = true;
|
||||
|
|
@ -268,13 +266,6 @@ parse_args(struct cg_server *server, int argc, char *argv[])
|
|||
case 'h':
|
||||
usage(stdout, argv[0]);
|
||||
return false;
|
||||
case 'm':
|
||||
if (strcmp(optarg, "last") == 0) {
|
||||
server->output_mode = CAGE_MULTI_OUTPUT_MODE_LAST;
|
||||
} else if (strcmp(optarg, "extend") == 0) {
|
||||
server->output_mode = CAGE_MULTI_OUTPUT_MODE_EXTEND;
|
||||
}
|
||||
break;
|
||||
case 's':
|
||||
server->allow_vt_switch = true;
|
||||
break;
|
||||
|
|
|
|||
45
output.c
45
output.c
|
|
@ -96,42 +96,6 @@ output_layout_remove(struct cg_output *output)
|
|||
wlr_output_layout_remove(output->server->output_layout, output->wlr_output);
|
||||
}
|
||||
|
||||
static void
|
||||
output_enable(struct cg_output *output)
|
||||
{
|
||||
struct wlr_output *wlr_output = output->wlr_output;
|
||||
|
||||
/* Outputs get enabled by the backend before firing the new_output event,
|
||||
* so we can't do a check for already enabled outputs here unless we
|
||||
* duplicate the enabled property in cg_output. */
|
||||
wlr_log(WLR_DEBUG, "Enabling output %s", wlr_output->name);
|
||||
|
||||
struct wlr_output_state state = {0};
|
||||
wlr_output_state_set_enabled(&state, true);
|
||||
|
||||
if (wlr_output_commit_state(wlr_output, &state)) {
|
||||
output_layout_add_auto(output);
|
||||
}
|
||||
|
||||
update_output_manager_config(output->server);
|
||||
}
|
||||
|
||||
static void
|
||||
output_disable(struct cg_output *output)
|
||||
{
|
||||
struct wlr_output *wlr_output = output->wlr_output;
|
||||
if (!wlr_output->enabled) {
|
||||
wlr_log(WLR_DEBUG, "Not disabling already disabled output %s", wlr_output->name);
|
||||
return;
|
||||
}
|
||||
|
||||
wlr_log(WLR_DEBUG, "Disabling output %s", wlr_output->name);
|
||||
struct wlr_output_state state = {0};
|
||||
wlr_output_state_set_enabled(&state, false);
|
||||
wlr_output_commit_state(wlr_output, &state);
|
||||
output_layout_remove(output);
|
||||
}
|
||||
|
||||
static void
|
||||
handle_output_frame(struct wl_listener *listener, void *data)
|
||||
{
|
||||
|
|
@ -217,10 +181,6 @@ output_destroy(struct cg_output *output)
|
|||
|
||||
if (wl_list_empty(&server->outputs) && was_nested_output) {
|
||||
server_terminate(server);
|
||||
} else if (server->output_mode == CAGE_MULTI_OUTPUT_MODE_LAST && !wl_list_empty(&server->outputs)) {
|
||||
struct cg_output *prev = wl_container_of(server->outputs.next, prev, link);
|
||||
output_enable(prev);
|
||||
view_position_all(server);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -301,11 +261,6 @@ handle_new_output(struct wl_listener *listener, void *data)
|
|||
}
|
||||
}
|
||||
|
||||
if (server->output_mode == CAGE_MULTI_OUTPUT_MODE_LAST && wl_list_length(&server->outputs) > 1) {
|
||||
struct cg_output *next = wl_container_of(output->link.next, next, link);
|
||||
output_disable(next);
|
||||
}
|
||||
|
||||
if (!wlr_xcursor_manager_load(server->seat->xcursor_manager, wlr_output->scale)) {
|
||||
wlr_log(WLR_ERROR, "Cannot load XCursor theme for output '%s' with scale %f", wlr_output->name,
|
||||
wlr_output->scale);
|
||||
|
|
|
|||
6
server.h
6
server.h
|
|
@ -17,11 +17,6 @@
|
|||
#include <wlr/xwayland.h>
|
||||
#endif
|
||||
|
||||
enum cg_multi_output_mode {
|
||||
CAGE_MULTI_OUTPUT_MODE_EXTEND,
|
||||
CAGE_MULTI_OUTPUT_MODE_LAST,
|
||||
};
|
||||
|
||||
struct cg_server {
|
||||
struct wl_display *wl_display;
|
||||
struct wl_list views;
|
||||
|
|
@ -37,7 +32,6 @@ struct cg_server {
|
|||
struct wl_listener new_idle_inhibitor_v1;
|
||||
struct wl_list inhibitors;
|
||||
|
||||
enum cg_multi_output_mode output_mode;
|
||||
struct wlr_output_layout *output_layout;
|
||||
struct wlr_scene_output_layout *scene_output_layout;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue