mirror of
https://github.com/elementary/gala.git
synced 2024-10-03 18:27:12 +03:00
Manually set ui_group size (#1953)
Co-authored-by: Leonhard <106322251+leolost2605@users.noreply.github.com> Co-authored-by: Leonhard Kargl <leo.kargl@proton.me>
This commit is contained in:
parent
b5b297e6b4
commit
9205df5bb2
@ -217,6 +217,7 @@ namespace Gala {
|
||||
|
||||
ui_group = new Clutter.Actor ();
|
||||
ui_group.reactive = true;
|
||||
update_ui_group_size ();
|
||||
stage.add_child (ui_group);
|
||||
|
||||
window_group = display.get_window_group ();
|
||||
@ -380,6 +381,25 @@ namespace Gala {
|
||||
return false;
|
||||
}
|
||||
|
||||
private void update_ui_group_size () {
|
||||
unowned var display = get_display ();
|
||||
|
||||
int max_width = 0;
|
||||
int max_height = 0;
|
||||
|
||||
var num_monitors = display.get_n_monitors ();
|
||||
for (int i = 0; i < num_monitors; i++) {
|
||||
var geom = display.get_monitor_geometry (i);
|
||||
var total_width = geom.x + geom.width;
|
||||
var total_height = geom.y + geom.height;
|
||||
|
||||
max_width = (max_width > total_width) ? max_width : total_width;
|
||||
max_height = (max_height > total_height) ? max_height : total_height;
|
||||
}
|
||||
|
||||
ui_group.set_size (max_width, max_height);
|
||||
}
|
||||
|
||||
private void launch_action (string action_key) {
|
||||
try {
|
||||
var action = behavior_settings.get_string (action_key);
|
||||
@ -390,6 +410,7 @@ namespace Gala {
|
||||
}
|
||||
|
||||
private void on_monitors_changed () {
|
||||
update_ui_group_size ();
|
||||
screen_shield.expand_to_screen_size ();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user