monitor-manager: Only manage orientation if we have a built in panel

All the auto-rotation code is expecting to have a built-in panel, but we
still monitor accelerometer changes if we don't have one (uncommon, but
possible).

Thus manage the panel orientation in such case and update it on monitors
changes.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1233>
This commit is contained in:
Marco Trevisan (Treviño) 2021-07-30 13:47:42 +02:00 committed by Jonas Ådahl
parent f78e21c45a
commit e976137d97

View File

@ -955,7 +955,8 @@ update_panel_orientation_managed (MetaMonitorManager *manager)
panel_orientation_managed =
(clutter_seat_get_touch_mode (seat) &&
meta_orientation_manager_has_accelerometer (orientation_manager));
meta_orientation_manager_has_accelerometer (orientation_manager) &&
meta_monitor_manager_get_laptop_panel (manager));
if (manager->panel_orientation_managed == panel_orientation_managed)
return;
@ -3076,6 +3077,8 @@ rebuild_monitors (MetaMonitorManager *manager)
monitor_normal);
}
update_panel_orientation_managed (manager);
}
void