From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id cHUBGYmktF/YOwAA0tVLHw (envelope-from ) for ; Wed, 18 Nov 2020 04:35:21 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id GNCyFImktF/UBAAAB5/wlQ (envelope-from ) for ; Wed, 18 Nov 2020 04:35:21 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id C77D9940105 for ; Wed, 18 Nov 2020 04:35:20 +0000 (UTC) Received: from localhost ([::1]:54312 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kfFBe-0005Zf-W2 for larch@yhetil.org; Tue, 17 Nov 2020 23:35:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49880) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kfFBO-0005ZG-S7 for bug-guix@gnu.org; Tue, 17 Nov 2020 23:35:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:50400) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kfFBO-0003kO-IK for bug-guix@gnu.org; Tue, 17 Nov 2020 23:35:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kfFBO-0006tK-Ei for bug-guix@gnu.org; Tue, 17 Nov 2020 23:35:02 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#36376: Application menu of desktop environment not automatically updated Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Wed, 18 Nov 2020 04:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36376 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 36376-submit@debbugs.gnu.org id=B36376.160567409226452 (code B ref 36376); Wed, 18 Nov 2020 04:35:02 +0000 Received: (at 36376) by debbugs.gnu.org; 18 Nov 2020 04:34:52 +0000 Received: from localhost ([127.0.0.1]:33710 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kfFBE-0006sa-EY for submit@debbugs.gnu.org; Tue, 17 Nov 2020 23:34:52 -0500 Received: from mail-qt1-f176.google.com ([209.85.160.176]:39618) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kfFBC-0006sI-Qo; Tue, 17 Nov 2020 23:34:51 -0500 Received: by mail-qt1-f176.google.com with SMTP id b16so761682qtb.6; Tue, 17 Nov 2020 20:34:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=Bd9oIEjSyZuk6aWNKTNmB+GXKPMIrMh25apWZUMsk30=; b=oFgZxTYDU7qGHgYnLcWtJAw/du+wBKrj62NkvMosYerZq6bwYhrokL1C6p56zktYFz WGqaOCfkONQKbXHeqIQDWPMwJrm8E3dre8qKK51iYNT+2vASC28KjBVPedUpTHLw7y4G LjhwYNx8fwWY137SEEVDXV2HUy2MfE3z4tbisVvLc7x+w5oj+U2GWZkycpnlSei78slK i0EuwzFTSRyHi5p+zEGr5FWr47rjkHHbWaWi2GFLqxWtTZ61lS7lIKAsUl2Vs3KPtt8w 74IbjQDajOr3IifH3kIvGPeXImLs8PsUgYSufg6KYWhHQJeepOhwKUVvD5XxULoetM/e qfJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=Bd9oIEjSyZuk6aWNKTNmB+GXKPMIrMh25apWZUMsk30=; b=J9qXW7ZQJD/BXxfxfF+yCyq3/zRQf4ZJjSsiPVoiPGG1AR3I2dTdUIG0+u5gnbmDxj 8JFL93Rs/3z3B4zEQx5ZSXXGyDjULPVibJNjgXtZ5gF6xXowR9uJ9AmXBTJQ2wbc7eBC Jbok0bdr2iUz/pdGZiItZuZDNK7mcPlvMn4KfBO6LlKALfSevco3CK/MBtYbEyI73ULX qVPEQa5B2PIhnm+dxxP8+kjbadw2xGx1cSean6DESGN2eQB5MnxgAJ9B+8oQjuq3Ujme HZnLjrJB29zl14LHXEYvpRiIYUe0bO7CYRD4QOYId9ICtq4WMistPE40u1pr1sCAKv6T 64wg== X-Gm-Message-State: AOAM5308Afs0dCWicoVhgSJY4Ktx0SYNW7eUBr55hZ+BYsfJWvBvYBeX 5Xhdpcl1/4T/Ol4xTjJm4aMwVJ1gElIaJw== X-Google-Smtp-Source: ABdhPJxYpy/zWreOpA2IGi9YisQ4UgjTOSA2BMhUtUp/o5kk7X8gZ0jcZaeHwzHFMuXAjr3LeDKeJQ== X-Received: by 2002:ac8:7b30:: with SMTP id l16mr2668636qtu.360.1605674084874; Tue, 17 Nov 2020 20:34:44 -0800 (PST) Received: from hurd (dsl-205-236-230-198.b2b2c.ca. [205.236.230.198]) by smtp.gmail.com with ESMTPSA id 137sm15908441qkj.109.2020.11.17.20.34.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Nov 2020 20:34:44 -0800 (PST) From: Maxim Cournoyer References: <871rzhn483.fsf@gnu.org> <87o8keawju.fsf@gnu.org> <87d00swboe.fsf@gmail.com> <878sbexylp.fsf@gnu.org> <87r1p6tiut.fsf@gmail.com> <87lff9nsl0.fsf@gnu.org> <87d00iin6w.fsf@gnu.org> <875z64d1hr.fsf@gmail.com> <87eekstkny.fsf@gnu.org> Date: Tue, 17 Nov 2020 23:34:42 -0500 In-Reply-To: <87eekstkny.fsf@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Tue, 17 Nov 2020 10:08:49 +0100") Message-ID: <87d00b8eql.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -1.0 (-) X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Leo Prikler , 35594@debbugs.gnu.org, 36376@debbugs.gnu.org Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Scanner: ns3122888.ip-94-23-21.eu Authentication-Results: aspmx1.migadu.com; dkim=fail (headers rsa verify failed) header.d=gmail.com header.s=20161025 header.b=oFgZxTYD; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Spam-Score: 0.09 X-TUID: 7c2S8ik/flXZ Hello Ludovic! Ludovic Court=C3=A8s writes: > Hi Maxim, > > Maxim Cournoyer skribis: > >> Ludovic Court=C3=A8s writes: [...] >>> +@@ -249,11 +258,11 @@ desktop_file_dir_changed (GFileMonitor *mon= itor, >>> + * >>> + * If this is a notification for a parent directory (because the >>> + * desktop directory didn't exist) then we shouldn't fire the signal >>> +- * unless something actually changed. >>> ++ * unless something actually changed or it's in /var/guix/profiles. >>> + */ >>> + g_mutex_lock (&desktop_file_dir_lock); >>> + >>> +- if (dir->alternatively_watching) >>> ++ if (dir->alternatively_watching && dir->guix_profile_watch_dir =3D= =3D NULL) >> ^^^^^^ >> Why is this needed/desirable? > > As the comment above states it, the =E2=80=98if=E2=80=99 is here so that = the =E2=80=9Cchanged=E2=80=9D > signal is not fired when we=E2=80=99re just watching a parent directory. > > However, in our case, =E2=80=98dir->alternatively_watching !=3D NULL=E2= =80=99 possibly > means that we=E2=80=99re watching a Guix profile, in which case we do wan= t to > fire the =E2=80=9Cchanged=E2=80=9D signal. > > This =E2=80=9C&&=E2=80=9D allows us to disambiguate between =E2=80=9Cwatc= hing a parent > directory=E2=80=9D and =E2=80=9Cwatching a Guix profile=E2=80=9D. Yes, this makes sense. I got confused by the wording of the (existing) comment that mentions "unless something actually changed". I used to think this meant the contents of whatever directory is being watched, but looking more closely, it's really just about if the parent directory of a non-existing data directory changed... Makes senses, we don't want that. >>> +@@ -1555,6 +1564,32 @@ desktop_file_dirs_lock (void) >>> + for (i =3D 0; dirs[i]; i++) >>> + g_ptr_array_add (desktop_file_dirs, desktop_file_dir_new (dir= s[i])); >>> + >>> ++ { >>> ++ /* Monitor the system and user profile under /var/guix/profil= es and >>> ++ * treat modifications to them as if they were modifications = to their >>> ++ * /share sub-directory. */ >>> ++ const gchar *user; >>> ++ DesktopFileDir *system_profile_dir, *user_profile_dir; >>> ++ >>> ++ system_profile_dir =3D >>> ++ desktop_file_dir_new ("/var/guix/profiles/system/profile/sh= are"); >>> ++ system_profile_dir->guix_profile_watch_dir =3D g_strdup ("/va= r/guix/profiles"); >>> ++ g_ptr_array_add (desktop_file_dirs, desktop_file_dir_ref (sys= tem_profile_dir)); >>> ++ >>> ++ user =3D g_get_user_name (); >> >> This seems to get the user of the running glib application; e.g. for >> GNOME Shell it returns 'gdm'... >> >>> ++ if (user !=3D NULL) >>> ++ { >>> ++ gchar *profile_dir, *user_data_dir; >>> ++ >>> ++ profile_dir =3D g_build_filename ("/var/guix/profiles/per= -user", user, NULL); >>> ++ user_data_dir =3D g_build_filename (profile_dir, "guix-pr= ofile", "share", NULL); >>> ++ user_profile_dir =3D desktop_file_dir_new (user_data_dir); >>> ++ user_profile_dir->guix_profile_watch_dir =3D profile_dir; >>> ++ g_ptr_array_add (desktop_file_dirs, desktop_file_dir_ref = (user_profile_dir)); >>> ++ g_free (user_data_dir); >>> ++ } >>> ++ } >>> ++ >> >> ...which means the above puts the watch on the >> "/var/guix/profiles/per-user/gdm" directory, which doesn't exist. > > Yes, that profile is typically never populated. Ah, I now understand the source of my confusion; there are multiple gnome-shell instances (components?) running, one apparently started by the greeter (GDM), which doesn't have a profile, and others started by the users which logged in. Thanks again for the fix and explanations! Maxim