mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-10-31 22:25:21 -04:00
Merge pull request #1095 from agx/output-add-mode
Allow to add additional modes to outputs
This commit is contained in:
commit
be54278207
6 changed files with 117 additions and 1 deletions
|
|
@ -16,6 +16,7 @@
|
|||
#include "rootston/layers.h"
|
||||
#include "rootston/output.h"
|
||||
#include "rootston/server.h"
|
||||
#include "backend/drm/drm.h"
|
||||
|
||||
/**
|
||||
* Rotate a child's position relative to a parent. The parent size is (pw, ph),
|
||||
|
|
@ -821,7 +822,7 @@ void handle_new_output(struct wl_listener *listener, void *data) {
|
|||
wlr_output->model, wlr_output->serial, wlr_output->phys_width,
|
||||
wlr_output->phys_height);
|
||||
|
||||
if (wl_list_length(&wlr_output->modes) > 0) {
|
||||
if (!wl_list_empty(&wlr_output->modes)) {
|
||||
struct wlr_output_mode *mode =
|
||||
wl_container_of((&wlr_output->modes)->prev, mode, link);
|
||||
wlr_output_set_mode(wlr_output, mode);
|
||||
|
|
@ -857,6 +858,17 @@ void handle_new_output(struct wl_listener *listener, void *data) {
|
|||
roots_config_get_output(config, wlr_output);
|
||||
if (output_config) {
|
||||
if (output_config->enable) {
|
||||
struct roots_output_mode_config *mode_config;
|
||||
|
||||
if (wlr_output_is_drm(wlr_output)) {
|
||||
wl_list_for_each(mode_config, &output_config->modes, link) {
|
||||
wlr_drm_connector_add_mode(wlr_output, &mode_config->info);
|
||||
}
|
||||
} else {
|
||||
if (!wl_list_empty(&output_config->modes)) {
|
||||
wlr_log(L_ERROR, "Can only add modes for DRM backend");
|
||||
}
|
||||
}
|
||||
if (output_config->mode.width) {
|
||||
set_mode(wlr_output, output_config);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue