Gala: Compliing with mutter less than 3.36 is broken

Created on 4 Sep 2020  路  3Comments  路  Source: elementary/gala

Describe the bug

I get the following four errors

../src/Widgets/DwellClickTimer.vala:28.17-28.29: error: The type name `Cogl.Pipeline' could not be found
        private Cogl.Pipeline pipeline;
                ^^^^^^^^^^^^^
../src/Widgets/DwellClickTimer.vala:96.37-96.56: error: The type name `Clutter.PaintContext' could not be found
        public override void paint (Clutter.PaintContext context) {
                                    ^^^^^^^^^^^^^^^^^^^^
../src/Widgets/PointerLocator.vala:35.17-35.29: error: The type name `Cogl.Pipeline' could not be found
        private Cogl.Pipeline pipeline;
                ^^^^^^^^^^^^^
../src/Widgets/PointerLocator.vala:70.37-70.56: error: The type name `Clutter.PaintContext' could not be found
        public override void paint (Clutter.PaintContext context) {

these are all related to https://github.com/elementary/gala/pull/905 https://github.com/elementary/gala/pull/904 which add features that were removed in mutter 3.36 into gala.

While how they're accessed in conditionally compiled, for example

#if HAS_MUTTER336
        public PointerLocator pointer_locator { get; private set; }
#endif

it still tries to compile the sources src/Widgets/DwellClickTimer.vala and src/Widgets/PointerLocator.vala.

We could either handle this with meson, which I think might be the goal in the future so you can just use less conditional compilation, or the aforementioned.

To Reproduce

Steps to reproduce the behavior:

  1. Have a build environment for gala that has mutter less than 3.36
  2. See it fail

Most helpful comment

Sorry for the really slow response!

Yes, a PR for some conditional compilation of those files in meson would be fine since we only want those features compiled into 3.36 or later.

I didn't write Vala conditionals into the code to make it compatible with older versions mostly out of laziness knowing that we wouldn't be using those features in older mutter. But, it was an oversight on my part forgetting that they would still be compiled.

Thanks for the report

All 3 comments

Can confirm that this error also occurs on fedora 31. Example build log.

@davidmhewitt any ideas as what the best solution here would be (out of what I suggested)?
I'd be happy to PR some conditional compilation.

Sorry for the really slow response!

Yes, a PR for some conditional compilation of those files in meson would be fine since we only want those features compiled into 3.36 or later.

I didn't write Vala conditionals into the code to make it compatible with older versions mostly out of laziness knowing that we wouldn't be using those features in older mutter. But, it was an oversight on my part forgetting that they would still be compiled.

Thanks for the report

Was this page helpful?
0 / 5 - 0 ratings

Related issues

megatux picture megatux  路  4Comments

brigazvi picture brigazvi  路  3Comments

waldyrious picture waldyrious  路  4Comments

hanaral picture hanaral  路  3Comments

peteruithoven picture peteruithoven  路  3Comments