From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 4K1SFWS1jGJBBgEAbAwnHQ (envelope-from ) for ; Tue, 24 May 2022 12:37:24 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id iC1UFGS1jGKkCgAAG6o9tA (envelope-from ) for ; Tue, 24 May 2022 12:37:24 +0200 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 D38FD10D9E for ; Tue, 24 May 2022 12:37:23 +0200 (CEST) Received: from localhost ([::1]:58164 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ntRuk-0007LZ-0R for larch@yhetil.org; Tue, 24 May 2022 06:37:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55860) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ntRrO-0007LC-H8 for emacs-orgmode@gnu.org; Tue, 24 May 2022 06:33:55 -0400 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]:41763) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ntRrM-0007K8-PD for emacs-orgmode@gnu.org; Tue, 24 May 2022 06:33:54 -0400 Received: by mail-pf1-x42b.google.com with SMTP id p8so16063877pfh.8 for ; Tue, 24 May 2022 03:33:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=references:user-agent:from:to:subject:date:in-reply-to:message-id :mime-version; bh=nDPZro/FfeSdiNtj1BeVlc18kP0HGkxFtNT3tTlbjxk=; b=oPh1yIZwvrXjGPltXf7UWSYoAUs0bc3DWFyxBRKIAK/rCnyqaQKf/Tl2Tp1gNg0DQQ TlsT7U0kXUvtnNb3YMytrO36mpewblnPDHtV7rUMltZr1sVvTUHXEvVhdjInsQabCvSE sOFYasxwsj/8COXBtx5wE5eunnV8yq+BMAmZqgb6cb62LPhiZALbI764vZPjYYM/MBpS tcPeo+Dr73xEXAAeGgePLINSSUzsflIrcsmWILMjRcPssj73UCwWqIwpwNhs1j2mLosE HjI9XeQp5MYBYVoaOyT/bAbAOrMZkOFm/3XiRq03hFG1Rv+HAGw25zIq7y5uddkyGW+O VL9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:references:user-agent:from:to:subject:date :in-reply-to:message-id:mime-version; bh=nDPZro/FfeSdiNtj1BeVlc18kP0HGkxFtNT3tTlbjxk=; b=68XRjub2Cpok6gPprDBNpe3s/0Y7dryG2+B0AwyvIhCMfi38x3cawQ6SRTw/inpxrm yBo9TLik0HnK9Wha8XYVIrtQKmEmhi64Teya28VdOOyg54WVY8KImW+Ofj94EgCcRpCK SgPtiDokC/A0cPDlA/di9Yueo1bbcti36eLWdoQda6jwMwrhtCtQVAOuT0YFUyvooupl uGrKbqA94L4WqoD32Tk7Mj+GJFpwX9fleyTzbKHttZleQO/EqWLoQlrpq65SqAlLYeZz zXMmrL0qpaBRRCw1g0JD3jHEi4WnBBGHqkQC2sqJ0wngx09wSUz6lc++zo6P5e9qxRB3 u2LA== X-Gm-Message-State: AOAM531mAM/WHo/VhAFnig5wrBagzrsQxm25UM9yNxSK1Z8FVGf+1Vyc xSeooITtrLpvs8oDhR/QxI4UfywfYYA= X-Google-Smtp-Source: ABdhPJwiMer+rEciKICLq/gf4w8aLcDu2ClBGniSyLWtLMnDkR5YW8VoYMvFmDsoLlNIm7xUaleNYQ== X-Received: by 2002:a05:6a00:2391:b0:50a:3ea9:e84d with SMTP id f17-20020a056a00239100b0050a3ea9e84dmr27694671pfc.21.1653388430764; Tue, 24 May 2022 03:33:50 -0700 (PDT) Received: from dingbat (220-235-29-41.dyn.iinet.net.au. [220.235.29.41]) by smtp.gmail.com with ESMTPSA id c16-20020a624e10000000b0050dc7628142sm8992180pfb.28.2022.05.24.03.33.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 May 2022 03:33:50 -0700 (PDT) References: <875ylvnxf9.fsf@free.fr> User-agent: mu4e 1.7.23; emacs 28.1.50 From: Tim Cross To: emacs-orgmode@gnu.org Subject: Re: org-clock idle time in pgtk Emacs Date: Tue, 24 May 2022 20:27:09 +1000 In-reply-to: <875ylvnxf9.fsf@free.fr> Message-ID: <877d6bgqyd.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::42b; envelope-from=theophilusx@gmail.com; helo=mail-pf1-x42b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1653388644; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=nDPZro/FfeSdiNtj1BeVlc18kP0HGkxFtNT3tTlbjxk=; b=K8XPrm+UsWSNTJYJcoBtbntNSzauqr+uKq9imqEp2ev7hBUl8S8+cS7d5EJlVo+rB+Z2L1 O2tUwdmEm3ho4K8+cDDhQDdLdEQvjFkHI+gYcaL11o0PejCTgSgObXK0Q275Cx31yFSjpK FEiFH4jPBPpbSsgukDBMxEiwZkvfJw4HyXOmy0PgEUVAlAWoajsA6oiW+abgmRSSzclgIv rLbRY7ccqAwO6CEYcI7EvUeF4boT/oz1r2eH54a1gu7s6hJOQtQYjbnFLnaMb1FITmeaA0 hD0phUBBdF5zSdoaASYJJmKGl1n4e4hnFj2NdbnAOqAbS+AkTAy3BfnCCnh0LA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1653388644; a=rsa-sha256; cv=none; b=I2zj5d6W7kVxumCNFSjg2XeedFyPPuiUihOFagJKr21G9Ne1ol5xuevzgRHIMbfQYkatpt 7HOQFowKMet3rwkfVDVh/pnJvKINLqJoqGUjJsbnjt/uPFOr5/qLDrjDGqMZaKFv7S0jVH ESPV67eTR/Pd2VrObgqYksIrtC9e4K2RUzjT8Y5zOG9r5ICUXhtIn/0GClENxNlVL2xQtN LVvDlMbviYYPuIk5lDDlvGL+PJaVngxdOxoi5yli5CnOESpUYV98pME0dijRs8mKSVvGWq j9Cxkacxzbx/ZlSRTAEmnm9WDy2zFHehCA6bliFThx85UKdxyftjAuYWQS6cUA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=oPh1yIZw; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -4.04 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=oPh1yIZw; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: D38FD10D9E X-Spam-Score: -4.04 X-Migadu-Scanner: scn0.migadu.com X-TUID: Wg8XpLukQRhO Julien Cubizolles writes: > org-clock checks for the 'x window-system in order to use the program > set up by org-clock-x11idle-program-name. Recent Emacs versions use the > 'pgtk instead of 'x and as such will default to using > org-emacs-idle-seconds in org-user-idle-seconds. > I"m not sure this is accurate. You should only use the pgtk build of Emacs if your running wayland. You definitely should not use it if your running under X. The big issue is that some important key input facilities don't work correctly if you run the pgtk build under X (actually, I'm not sure they work correctly under Wayland either, but then again, Wayland is a different beast to X and differences can be expected). The pgtk build is not a replacement for the current xlib+gtk build, which will remain the correct build when running under X. Unfortunately, this does mean that if you use both X and Wayland, you likely will need two builds of Emacs. There was a fairly long discussion thread about this on emacs-devel about a month or so ago. The upshot was flagging the need to update the documentation to clarify that people should not use the pgtk build when running under X windows. I suspect this means the below patch will need further refinement. > The following patch provides a crude workaround. > > I'm using a python program (included below) to report idletime in > wayland, using the idle-time module. It can be used for > org-clock-x11idle-program-name. > > modified lisp/org-clock.el > @@ -1196,7 +1196,7 @@ If `only-dangling-p' is non-nil, only ask to resolve dangling > > (defvar org-x11idle-exists-p > ;; Check that x11idle exists > - (and (eq window-system 'x) > + (and (or (eq window-system 'pgtk) (eq window-system 'x)) > (eq 0 (call-process-shell-command > (format "command -v %s" org-clock-x11idle-program-name))) > ;; Check that x11idle can retrieve the idle time > @@ -1213,7 +1213,7 @@ This routine returns a floating point number." > (cond > ((eq system-type 'darwin) > (org-mac-idle-seconds)) > - ((and (eq window-system 'x) org-x11idle-exists-p) > + ((and (or (eq window-system 'x) (eq window-system 'pgtk)) org-x11idle-exists-p) > (org-x11-idle-seconds)) > (t > (org-emacs-idle-seconds)))) > > #!/usr/bin/env python3 > > from idle_time import IdleMonitor > > monitor = IdleMonitor.get_monitor() > print(f"{1000*monitor.get_idle_time():.0f}")