diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp index 111e4bbbe7..49eb34824b 100644 --- a/src/misc_gui.cpp +++ b/src/misc_gui.cpp @@ -601,7 +601,7 @@ struct AboutWindow : public Window { if (this->text_position < (int)(this->GetWidget(WID_A_SCROLLING_TEXT)->pos_y - lengthof(_credits) * this->line_height)) { this->text_position = this->GetWidget(WID_A_SCROLLING_TEXT)->pos_y + this->GetWidget(WID_A_SCROLLING_TEXT)->current_y; } - this->SetDirty(); + this->SetWidgetDirty(WID_A_SCROLLING_TEXT); } } }; diff --git a/src/music_gui.cpp b/src/music_gui.cpp index 28cb6ce4e1..805589f5e2 100644 --- a/src/music_gui.cpp +++ b/src/music_gui.cpp @@ -789,7 +789,7 @@ struct MusicWindow : public Window { byte &vol = (widget == WID_M_MUSIC_VOL) ? _settings_client.music.music_vol : _settings_client.music.effect_vol; if (ClickVolumeSliderWidget(this->GetWidget(widget)->GetCurrentRect(), pt, vol)) { if (widget == WID_M_MUSIC_VOL) MusicDriver::GetInstance()->SetVolume(vol); - this->SetDirty(); + this->SetWidgetDirty(widget); SetWindowClassesDirty(WC_GAME_OPTIONS); } diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index 97e602db83..eded3fb991 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -449,17 +449,18 @@ struct GameOptionsWindow : Window { ShowErrorMessage(STR_ERROR_FULLSCREEN_FAILED, INVALID_STRING_ID, WL_ERROR); } this->SetWidgetLoweredState(WID_GO_FULLSCREEN_BUTTON, _fullscreen); - this->SetDirty(); + this->SetWidgetDirty(WID_GO_FULLSCREEN_BUTTON); break; case WID_GO_VIDEO_ACCEL_BUTTON: _video_hw_accel = !_video_hw_accel; ShowErrorMessage(STR_GAME_OPTIONS_VIDEO_ACCELERATION_RESTART, INVALID_STRING_ID, WL_INFO); this->SetWidgetLoweredState(WID_GO_VIDEO_ACCEL_BUTTON, _video_hw_accel); + this->SetWidgetDirty(WID_GO_VIDEO_ACCEL_BUTTON); #ifndef __APPLE__ this->SetWidgetDisabledState(WID_GO_VIDEO_VSYNC_BUTTON, !_video_hw_accel); + this->SetWidgetDirty(WID_GO_VIDEO_VSYNC_BUTTON); #endif - this->SetDirty(); break; case WID_GO_VIDEO_VSYNC_BUTTON: @@ -469,7 +470,7 @@ struct GameOptionsWindow : Window { VideoDriver::GetInstance()->ToggleVsync(_video_vsync); this->SetWidgetLoweredState(WID_GO_VIDEO_VSYNC_BUTTON, _video_vsync); - this->SetDirty(); + this->SetWidgetDirty(WID_GO_VIDEO_VSYNC_BUTTON); break; case WID_GO_BASE_SFX_VOLUME: @@ -477,7 +478,7 @@ struct GameOptionsWindow : Window { byte &vol = (widget == WID_GO_BASE_MUSIC_VOLUME) ? _settings_client.music.music_vol : _settings_client.music.effect_vol; if (ClickVolumeSliderWidget(this->GetWidget(widget)->GetCurrentRect(), pt, vol)) { if (widget == WID_GO_BASE_MUSIC_VOLUME) MusicDriver::GetInstance()->SetVolume(vol); - this->SetDirty(); + this->SetWidgetDirty(widget); SetWindowClassesDirty(WC_MUSIC_WINDOW); } diff --git a/src/window.cpp b/src/window.cpp index 28b413eb89..4111fe6f9c 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -2470,8 +2470,8 @@ static EventState HandleActiveWidget() if (w->mouse_capture_widget >= 0) { /* Abort if no button is clicked any more. */ if (!_left_button_down) { + w->SetWidgetDirty(w->mouse_capture_widget); w->mouse_capture_widget = -1; - w->SetDirty(); return ES_HANDLED; }