
This allows things like wlr-randr to work. wlr-randr or similar can send in two new events: `output_manager_apply' and `output_manager_test'. In output.c, their handler both call an new `output_manager_configure' function which loops through the list of outputs twice. The first loop applies all the requested configuration ad checks that its not all messed up. The second loop either commits that configuration or reverts it depending on whether it worked and whether we're responding to a test event. There's also now an output_manager_update function, called whenever the output layout is changed, which copies changes from the wlr_output_layout to the wlr_output_manager.
46 lines
1.5 KiB
C
46 lines
1.5 KiB
C
/* Copyright (c), Niclas Meyer <niclas@countingsort.com>
|
|
*
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
* You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
*/
|
|
|
|
#ifndef KIWMI_DESKTOP_DESKTOP_H
|
|
#define KIWMI_DESKTOP_DESKTOP_H
|
|
|
|
#include <wayland-server.h>
|
|
|
|
struct kiwmi_desktop {
|
|
struct wlr_compositor *compositor;
|
|
struct wlr_xdg_shell *xdg_shell;
|
|
struct wlr_xdg_decoration_manager_v1 *xdg_decoration_manager;
|
|
struct wlr_layer_shell_v1 *layer_shell;
|
|
struct wlr_data_device_manager *data_device_manager;
|
|
struct wlr_output_layout *output_layout;
|
|
struct wlr_output_manager_v1 *output_manager;
|
|
struct wl_list outputs; // struct kiwmi_output::link
|
|
struct wl_list views; // struct kiwmi_view::link
|
|
|
|
float bg_color[4];
|
|
|
|
struct wl_listener xdg_shell_new_surface;
|
|
struct wl_listener xdg_toplevel_new_decoration;
|
|
struct wl_listener layer_shell_new_surface;
|
|
struct wl_listener new_output;
|
|
struct wl_listener output_manager_apply;
|
|
struct wl_listener output_manager_test;
|
|
|
|
struct {
|
|
struct wl_signal new_output;
|
|
struct wl_signal view_map;
|
|
struct wl_signal request_active_output;
|
|
} events;
|
|
};
|
|
|
|
bool desktop_init(struct kiwmi_desktop *desktop);
|
|
void desktop_fini(struct kiwmi_desktop *desktop);
|
|
|
|
struct kiwmi_server;
|
|
struct kiwmi_output *desktop_active_output(struct kiwmi_server *server);
|
|
|
|
#endif /* KIWMI_DESKTOP_DESKTOP_H */
|