Merge remote-tracking branch 'refs/remotes/origin/development' into development

This commit is contained in:
project-repo 2024-01-25 19:45:13 +00:00
commit fb8c4c6eb7
5 changed files with 28 additions and 6 deletions

View file

@ -677,6 +677,8 @@ main(int argc, char *argv[]) {
wl_list_init(&server.outputs);
struct cg_output *output, *output_tmp;
wl_list_for_each_safe(output, output_tmp, &tmp_list, link) {
wl_list_remove(&output->link);
output_insert(&server, output);
output_configure(&server, output);
}
server.curr_output =

View file

@ -250,6 +250,12 @@ cg-ipc{"event_name":"destroy_output","output":"HDMI-A-1","output_id":2}
- curr_output: current output as a string
- default_mode: name of the default mode as a string
- modes: list of names of modes as strings
- message_config: the current configuration of the cagebreak messages
* font: the font used to display the messages
* display_time: the duration in seconds that the cagebreak messages are displayed
* bg_color: list of four floating point numbers denoting the background color in rgba
* fg_color: list of four floating point numbers denoting the foreground color in rgba
* anchor: the positioning of the messages on the screen (see *cagebreak-config(5)* for more information)
- outputs: object of objects for each output
- output name as string
- priority: priority as per *output* prio <n> in *cagebreak-config(5)* or default
@ -257,6 +263,7 @@ cg-ipc{"event_name":"destroy_output","output":"HDMI-A-1","output_id":2}
- size: object of width and height as integers
- refresh_rate: refresh rate as float
- permanent: 0 if peripheral, 1 if permanent
- active: 1 if the output is active, 0 if not
- curr_workspace: current workspace as an integer
- workspaces: list of objects for each workspace
- views: list of objects for each view
@ -289,12 +296,18 @@ cg-ipc{"event_name":"dump","nws":1,
"curr_output":"eDP-1",
"default_mode":"top",
"modes":["top","root","resize"],
"outputs": {"eDP-1": {
"message_config": {"font": "pango:Monospace 10",
"display_time": 2,
"bg_color": [0.900000,0.850000,0.850000,1.000000],
"fg_color": [0.000000,0.000000,0.000000,1.000000],
"anchor": "top_right"
},"outputs": {"eDP-1": {
"priority": -1,
"coords": {"x":0,"y":0},
"size": {"width":2560,"height":1440},
"refresh_rate": 60.012000,
"permanent": 0
"permanent": 0,
"active": 1,
"curr_workspace": 0,
"workspaces": [{"views": [{
"id": 16,

View file

@ -317,6 +317,7 @@ output_apply_config(struct cg_server *server, struct cg_output *output,
prev_box.y = output->layout_box.y;
prev_box.width = output->layout_box.width;
prev_box.height = output->layout_box.height;
bool prio_changed = false;
if(config->role != OUTPUT_ROLE_DEFAULT) {
output->role = config->role;
if((output->role == OUTPUT_ROLE_PERIPHERAL) &&
@ -328,6 +329,7 @@ output_apply_config(struct cg_server *server, struct cg_output *output,
}
if(config->priority != -1) {
prio_changed = (output->priority != config->priority);
output->priority = config->priority;
}
@ -416,8 +418,10 @@ output_apply_config(struct cg_server *server, struct cg_output *output,
wlr_output_enable(wlr_output, false);
wlr_output_commit(wlr_output);
} else {
wl_list_remove(&output->link);
output_insert(server, output);
if(prio_changed) {
wl_list_remove(&output->link);
output_insert(server, output);
}
wlr_output_enable(wlr_output, true);
wlr_output_commit(wlr_output);
}

View file

@ -77,4 +77,6 @@ int
output_get_num(const struct cg_output *output);
void
handle_output_gamma_control_set_gamma(struct wl_listener *listener, void *data);
void
output_insert(struct cg_server *server, struct cg_output *output);
#endif

View file

@ -164,8 +164,9 @@ handle_xdg_shell_surface_request_fullscreen(struct wl_listener *listener,
* they display in fullscreen mode, so we set it here.
*/
struct wlr_box layout_box;
wlr_output_layout_get_box(xdg_shell_view->view.server->output_layout, NULL,
&layout_box);
wlr_output_layout_get_box(
xdg_shell_view->view.server->output_layout,
xdg_shell_view->view.workspace->output->wlr_output, &layout_box);
wlr_xdg_toplevel_set_size(xdg_shell_view->xdg_surface->toplevel,
layout_box.width, layout_box.height);