mirror of
https://github.com/brl/mutter.git
synced 2024-11-26 01:50:42 -05:00
monitor-manager: Put the common hotplug code in a common path as well
So we can reuse it in the KMS backend.
This commit is contained in:
parent
989bb6ebb1
commit
cc8462969d
@ -1178,3 +1178,23 @@ meta_monitor_manager_rebuild_derived (MetaMonitorManager *manager)
|
|||||||
|
|
||||||
g_free (old_monitor_infos);
|
g_free (old_monitor_infos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
meta_monitor_manager_on_hotplug (MetaMonitorManager *manager)
|
||||||
|
{
|
||||||
|
gboolean applied_config = FALSE;
|
||||||
|
|
||||||
|
/* If the monitor has hotplug_mode_update (which is used by VMs), don't bother
|
||||||
|
* applying our stored configuration, because it's likely the user just resizing
|
||||||
|
* the window.
|
||||||
|
*/
|
||||||
|
if (!meta_monitor_manager_has_hotplug_mode_update (manager))
|
||||||
|
{
|
||||||
|
if (meta_monitor_config_apply_stored (manager->config, manager))
|
||||||
|
applied_config = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* If we haven't applied any configuration, apply the default configuration. */
|
||||||
|
if (!applied_config)
|
||||||
|
meta_monitor_config_make_default (manager->config, manager);
|
||||||
|
}
|
||||||
|
@ -341,6 +341,7 @@ void meta_output_info_free (MetaOutputInfo *info);
|
|||||||
|
|
||||||
gboolean meta_monitor_manager_has_hotplug_mode_update (MetaMonitorManager *manager);
|
gboolean meta_monitor_manager_has_hotplug_mode_update (MetaMonitorManager *manager);
|
||||||
void meta_monitor_manager_read_current_config (MetaMonitorManager *manager);
|
void meta_monitor_manager_read_current_config (MetaMonitorManager *manager);
|
||||||
|
void meta_monitor_manager_on_hotplug (MetaMonitorManager *manager);
|
||||||
|
|
||||||
/* Returns true if transform causes width and height to be inverted
|
/* Returns true if transform causes width and height to be inverted
|
||||||
This is true for the odd transforms in the enum */
|
This is true for the odd transforms in the enum */
|
||||||
|
@ -1061,7 +1061,6 @@ meta_monitor_manager_xrandr_handle_xevent (MetaMonitorManagerXrandr *manager_xra
|
|||||||
{
|
{
|
||||||
MetaMonitorManager *manager = META_MONITOR_MANAGER (manager_xrandr);
|
MetaMonitorManager *manager = META_MONITOR_MANAGER (manager_xrandr);
|
||||||
gboolean new_config;
|
gboolean new_config;
|
||||||
gboolean applied_config = FALSE;
|
|
||||||
|
|
||||||
if ((event->type - manager_xrandr->rr_event_base) != RRScreenChangeNotify)
|
if ((event->type - manager_xrandr->rr_event_base) != RRScreenChangeNotify)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -1085,19 +1084,8 @@ meta_monitor_manager_xrandr_handle_xevent (MetaMonitorManagerXrandr *manager_xra
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If the monitor has hotplug_mode_update (which is used by VMs), don't bother
|
/* Otherwise, this event was gotten from hotplug, so try to make
|
||||||
* applying our stored configuration, because it's likely the user just resizing
|
* a configuration for our new set of outputs. */
|
||||||
* the window.
|
meta_monitor_manager_on_hotplug (manager);
|
||||||
*/
|
|
||||||
if (!meta_monitor_manager_has_hotplug_mode_update (manager))
|
|
||||||
{
|
|
||||||
if (meta_monitor_config_apply_stored (manager->config, manager))
|
|
||||||
applied_config = TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* If we haven't applied any configuration, apply the default configuration. */
|
|
||||||
if (!applied_config)
|
|
||||||
meta_monitor_config_make_default (manager->config, manager);
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user