Ticket #4231: 0001-Fix-4231.2.patch

File 0001-Fix-4231.2.patch, 1.5 KB (added by Janus, 9 years ago)
  • src/preferences/screen/ScreenWindow.cpp

    From 5204eb7828152cda3867f556e9e2b52ee1614abd Mon Sep 17 00:00:00 2001
    From: Janus <janus2@ymail.com>
    Date: Mon, 19 Jan 2015 10:07:46 +0000
    Subject: [PATCH] Fix #4231
    
    ---
     src/preferences/screen/ScreenWindow.cpp | 23 ++++++++++++++++++++---
     1 file changed, 20 insertions(+), 3 deletions(-)
    
    diff --git a/src/preferences/screen/ScreenWindow.cpp b/src/preferences/screen/ScreenWindow.cpp
    index 511ed9a..c3bfb28 100644
    a b ScreenWindow::_BuildSupportedColorSpaces()  
    12151215void
    12161216ScreenWindow::_CheckApplyEnabled()
    12171217{
    1218     fApplyButton->SetEnabled(fSelected != fActive
    1219         || fAllWorkspacesItem->IsMarked());
     1218    bool applyEnabled = true;
     1219   
     1220    if (fSelected == fActive) {
     1221        applyEnabled = false;
     1222        if (fAllWorkspacesItem->IsMarked()) {
     1223            screen_mode screenMode;
     1224            const int32 workspaceCount = count_workspaces();
     1225            for (int32 i = 0; i < workspaceCount; i++) {
     1226                fScreenMode.Get(screenMode, i);
     1227                if (screenMode != fSelected) {
     1228                    applyEnabled = true;
     1229                    break;
     1230                }
     1231            }
     1232        }
     1233    }
     1234   
     1235    fApplyButton->SetEnabled(applyEnabled);
    12201236
    12211237    uint32 columns;
    12221238    uint32 rows;
    ScreenWindow::_Apply()  
    13371353
    13381354        if (fAllWorkspacesItem->IsMarked()) {
    13391355            int32 originatingWorkspace = current_workspace();
    1340             for (int32 i = 0; i < count_workspaces(); i++) {
     1356            const int32 workspaceCount = count_workspaces();
     1357            for (int32 i = 0; i < workspaceCount; i++) {
    13411358                if (i != originatingWorkspace)
    13421359                    screen.SetMode(i, &newMode, true);
    13431360            }