mirror of
https://github.com/swaywm/sway.git
synced 2024-11-22 07:51:28 +00:00
(desktop|tree)/output: Do not use layout listener to arrange
Output layout changes originate from the centralized modeset
infrastructure and request_state which already takes care of arranging
and updating outputs as needed.
(cherry picked from af28ac04a4
)
This commit is contained in:
parent
fa96c64e24
commit
6baee5cb68
|
@ -136,7 +136,6 @@ enum sway_container_layout output_get_default_layout(
|
||||||
|
|
||||||
enum wlr_direction opposite_direction(enum wlr_direction d);
|
enum wlr_direction opposite_direction(enum wlr_direction d);
|
||||||
|
|
||||||
void handle_output_layout_change(struct wl_listener *listener, void *data);
|
|
||||||
|
|
||||||
void handle_gamma_control_set_gamma(struct wl_listener *listener, void *data);
|
void handle_gamma_control_set_gamma(struct wl_listener *listener, void *data);
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,6 @@ struct sway_server {
|
||||||
struct sway_input_manager *input;
|
struct sway_input_manager *input;
|
||||||
|
|
||||||
struct wl_listener new_output;
|
struct wl_listener new_output;
|
||||||
struct wl_listener output_layout_change;
|
|
||||||
struct wl_listener renderer_lost;
|
struct wl_listener renderer_lost;
|
||||||
|
|
||||||
struct wlr_idle_notifier_v1 *idle_notifier_v1;
|
struct wlr_idle_notifier_v1 *idle_notifier_v1;
|
||||||
|
|
|
@ -16,8 +16,6 @@ struct sway_root {
|
||||||
struct sway_node node;
|
struct sway_node node;
|
||||||
struct wlr_output_layout *output_layout;
|
struct wlr_output_layout *output_layout;
|
||||||
|
|
||||||
struct wl_listener output_layout_change;
|
|
||||||
|
|
||||||
// scene node layout:
|
// scene node layout:
|
||||||
// - root
|
// - root
|
||||||
// - staging
|
// - staging
|
||||||
|
|
|
@ -578,13 +578,6 @@ void handle_new_output(struct wl_listener *listener, void *data) {
|
||||||
request_modeset(server);
|
request_modeset(server);
|
||||||
}
|
}
|
||||||
|
|
||||||
void handle_output_layout_change(struct wl_listener *listener,
|
|
||||||
void *data) {
|
|
||||||
struct sway_server *server =
|
|
||||||
wl_container_of(listener, server, output_layout_change);
|
|
||||||
update_output_manager_config(server);
|
|
||||||
}
|
|
||||||
|
|
||||||
void handle_gamma_control_set_gamma(struct wl_listener *listener, void *data) {
|
void handle_gamma_control_set_gamma(struct wl_listener *listener, void *data) {
|
||||||
struct sway_server *server =
|
struct sway_server *server =
|
||||||
wl_container_of(listener, server, gamma_control_set_gamma);
|
wl_container_of(listener, server, gamma_control_set_gamma);
|
||||||
|
|
|
@ -272,9 +272,6 @@ bool server_init(struct sway_server *server) {
|
||||||
|
|
||||||
server->new_output.notify = handle_new_output;
|
server->new_output.notify = handle_new_output;
|
||||||
wl_signal_add(&server->backend->events.new_output, &server->new_output);
|
wl_signal_add(&server->backend->events.new_output, &server->new_output);
|
||||||
server->output_layout_change.notify = handle_output_layout_change;
|
|
||||||
wl_signal_add(&root->output_layout->events.change,
|
|
||||||
&server->output_layout_change);
|
|
||||||
|
|
||||||
server->xdg_output_manager_v1 =
|
server->xdg_output_manager_v1 =
|
||||||
wlr_xdg_output_manager_v1_create(server->wl_display, root->output_layout);
|
wlr_xdg_output_manager_v1_create(server->wl_display, root->output_layout);
|
||||||
|
|
|
@ -19,12 +19,6 @@
|
||||||
|
|
||||||
struct sway_root *root;
|
struct sway_root *root;
|
||||||
|
|
||||||
static void output_layout_handle_change(struct wl_listener *listener,
|
|
||||||
void *data) {
|
|
||||||
arrange_root();
|
|
||||||
transaction_commit_dirty();
|
|
||||||
}
|
|
||||||
|
|
||||||
struct sway_root *root_create(struct wl_display *wl_display) {
|
struct sway_root *root_create(struct wl_display *wl_display) {
|
||||||
struct sway_root *root = calloc(1, sizeof(struct sway_root));
|
struct sway_root *root = calloc(1, sizeof(struct sway_root));
|
||||||
if (!root) {
|
if (!root) {
|
||||||
|
@ -81,14 +75,10 @@ struct sway_root *root_create(struct wl_display *wl_display) {
|
||||||
root->non_desktop_outputs = create_list();
|
root->non_desktop_outputs = create_list();
|
||||||
root->scratchpad = create_list();
|
root->scratchpad = create_list();
|
||||||
|
|
||||||
root->output_layout_change.notify = output_layout_handle_change;
|
|
||||||
wl_signal_add(&root->output_layout->events.change,
|
|
||||||
&root->output_layout_change);
|
|
||||||
return root;
|
return root;
|
||||||
}
|
}
|
||||||
|
|
||||||
void root_destroy(struct sway_root *root) {
|
void root_destroy(struct sway_root *root) {
|
||||||
wl_list_remove(&root->output_layout_change.link);
|
|
||||||
list_free(root->scratchpad);
|
list_free(root->scratchpad);
|
||||||
list_free(root->non_desktop_outputs);
|
list_free(root->non_desktop_outputs);
|
||||||
list_free(root->outputs);
|
list_free(root->outputs);
|
||||||
|
|
Loading…
Reference in a new issue