Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lib/App.vala
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,13 @@ public class Gala.App : GLib.Object {
return windows.data;
}

#if VALA_0_56_17
public GLib.SList<pid_t?> get_pids () {
var results = new GLib.SList<pid_t?> ();
#else
public GLib.SList<int?> get_pids () {
var results = new GLib.SList<int?> ();
#endif
foreach (unowned var window in windows) {
var pid = window.get_pid ();
if (pid < 1) {
Expand Down
13 changes: 5 additions & 8 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,7 @@ gnome = import('gnome')
i18n = import('i18n')
pkg = import('pkgconfig')
cc = meson.get_compiler('c')

gala_version = meson.project_version()

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))
endif

vapi_dir = meson.current_source_dir() / 'vapi'

Expand All @@ -35,7 +28,7 @@ conf.set_quoted('DATADIR', data_dir)
conf.set_quoted('PKGDATADIR', pkgdata_dir)
conf.set_quoted('PLUGINDIR', plugins_dir)
conf.set_quoted('RESOURCEPATH', '/org/pantheon/desktop/gala')
conf.set_quoted('VERSION', gala_version)
conf.set_quoted('VERSION', meson.project_version())
config_h = configure_file(
output: 'config.h',
configuration: conf
Expand Down Expand Up @@ -158,6 +151,10 @@ if get_option('systemd')
vala_flags += ['--define', 'WITH_SYSTEMD']
endif

if vala.version().version_compare('>= 0.56.17')
vala_flags += ['--define', 'VALA_0_56_17']
endif

add_project_arguments(vala_flags, language: 'vala')
add_project_link_arguments(['-Wl,-rpath,@0@'.format(mutter_typelib_dir)], language: 'c')

Expand Down
4 changes: 4 additions & 0 deletions src/Gestures/ActorTarget.vala
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ public class Gala.ActorTarget : Clutter.Actor, GestureTarget {
current_commit = new double[GestureAction.N_ACTIONS];
targets = new Gee.ArrayList<GestureTarget> ();

#if HAS_MUTTER46
child_added.connect (on_child_added);
#else
actor_added.connect (on_child_added);
#endif
}

private void sync_target (GestureTarget target) {
Expand Down
4 changes: 4 additions & 0 deletions src/WindowTracker.vala
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ public class Gala.WindowTracker : GLib.Object {
return get_app_from_id (id);
}

#if VALA_0_56_17
private static unowned Gala.App? get_app_from_pid (pid_t pid) {
#else
private static unowned Gala.App? get_app_from_pid (int pid) {
#endif
var running_apps = Gala.AppSystem.get_default ().get_running_apps ();
foreach (unowned Gala.App app in running_apps) {
var app_pids = app.get_pids ();
Expand Down
4 changes: 4 additions & 0 deletions vapi/libmutter.vapi
Original file line number Diff line number Diff line change
Expand Up @@ -968,7 +968,11 @@ namespace Meta {
public Meta.MaximizeFlags get_maximized ();
public int get_monitor ();
public unowned string? get_mutter_hints ();
#if VALA_0_56_17
public pid_t get_pid ();
#else
public int get_pid ();
#endif
public unowned string get_role ();
public unowned string? get_sandboxed_app_id ();
public uint get_stable_sequence ();
Expand Down