mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-22 04:45:58 +01:00
examples: enable new outputs
This commit is contained in:
parent
9e6431dc3b
commit
2aabaf8809
9 changed files with 44 additions and 37 deletions
|
@ -165,14 +165,15 @@ static void server_handle_new_output(struct wl_listener *listener, void *data) {
|
||||||
wlr_output_layout_add_auto(server->output_layout, wlr_output);
|
wlr_output_layout_add_auto(server->output_layout, wlr_output);
|
||||||
wlr_output_create_global(wlr_output);
|
wlr_output_create_global(wlr_output);
|
||||||
|
|
||||||
|
struct wlr_output_state state;
|
||||||
|
wlr_output_state_init(&state);
|
||||||
|
wlr_output_state_set_enabled(&state, true);
|
||||||
struct wlr_output_mode *mode = wlr_output_preferred_mode(wlr_output);
|
struct wlr_output_mode *mode = wlr_output_preferred_mode(wlr_output);
|
||||||
if (mode != NULL) {
|
if (mode != NULL) {
|
||||||
struct wlr_output_state state;
|
|
||||||
wlr_output_state_init(&state);
|
|
||||||
wlr_output_state_set_mode(&state, mode);
|
wlr_output_state_set_mode(&state, mode);
|
||||||
wlr_output_commit_state(wlr_output, &state);
|
|
||||||
wlr_output_state_finish(&state);
|
|
||||||
}
|
}
|
||||||
|
wlr_output_commit_state(wlr_output, &state);
|
||||||
|
wlr_output_state_finish(&state);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void server_handle_present_surface(struct wl_listener *listener,
|
static void server_handle_present_surface(struct wl_listener *listener,
|
||||||
|
|
|
@ -174,14 +174,15 @@ static void server_handle_new_output(struct wl_listener *listener, void *data) {
|
||||||
wl_signal_add(&wlr_output->events.frame, &output->frame);
|
wl_signal_add(&wlr_output->events.frame, &output->frame);
|
||||||
wl_list_insert(&server->outputs, &output->link);
|
wl_list_insert(&server->outputs, &output->link);
|
||||||
|
|
||||||
|
struct wlr_output_state state;
|
||||||
|
wlr_output_state_init(&state);
|
||||||
|
wlr_output_state_set_enabled(&state, true);
|
||||||
struct wlr_output_mode *mode = wlr_output_preferred_mode(wlr_output);
|
struct wlr_output_mode *mode = wlr_output_preferred_mode(wlr_output);
|
||||||
if (mode != NULL) {
|
if (mode != NULL) {
|
||||||
struct wlr_output_state state;
|
|
||||||
wlr_output_state_init(&state);
|
|
||||||
wlr_output_state_set_mode(&state, mode);
|
wlr_output_state_set_mode(&state, mode);
|
||||||
wlr_output_commit_state(wlr_output, &state);
|
|
||||||
wlr_output_state_finish(&state);
|
|
||||||
}
|
}
|
||||||
|
wlr_output_commit_state(wlr_output, &state);
|
||||||
|
wlr_output_state_finish(&state);
|
||||||
|
|
||||||
wlr_output_create_global(wlr_output);
|
wlr_output_create_global(wlr_output);
|
||||||
}
|
}
|
||||||
|
|
|
@ -177,14 +177,15 @@ static void new_output_notify(struct wl_listener *listener, void *data) {
|
||||||
wl_signal_add(&output->events.destroy, &sample_output->destroy);
|
wl_signal_add(&output->events.destroy, &sample_output->destroy);
|
||||||
sample_output->destroy.notify = output_remove_notify;
|
sample_output->destroy.notify = output_remove_notify;
|
||||||
|
|
||||||
|
struct wlr_output_state state;
|
||||||
|
wlr_output_state_init(&state);
|
||||||
|
wlr_output_state_set_enabled(&state, true);
|
||||||
struct wlr_output_mode *mode = wlr_output_preferred_mode(output);
|
struct wlr_output_mode *mode = wlr_output_preferred_mode(output);
|
||||||
if (mode != NULL) {
|
if (mode != NULL) {
|
||||||
struct wlr_output_state state;
|
|
||||||
wlr_output_state_init(&state);
|
|
||||||
wlr_output_state_set_mode(&state, mode);
|
wlr_output_state_set_mode(&state, mode);
|
||||||
wlr_output_commit_state(output, &state);
|
|
||||||
wlr_output_state_finish(&state);
|
|
||||||
}
|
}
|
||||||
|
wlr_output_commit_state(output, &state);
|
||||||
|
wlr_output_state_finish(&state);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void keyboard_key_notify(struct wl_listener *listener, void *data) {
|
static void keyboard_key_notify(struct wl_listener *listener, void *data) {
|
||||||
|
|
|
@ -279,14 +279,15 @@ static void new_output_notify(struct wl_listener *listener, void *data) {
|
||||||
wlr_xcursor_manager_set_cursor_image(sample->xcursor_manager, "default",
|
wlr_xcursor_manager_set_cursor_image(sample->xcursor_manager, "default",
|
||||||
sample->cursor);
|
sample->cursor);
|
||||||
|
|
||||||
|
struct wlr_output_state state;
|
||||||
|
wlr_output_state_init(&state);
|
||||||
|
wlr_output_state_set_enabled(&state, true);
|
||||||
struct wlr_output_mode *mode = wlr_output_preferred_mode(output);
|
struct wlr_output_mode *mode = wlr_output_preferred_mode(output);
|
||||||
if (mode != NULL) {
|
if (mode != NULL) {
|
||||||
struct wlr_output_state state;
|
|
||||||
wlr_output_state_init(&state);
|
|
||||||
wlr_output_state_set_mode(&state, mode);
|
wlr_output_state_set_mode(&state, mode);
|
||||||
wlr_output_commit_state(output, &state);
|
|
||||||
wlr_output_state_finish(&state);
|
|
||||||
}
|
}
|
||||||
|
wlr_output_commit_state(output, &state);
|
||||||
|
wlr_output_state_finish(&state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -123,10 +123,6 @@ static void new_output_notify(struct wl_listener *listener, void *data) {
|
||||||
sample_output->x_offs = sample_output->y_offs = 0;
|
sample_output->x_offs = sample_output->y_offs = 0;
|
||||||
sample_output->x_vel = sample_output->y_vel = 128;
|
sample_output->x_vel = sample_output->y_vel = 128;
|
||||||
|
|
||||||
struct wlr_output_state state;
|
|
||||||
wlr_output_state_init(&state);
|
|
||||||
wlr_output_state_set_transform(&state, sample->transform);
|
|
||||||
|
|
||||||
sample_output->output = output;
|
sample_output->output = output;
|
||||||
sample_output->sample = sample;
|
sample_output->sample = sample;
|
||||||
wl_signal_add(&output->events.frame, &sample_output->frame);
|
wl_signal_add(&output->events.frame, &sample_output->frame);
|
||||||
|
@ -135,11 +131,14 @@ static void new_output_notify(struct wl_listener *listener, void *data) {
|
||||||
sample_output->destroy.notify = output_remove_notify;
|
sample_output->destroy.notify = output_remove_notify;
|
||||||
wl_list_insert(&sample->outputs, &sample_output->link);
|
wl_list_insert(&sample->outputs, &sample_output->link);
|
||||||
|
|
||||||
|
struct wlr_output_state state;
|
||||||
|
wlr_output_state_init(&state);
|
||||||
|
wlr_output_state_set_transform(&state, sample->transform);
|
||||||
|
wlr_output_state_set_enabled(&state, true);
|
||||||
struct wlr_output_mode *mode = wlr_output_preferred_mode(output);
|
struct wlr_output_mode *mode = wlr_output_preferred_mode(output);
|
||||||
if (mode != NULL) {
|
if (mode != NULL) {
|
||||||
wlr_output_state_set_mode(&state, mode);
|
wlr_output_state_set_mode(&state, mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
wlr_output_commit_state(output, &state);
|
wlr_output_commit_state(output, &state);
|
||||||
wlr_output_state_finish(&state);
|
wlr_output_state_finish(&state);
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,14 +81,15 @@ static void server_handle_new_output(struct wl_listener *listener, void *data) {
|
||||||
|
|
||||||
output->scene_output = wlr_scene_output_create(server->scene, wlr_output);
|
output->scene_output = wlr_scene_output_create(server->scene, wlr_output);
|
||||||
|
|
||||||
|
struct wlr_output_state state;
|
||||||
|
wlr_output_state_init(&state);
|
||||||
|
wlr_output_state_set_enabled(&state, true);
|
||||||
struct wlr_output_mode *mode = wlr_output_preferred_mode(wlr_output);
|
struct wlr_output_mode *mode = wlr_output_preferred_mode(wlr_output);
|
||||||
if (mode != NULL) {
|
if (mode != NULL) {
|
||||||
struct wlr_output_state state;
|
|
||||||
wlr_output_state_init(&state);
|
|
||||||
wlr_output_state_set_mode(&state, mode);
|
wlr_output_state_set_mode(&state, mode);
|
||||||
wlr_output_commit_state(wlr_output, &state);
|
|
||||||
wlr_output_state_finish(&state);
|
|
||||||
}
|
}
|
||||||
|
wlr_output_commit_state(wlr_output, &state);
|
||||||
|
wlr_output_state_finish(&state);
|
||||||
|
|
||||||
wlr_output_create_global(wlr_output);
|
wlr_output_create_global(wlr_output);
|
||||||
}
|
}
|
||||||
|
|
|
@ -106,14 +106,15 @@ static void new_output_notify(struct wl_listener *listener, void *data) {
|
||||||
wl_signal_add(&output->events.destroy, &sample_output->destroy);
|
wl_signal_add(&output->events.destroy, &sample_output->destroy);
|
||||||
sample_output->destroy.notify = output_remove_notify;
|
sample_output->destroy.notify = output_remove_notify;
|
||||||
|
|
||||||
|
struct wlr_output_state state;
|
||||||
|
wlr_output_state_init(&state);
|
||||||
|
wlr_output_state_set_enabled(&state, true);
|
||||||
struct wlr_output_mode *mode = wlr_output_preferred_mode(output);
|
struct wlr_output_mode *mode = wlr_output_preferred_mode(output);
|
||||||
if (mode != NULL) {
|
if (mode != NULL) {
|
||||||
struct wlr_output_state state;
|
|
||||||
wlr_output_state_init(&state);
|
|
||||||
wlr_output_state_set_mode(&state, mode);
|
wlr_output_state_set_mode(&state, mode);
|
||||||
wlr_output_commit_state(sample_output->output, &state);
|
|
||||||
wlr_output_state_finish(&state);
|
|
||||||
}
|
}
|
||||||
|
wlr_output_commit_state(output, &state);
|
||||||
|
wlr_output_state_finish(&state);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void keyboard_key_notify(struct wl_listener *listener, void *data) {
|
static void keyboard_key_notify(struct wl_listener *listener, void *data) {
|
||||||
|
|
|
@ -278,14 +278,15 @@ static void new_output_notify(struct wl_listener *listener, void *data) {
|
||||||
wl_signal_add(&output->events.destroy, &sample_output->destroy);
|
wl_signal_add(&output->events.destroy, &sample_output->destroy);
|
||||||
sample_output->destroy.notify = output_remove_notify;
|
sample_output->destroy.notify = output_remove_notify;
|
||||||
|
|
||||||
|
struct wlr_output_state state;
|
||||||
|
wlr_output_state_init(&state);
|
||||||
|
wlr_output_state_set_enabled(&state, true);
|
||||||
struct wlr_output_mode *mode = wlr_output_preferred_mode(output);
|
struct wlr_output_mode *mode = wlr_output_preferred_mode(output);
|
||||||
if (mode != NULL) {
|
if (mode != NULL) {
|
||||||
struct wlr_output_state state;
|
|
||||||
wlr_output_state_init(&state);
|
|
||||||
wlr_output_state_set_mode(&state, mode);
|
wlr_output_state_set_mode(&state, mode);
|
||||||
wlr_output_commit_state(output, &state);
|
|
||||||
wlr_output_state_finish(&state);
|
|
||||||
}
|
}
|
||||||
|
wlr_output_commit_state(output, &state);
|
||||||
|
wlr_output_state_finish(&state);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void keyboard_key_notify(struct wl_listener *listener, void *data) {
|
static void keyboard_key_notify(struct wl_listener *listener, void *data) {
|
||||||
|
|
|
@ -183,14 +183,15 @@ static void new_output_notify(struct wl_listener *listener, void *data) {
|
||||||
wl_signal_add(&output->events.destroy, &sample_output->destroy);
|
wl_signal_add(&output->events.destroy, &sample_output->destroy);
|
||||||
sample_output->destroy.notify = output_remove_notify;
|
sample_output->destroy.notify = output_remove_notify;
|
||||||
|
|
||||||
|
struct wlr_output_state state;
|
||||||
|
wlr_output_state_init(&state);
|
||||||
|
wlr_output_state_set_enabled(&state, true);
|
||||||
struct wlr_output_mode *mode = wlr_output_preferred_mode(output);
|
struct wlr_output_mode *mode = wlr_output_preferred_mode(output);
|
||||||
if (mode != NULL) {
|
if (mode != NULL) {
|
||||||
struct wlr_output_state state;
|
|
||||||
wlr_output_state_init(&state);
|
|
||||||
wlr_output_state_set_mode(&state, mode);
|
wlr_output_state_set_mode(&state, mode);
|
||||||
wlr_output_commit_state(output, &state);
|
|
||||||
wlr_output_state_finish(&state);
|
|
||||||
}
|
}
|
||||||
|
wlr_output_commit_state(output, &state);
|
||||||
|
wlr_output_state_finish(&state);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void keyboard_key_notify(struct wl_listener *listener, void *data) {
|
static void keyboard_key_notify(struct wl_listener *listener, void *data) {
|
||||||
|
|
Loading…
Reference in a new issue