monitor-manager: Clean up DPMS state tracking
DPMS is configured from a bit all over the place: via D-Bus, via X11 and when reading the current KMS state. Each of these places did it slightly differently, directly poking at the field in MetaMonitorManager. To make things a bit more managable, move the field into a new MetaMonitorManagerPrivate, and add helpers to get and set the current value. Prior to this, there were for example situations where the DPMS setting was changed, but without signal listeners being notified about it. https://gitlab.gnome.org/GNOME/mutter/merge_requests/506
This commit is contained in:
@ -116,8 +116,6 @@ struct _MetaMonitorManager
|
||||
gboolean in_init;
|
||||
unsigned int serial;
|
||||
|
||||
MetaPowerSave power_save_mode;
|
||||
|
||||
MetaLogicalMonitorLayoutMode layout_mode;
|
||||
|
||||
int screen_width;
|
||||
@ -192,6 +190,8 @@ struct _MetaMonitorManagerClass
|
||||
GBytes* (*read_edid) (MetaMonitorManager *,
|
||||
MetaOutput *);
|
||||
|
||||
void (*read_current_state) (MetaMonitorManager *);
|
||||
|
||||
void (*ensure_initial_config) (MetaMonitorManager *);
|
||||
|
||||
gboolean (*apply_monitors_config) (MetaMonitorManager *,
|
||||
@ -305,6 +305,11 @@ void meta_monitor_manager_get_screen_size (MetaMonitorManager *
|
||||
int *width,
|
||||
int *height);
|
||||
|
||||
MetaPowerSave meta_monitor_manager_get_power_save_mode (MetaMonitorManager *manager);
|
||||
|
||||
void meta_monitor_manager_power_save_mode_changed (MetaMonitorManager *manager,
|
||||
MetaPowerSave mode);
|
||||
|
||||
void meta_monitor_manager_confirm_configuration (MetaMonitorManager *manager,
|
||||
gboolean ok);
|
||||
|
||||
|
Reference in New Issue
Block a user