diff --git a/README.md b/README.md index ef257c1f5..b72404854 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ You'll need the following dependencies: * libgtk-3-dev (>= 3.10.0) * libmutter-10-dev (>= 42.0) | libmutter-dev (>= 3.18.3) * libxml2-utils -* valac (>= 0.28.0) +* valac (>= 0.46.0) Run `meson build` to configure the build environment. Change to the build directory and run `ninja` to build diff --git a/data/meson.build b/data/meson.build index e958318a2..833d077b4 100644 --- a/data/meson.build +++ b/data/meson.build @@ -12,7 +12,7 @@ install_data( i18n.merge_file( input: 'gala.appdata.xml.in', output: meson.project_name() + '.appdata.xml', - po_dir: join_paths(meson.source_root(), 'po'), + po_dir: join_paths(meson.global_source_root(), 'po'), type: 'xml', install: true, install_dir: join_paths(get_option('datadir'), 'metainfo'), @@ -21,7 +21,7 @@ i18n.merge_file( i18n.merge_file( input: 'gala-multitaskingview.desktop.in', output: 'gala-multitaskingview.desktop', - po_dir: join_paths(meson.source_root (), 'po'), + po_dir: join_paths(meson.global_source_root (), 'po'), type: 'desktop', install: true, install_dir: join_paths(data_dir, 'applications') @@ -30,7 +30,7 @@ i18n.merge_file( i18n.merge_file( input: 'gala-other.desktop.in', output: 'gala-other.desktop', - po_dir: join_paths(meson.source_root (), 'po'), + po_dir: join_paths(meson.global_source_root (), 'po'), type: 'desktop', install: true, install_dir: join_paths(data_dir, 'applications') @@ -42,7 +42,7 @@ if get_option('systemd') dep_systemd = dependency('systemd', required: true) systemd_userunitdir = get_option('systemduserunitdir') if systemd_userunitdir == '' - systemd_userunitdir = dep_systemd.get_pkgconfig_variable('systemduserunitdir', define_variable: ['prefix', get_option('prefix')]) + systemd_userunitdir = dep_systemd.get_variable('systemduserunitdir', pkgconfig_define: ['prefix', get_option('prefix')]) endif bindir = join_paths(get_option('prefix'), get_option('bindir')) diff --git a/docs/meson.build b/docs/meson.build index c234b86f0..afc761375 100644 --- a/docs/meson.build +++ b/docs/meson.build @@ -23,7 +23,7 @@ basic_command = [ '--pkg', 'config', vala_flags, '--vapidir=' + join_paths(meson.build_root(), 'lib'), - '--vapidir=' + join_paths(meson.source_root(), 'vapi'), + '--vapidir=' + join_paths(meson.global_source_root(), 'vapi'), '--doclet=html', '--use-svg-images' ] diff --git a/lib/DragDropAction.vala b/lib/DragDropAction.vala index eacb2261a..9c7ac471f 100644 --- a/lib/DragDropAction.vala +++ b/lib/DragDropAction.vala @@ -366,6 +366,8 @@ namespace Gala { return true; } + break; + default: break; } diff --git a/lib/Utils.vala b/lib/Utils.vala index 8d85d07be..8dc18e10c 100644 --- a/lib/Utils.vala +++ b/lib/Utils.vala @@ -151,7 +151,7 @@ namespace Gala { // Construct a new "application-default-icon" and store it in the cache try { var icon = Gtk.IconTheme.get_default ().load_icon_for_scale ("application-default-icon", icon_size, scale, 0); - unknown_icon_cache.add (new CachedIcon () { icon = icon, icon_size = icon_size, scale = scale }); + unknown_icon_cache.add (CachedIcon () { icon = icon, icon_size = icon_size, scale = scale }); return icon; } catch (Error e) { var icon = new Gdk.Pixbuf (Gdk.Colorspace.RGB, true, 8, icon_size * scale, icon_size * scale); @@ -227,7 +227,7 @@ namespace Gala { try { var pixbuf = icon_info.load_icon (); - icon_cache.@set (desktop, new CachedIcon () { icon = pixbuf, icon_size = icon_size, scale = scale }); + icon_cache.@set (desktop, CachedIcon () { icon = pixbuf, icon_size = icon_size, scale = scale }); return pixbuf; } catch (Error e) { return null; @@ -237,7 +237,7 @@ namespace Gala { var size_with_scale = icon_size * scale; try { var pixbuf = new Gdk.Pixbuf.from_stream_at_scale (file.read (), size_with_scale, size_with_scale, true); - icon_cache.@set (desktop, new CachedIcon () { icon = pixbuf, icon_size = icon_size, scale = scale }); + icon_cache.@set (desktop, CachedIcon () { icon = pixbuf, icon_size = icon_size, scale = scale }); return pixbuf; } catch (Error e) { return null; diff --git a/lib/meson.build b/lib/meson.build index cb4051026..00d1bfe42 100644 --- a/lib/meson.build +++ b/lib/meson.build @@ -16,8 +16,8 @@ gala_lib_sources = files( gala_resources = gnome.compile_resources( 'gala-resources', - join_paths(meson.source_root(), 'data', 'gala.gresource.xml'), - source_dir: join_paths(meson.source_root(), 'data'), + join_paths(meson.global_source_root(), 'data', 'gala.gresource.xml'), + source_dir: join_paths(meson.global_source_root(), 'data'), c_name: 'gala', ) diff --git a/meson.build b/meson.build index 0e34085ae..44758be20 100644 --- a/meson.build +++ b/meson.build @@ -1,7 +1,7 @@ project('gala', 'c', 'vala', version: '7.0.0', - meson_version: '>= 0.50.0', + meson_version: '>= 0.58.0', license: 'GPL3', ) @@ -14,7 +14,7 @@ cc = meson.get_compiler('c') gala_version = meson.project_version() -vala_version_required = '0.28.0' +vala_version_required = '0.46.0' vala = meson.get_compiler('vala') if not vala.version().version_compare('>= @0@'.format(vala_version_required)) error('Valac >= @0@ required!'.format(vala_version_required)) @@ -132,7 +132,7 @@ if mutter_dep.length() == 0 error ('No supported mutter library found!') endif -mutter_typelib_dir = libmutter_dep.get_pkgconfig_variable('typelibdir') +mutter_typelib_dir = libmutter_dep.get_variable('typelibdir') if get_option('systemd') vala_flags += ['--define', 'WITH_SYSTEMD'] diff --git a/src/AccentColor/AccentColorManager.vala b/src/AccentColor/AccentColorManager.vala index a89a91474..f6b04c8ce 100644 --- a/src/AccentColor/AccentColorManager.vala +++ b/src/AccentColor/AccentColorManager.vala @@ -146,12 +146,12 @@ public class Gala.AccentColorManager : Object { path = Filename.from_uri (picture_uri); metadata = new GExiv2.Metadata (); metadata.open_path (path); + + return metadata.try_get_tag_string (TAG_ACCENT_COLOR); } catch (Error e) { warning ("Error parsing exif metadata of \"%s\": %s", path, e.message); return null; } - - return metadata.get_tag_string (TAG_ACCENT_COLOR); } private NamedColor? get_accent_color (ColorExtractor color_extractor) { diff --git a/src/Main.vala b/src/Main.vala index 65f70ba89..2bb7070bb 100644 --- a/src/Main.vala +++ b/src/Main.vala @@ -50,15 +50,15 @@ namespace Gala { act.sa_mask = empty_mask; act.sa_flags = 0; - if (Posix.sigaction (Posix.SIGPIPE, act, null) < 0) { + if (Posix.sigaction (Posix.Signal.PIPE, act, null) < 0) { warning ("Failed to register SIGPIPE handler: %s", GLib.strerror (GLib.errno)); } - if (Posix.sigaction (Posix.SIGXFSZ, act, null) < 0) { + if (Posix.sigaction (Posix.Signal.XFSZ, act, null) < 0) { warning ("Failed to register SIGXFSZ handler: %s", GLib.strerror (GLib.errno)); } - GLib.Unix.signal_add (Posix.SIGTERM, () => { + GLib.Unix.signal_add (Posix.Signal.TERM, () => { ctx.terminate (); return GLib.Source.REMOVE; }); diff --git a/src/PluginManager.vala b/src/PluginManager.vala index 6fdc7b9fb..0a6e9a04a 100644 --- a/src/PluginManager.vala +++ b/src/PluginManager.vala @@ -86,7 +86,7 @@ namespace Gala { private bool load_module (string plugin_name) { var path = Module.build_path (plugin_dir.get_path (), plugin_name); - var module = Module.open (path, ModuleFlags.BIND_LOCAL); + var module = Module.open (path, ModuleFlags.LOCAL); if (module == null) { warning (Module.error ()); return false; @@ -170,6 +170,8 @@ namespace Gala { } window_switcher_provider = name; return true; + default: + break; } return true; diff --git a/src/ScreenshotManager.vala b/src/ScreenshotManager.vala index 3233ea50d..61593f0b9 100644 --- a/src/ScreenshotManager.vala +++ b/src/ScreenshotManager.vala @@ -353,24 +353,28 @@ namespace Gala { paint_flags |= Clutter.PaintFlag.FORCE_CURSORS; } - if (GLib.ByteOrder.HOST == GLib.ByteOrder.LITTLE_ENDIAN) { - wm.stage.paint_to_buffer ( - {x, y, width, height}, - scale, - image.get_data (), - image.get_stride (), - Cogl.PixelFormat.BGRA_8888_PRE, - paint_flags - ); - } else { - wm.stage.paint_to_buffer ( - {x, y, width, height}, - scale, - image.get_data (), - image.get_stride (), - Cogl.PixelFormat.ARGB_8888_PRE, - paint_flags - ); + try { + if (GLib.ByteOrder.HOST == GLib.ByteOrder.LITTLE_ENDIAN) { + wm.stage.paint_to_buffer ( + {x, y, width, height}, + scale, + image.get_data (), + image.get_stride (), + Cogl.PixelFormat.BGRA_8888_PRE, + paint_flags + ); + } else { + wm.stage.paint_to_buffer ( + {x, y, width, height}, + scale, + image.get_data (), + image.get_stride (), + Cogl.PixelFormat.ARGB_8888_PRE, + paint_flags + ); + } + } catch (Error e) { + warning (e.message); } return image; } diff --git a/src/Widgets/WindowCloneContainer.vala b/src/Widgets/WindowCloneContainer.vala index d5b8a4946..16d624a60 100644 --- a/src/Widgets/WindowCloneContainer.vala +++ b/src/Widgets/WindowCloneContainer.vala @@ -277,6 +277,8 @@ namespace Gala { closest = (WindowClone) window; } break; + default: + break; } } diff --git a/src/Widgets/WindowSwitcher.vala b/src/Widgets/WindowSwitcher.vala index 65914055b..d2b093d5c 100644 --- a/src/Widgets/WindowSwitcher.vala +++ b/src/Widgets/WindowSwitcher.vala @@ -128,7 +128,7 @@ namespace Gala { container.motion_event.connect (container_motion_event); var rgba = InternalUtils.get_theme_accent_color (); - var accent_color = new Clutter.Color (); + var accent_color = Clutter.Color (); accent_color.init ( (uint8) (rgba.red * 255), (uint8) (rgba.green * 255), diff --git a/src/WindowTracker.vala b/src/WindowTracker.vala index afe6f2a6e..503a81ee4 100644 --- a/src/WindowTracker.vala +++ b/src/WindowTracker.vala @@ -5,7 +5,6 @@ */ public class Gala.WindowTracker : GLib.Object { - private Gala.App? focused_app = null; private GLib.HashTable window_to_app; public signal void windows_changed ();