glib 2.70 broke GApplication
After upgrade of GLib from 2.68.3 to 2.70.0 the second instance of the app fails on g_application_get_is_remote
Here's minimal example:
#! /usr/bin/perl
use utf8;
use strict;
use warnings;
use diagnostics;
use 5.10.1;
use Carp::Always;
BEGIN {
use Glib::Object::Introspection;
Glib::Object::Introspection->setup(
basename => 'Gio',
version => '2.0',
package => 'Glib::IO',
);
}
use Glib qw/TRUE FALSE/;
use Gtk3 '-init';
package Test::App;
use Glib::Object::Subclass qw/Gtk3::Application/;
sub STARTUP {
my ($app) = @_;
$app->SUPER::STARTUP();
my $window = Gtk3::ApplicationWindow->new($app);
my $action = Glib::IO::SimpleAction->new('select', 's');
$app->add_action($action);
$action->signal_connect('activate'=>sub {
my $arg = $_[1]->get_string;
say "GOT $arg"
});
say "STARTUP"
}
sub ACTIVATE {
say "ACT"
}
package main;
my $app = Test::App->new(
application_id=>'org.shutter-project.Test',
flags=>['flags-none']);
say "RUN";
$app->run;
say "RAN";
if ($app->get_is_remote) {
say "SEND";
$app->activate_action('select', Glib::Variant->new(''));
}
say "END"
The first instance starts, then when trying to run the second instance, which is supposed to send a message to the first one, it shows instead:
RUN
RAN
(test.pl:27813): GLib-GIO-CRITICAL **: 23:26:25.490: g_application_get_is_remote: assertion 'application->priv->is_registered' failed
END
Interesting enough, the first instance still receives the ACTIVATE
signal.