Work around failure to open maximised on Ubuntu 24.04 (#3010).
authorCarl Hetherington <cth@carlh.net>
Mon, 7 Apr 2025 10:53:32 +0000 (12:53 +0200)
committerCarl Hetherington <cth@carlh.net>
Mon, 7 Apr 2025 10:53:32 +0000 (12:53 +0200)
cscript
src/tools/dcpomatic.cc
wscript

diff --git a/cscript b/cscript
index d913bb3dc1641e7d0e9eaaf87190de388481ab03..0b63394bcfcedad820bf9b8fd8d670f5a15d2888 100644 (file)
--- a/cscript
+++ b/cscript
@@ -504,7 +504,7 @@ def configure_options(target, options, for_package=False):
         opt += ' --wx-config=%s/wx-config' % target.bin
 
     if target.platform == 'linux' and target.distro == 'ubuntu' and target.version == '24.04':
-        opt += ' --enable-grok'
+        opt += ' --enable-grok --workaround-mutter'
 
     if build_with_cpp17(target):
         opt += ' --c++17'
index c603b9bfefa1c61ae54bbaf9e138917f586dbc58..78fce27f224e0e8f36c714d7df0ea7c0f7c2b1a3 100644 (file)
@@ -538,6 +538,9 @@ private:
                if (ev.IsShown() && !_first_shown_called) {
                        _film_editor->first_shown ();
                        _first_shown_called = true;
+#ifdef DCPOMATIC_WORKAROUND_MUTTER
+                       signal_manager->when_idle([this]() { Maximize(); });
+#endif
                }
        }
 
diff --git a/wscript b/wscript
index f50228ecf1e851d4f41ff45a3ff1198a43f1680a..97bd54a3efa1e2cebf29b97efb32758a7268877e 100644 (file)
--- a/wscript
+++ b/wscript
@@ -71,6 +71,7 @@ def options(opt):
     opt.add_option('--static-sub',        action='store_true', default=False, help='link statically to libsub')
     opt.add_option('--static-curl',       action='store_true', default=False, help='link statically to libcurl')
     opt.add_option('--workaround-gssapi', action='store_true', default=False, help='link to gssapi_krb5')
+    opt.add_option('--workaround-mutter', action='store_true', default=False, help='work around window maximising bug on (e.g.) Ubuntu 24.04')
     opt.add_option('--use-lld',           action='store_true', default=False, help='use lld linker')
     opt.add_option('--enable-disk',       action='store_true', default=False, help='build dcpomatic2_disk tool; requires Boost process, lwext4 and nanomsg libraries')
     opt.add_option('--enable-grok',       action='store_true', default=False, help='build with support for grok J2K encoder')
@@ -148,6 +149,9 @@ def configure(conf):
     if conf.options.warnings_are_errors:
         conf.env.append_value('CXXFLAGS', '-Werror')
 
+    if conf.options.workaround_mutter:
+        conf.env.append_value('CXXFLAGS', '-DDCPOMATIC_WORKAROUND_MUTTER')
+
     if conf.env.SSE:
         conf.env.append_value('CXXFLAGS', ['-msse', '-mfpmath=sse'])