Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix apply unsensitive with only a single monitor #385

Merged
merged 1 commit into from
May 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions src/Widgets/DisplaysOverlay.vala
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,18 @@ public class Display.DisplaysOverlay : Gtk.Box {

private void check_configuration_change () {
// check if valid (connected)
int active_display_count = 0;
foreach (unowned var dw in display_widgets) {
if (dw.virtual_monitor.is_active) {
active_display_count++;
}
}

if (active_display_count == 1) { // always valid if only one display
configuration_changed (true);
return;
}

var result = true;
foreach (unowned var dw in display_widgets) {
dw.connected = false;
Expand All @@ -250,10 +262,8 @@ public class Display.DisplaysOverlay : Gtk.Box {
foreach (unowned var dw1 in display_widgets) {
foreach (unowned var dw2 in display_widgets) {
if (dw2 == dw1) {
warning ("Skip %s", dw2.display_name);
continue;
} else if (dw1.connected) {
warning ("%s already connected", dw1.display_name);
break;
}

Expand All @@ -265,7 +275,7 @@ public class Display.DisplaysOverlay : Gtk.Box {
}

foreach (unowned var dw in display_widgets) {
if (!dw.connected) {
if (!dw.connected && dw.virtual_monitor.is_active) {
result = false;
break;
}
Expand Down
Loading