13
0

provide control over use-cocoa-invalidation

This commit is contained in:
Paul Davis 2024-03-22 13:12:50 -06:00
parent 6c38e0a4e3
commit d57ce0eba1
4 changed files with 28 additions and 0 deletions

View File

@ -50,6 +50,10 @@
#include "pbd/i18n.h" #include "pbd/i18n.h"
#ifdef __APPLE__
extern void use_cocoa_invalidation (int); // cocoacarbon.mm
#endif
using namespace Gtk; using namespace Gtk;
using namespace Gtkmm2ext; using namespace Gtkmm2ext;
using namespace ARDOUR; using namespace ARDOUR;
@ -501,6 +505,10 @@ ARDOUR_UI::parameter_changed (std::string p)
} else if (p == "no-strobe") { } else if (p == "no-strobe") {
stop_clocking (); stop_clocking ();
start_clocking (); start_clocking ();
} else if (p == "use-cocoa-invalidation") {
#ifdef __APPLE__
use_cocoa_invalidation (UIConfiguration::instance().get_use_cocoa_invalidation());
#endif
} }
} }

View File

@ -201,3 +201,10 @@ query_darwin_version ()
} }
return -1; return -1;
} }
void
use_cocoa_invalidation (int yn)
{
gdk_quartz_set_use_cocoa_invalidation (yn);
std::cerr << "cocoa invalidation: " << yn << std::endl;
}

View File

@ -3096,6 +3096,18 @@ These settings will only take effect after %1 is restarted.\n\
add_option (_("Appearance/Quirks"), bo); add_option (_("Appearance/Quirks"), bo);
#endif #endif
#ifdef __APPLE__
BoolOption* bco = new BoolOption (
"use-cocoa-invalidation",
_("Use macOS to determine GUI redraw areas"),
sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_use_cocoa_invalidation),
sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_use_cocoa_invalidation)
);
Gtkmm2ext::UI::instance()->set_tip (bco->tip_widget(), string_compose (_("When enabled, macOS is in charge of what areas of the GUI are redrawn.\nWhen disabled, %1 manages this by itself"), PROGRAM_NAME));
add_option (_("Appearance/Quirks"), bco);
#endif
add_option (_("Appearance/Quirks"), new OptionEditorBlank ()); add_option (_("Appearance/Quirks"), new OptionEditorBlank ());
#if (!defined USE_CAIRO_IMAGE_SURFACE || defined CAIRO_SUPPORTS_FORCE_BUGGY_GRADIENTS_ENVIRONMENT_VARIABLE || defined __APPLE__) #if (!defined USE_CAIRO_IMAGE_SURFACE || defined CAIRO_SUPPORTS_FORCE_BUGGY_GRADIENTS_ENVIRONMENT_VARIABLE || defined __APPLE__)
add_option (_("Appearance"), new OptionEditorHeading (_("Graphics Acceleration"))); add_option (_("Appearance"), new OptionEditorHeading (_("Graphics Acceleration")));

View File

@ -157,6 +157,7 @@ UI_CONFIG_VARIABLE (int, max_note_height, "max-note-height", 20)
UI_CONFIG_VARIABLE (bool, prefer_tap_tempo, "prefer-tap-tempo", false) UI_CONFIG_VARIABLE (bool, prefer_tap_tempo, "prefer-tap-tempo", false)
UI_CONFIG_VARIABLE (bool, sandbox_all_lua_scripts, "sandbox-all-lua-scripts", false) UI_CONFIG_VARIABLE (bool, sandbox_all_lua_scripts, "sandbox-all-lua-scripts", false)
UI_CONFIG_VARIABLE (bool, update_action_scripts, "update-action-scripts", true) UI_CONFIG_VARIABLE (bool, update_action_scripts, "update-action-scripts", true)
UI_CONFIG_VARIABLE (bool, use_cocoa_invalidation, "use-cocoa-invalidation", false)
/* these are visibility-type selections in the New Track dialog that we should make persistent for the user's choices */ /* these are visibility-type selections in the New Track dialog that we should make persistent for the user's choices */
UI_CONFIG_VARIABLE (bool, show_on_cue_page, "show-on-cue-page", true) UI_CONFIG_VARIABLE (bool, show_on_cue_page, "show-on-cue-page", true)