From patchwork Wed Aug 4 01:08:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Carlo_Marcelo_Arenas_Bel=C3=B3n?= X-Patchwork-Id: 12417705 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A8254C432BE for ; Wed, 4 Aug 2021 01:09:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8228660F6F for ; Wed, 4 Aug 2021 01:09:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232530AbhHDBJk (ORCPT ); Tue, 3 Aug 2021 21:09:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232455AbhHDBJj (ORCPT ); Tue, 3 Aug 2021 21:09:39 -0400 Received: from mail-ot1-x331.google.com (mail-ot1-x331.google.com [IPv6:2607:f8b0:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90DA3C06175F for ; Tue, 3 Aug 2021 18:09:26 -0700 (PDT) Received: by mail-ot1-x331.google.com with SMTP id o2-20020a9d22020000b0290462f0ab0800so211037ota.11 for ; Tue, 03 Aug 2021 18:09:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Dr3bNq/CnQfuWAjdfFrDIUABqAmSlccVitteYBKhb8E=; b=VipzIXYA3QHdQTlSoeG85Yb15XqJswKHZQCMNZKehfJZhBsrP0pbTIhBPcWhyaqtN7 CLYR64YG3DApxb0RjwGSTVYNW3od5F19su2GpcAUr7mta7xFhFNQGaayZXD1jWNKYYVJ c/wM5YSzzCksMnIG8SlvchfHsZqUQMmF6RRGeShoMLcGiBhy/XB9+blFAr3hxUnHDRl1 EXo2WKNiFF+CgvwEpZkvk16DrjQRZCvge+u97ha8L0S6wvLovv9Ykvfb+E8d8F73By5R OjnjcJwXjVcFrtdSDYWRjmqBJYWGrzCejiHG9/QkA/n53iZprKW57JFgQTax+lgG+lKk cr9w== 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:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Dr3bNq/CnQfuWAjdfFrDIUABqAmSlccVitteYBKhb8E=; b=ZmlcdAjzVyntvJhzzgNlv9higjP+xm2Bln7LDoZIcFskh7xgytuaYu/5Vh0n/PSj8K S6oE+XrQRLWmvkQQuZsZwADtiAGiSSEbcWYRW8cnNtjKC8+SlLx9NSirAwO4/EXlVheV O/ZIlk83gtIzDomlNsva7KiPp/uwp6bH3szKgNXeGY+JeSsityfIPNfTRG3wAC7++Y6M U7n1250x6P3HwASBPj8Kqbncms8qh8rmTRXOv3wyDT7UFEMtKxUCsnsZEU/1HDiIAQvM N563sXBpm2O621tw5WudzPtSDRaXetE9TXvRQqGRoaDD3v50FN34d9ldHPDIzGnxcP3V BV+A== X-Gm-Message-State: AOAM530/YppuiWZZY92Biv77h3Z/WBmVCvuwJWVQaDs6uoDCJY34mIUK y32lsepucVyYIjCP8d7ymIuao/DTIms= X-Google-Smtp-Source: ABdhPJwu4IMWHhtPsHJJFCze1KR/jnR4FRKJ3R0rX6GNAjXiRGcV5n2ue/NsSx7NLfTU7cO6zH4JXQ== X-Received: by 2002:a9d:3a08:: with SMTP id j8mr16989881otc.247.1628039365679; Tue, 03 Aug 2021 18:09:25 -0700 (PDT) Received: from carlos-mbp.lan (104-1-92-200.lightspeed.sntcca.sbcglobal.net. [104.1.92.200]) by smtp.gmail.com with ESMTPSA id c21sm179721oiw.16.2021.08.03.18.09.24 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Aug 2021 18:09:25 -0700 (PDT) From: =?utf-8?q?Carlo_Marcelo_Arenas_Bel=C3=B3n?= To: git@vger.kernel.org, paulus@samba.org Cc: pietzsch@mycroft.speedport.ip, sunshine@sunshineco.com, tair.sabirgaliev@bee.kz, lists@haller-berlin.de, =?utf-8?q?Carlo_Marcelo_Ar?= =?utf-8?q?enas_Bel=C3=B3n?= Subject: [PATCH 1/3] gitk: skip calling osascript to set frontmost for tk >= 8.6 Date: Tue, 3 Aug 2021 18:08:58 -0700 Message-Id: <20210804010900.33133-2-carenas@gmail.com> X-Mailer: git-send-email 2.33.0.rc0.433.g9a510e7e11 In-Reply-To: <20210804010900.33133-1-carenas@gmail.com> References: <20210804010900.33133-1-carenas@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org 76bf6ff (gitk: On OSX, bring the gitk window to front, 2013-04-24) adds an osascript to set the gitk window to the front to workaround and unfortunate default in older tk versions to add it to the back. tk 8.6 or newer do not need that workaround so add a conditional check to skip it and while at it update the comment with the new name for the OS. Signed-off-by: Carlo Marcelo Arenas Belón --- gitk | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/gitk b/gitk index 23d9dd1..f68d983 100755 --- a/gitk +++ b/gitk @@ -12288,13 +12288,15 @@ if {[catch {package require Tk 8.4} err]} { exit 1 } -# on OSX bring the current Wish process window to front +# on macOS bring the current Wish process window to front if needed if {[tk windowingsystem] eq "aqua"} { - exec osascript -e [format { - tell application "System Events" - set frontmost of processes whose unix id is %d to true - end tell - } [pid] ] + if {$tcl_version < 8.6} { + exec osascript -e [format { + tell application "System Events" + set frontmost of processes whose unix id is %d to true + end tell + } [pid] ] + } } # Unset GIT_TRACE var if set From patchwork Wed Aug 4 01:08:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Carlo_Marcelo_Arenas_Bel=C3=B3n?= X-Patchwork-Id: 12417709 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ECFFDC432BE for ; Wed, 4 Aug 2021 01:09:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D758A60F8F for ; Wed, 4 Aug 2021 01:09:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232709AbhHDBJn (ORCPT ); Tue, 3 Aug 2021 21:09:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232514AbhHDBJk (ORCPT ); Tue, 3 Aug 2021 21:09:40 -0400 Received: from mail-ot1-x32d.google.com (mail-ot1-x32d.google.com [IPv6:2607:f8b0:4864:20::32d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 85D5FC061764 for ; Tue, 3 Aug 2021 18:09:27 -0700 (PDT) Received: by mail-ot1-x32d.google.com with SMTP id x15-20020a05683000cfb02904d1f8b9db81so206909oto.12 for ; Tue, 03 Aug 2021 18:09:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ACqwoYjIPKzMzRz2JQcMEADda9SuDp7dHh3a6fRWB1E=; b=rh8pjUGdTuX0SpsMu9M/ABvWxpwtIbjyYzLOhWI9X/yvu9UMa88+WiRPXGUA+5TJKm 7VyKAXnjQ2E3trIxmpnlvMLdC+EvjmltXicZIubAIZa8A+32sUGMLjCZan6ovJ04+f5K amDtUCSb35go7EYSBt8Bvsxl6qGBYYS3UK+zr303wzdhzzBZ610z/cgc1mtZHZhqwMch fKUgoIOukcLv4BtHrbPel13MjiNCtW9b8DiDRRZditbcGQ+rGGe6J3D7J+WtqP3H5rGZ gAEGMJI3V+xglkKVzJbKymAbxon4R8P73B1vtFyLxfA/inSU4LSELnjwXnw6rcoI639N lfZQ== 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:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ACqwoYjIPKzMzRz2JQcMEADda9SuDp7dHh3a6fRWB1E=; b=cTrOu/ZU79f6rX5v/YBYNYDo42A1epokjRn2PyIyF46Cd1GfJlMemLKgW+90N2Swy8 wvmbGjqyaK7faCPc5VXxQpaoEUgSXxmdBIXvCsVJvTSymXS0+i5qbfBJ9JGr/3ig2PN9 pyiVBV3LtR7RtmaFlCIX581BQJHeoTf7Hdvg8egqGS0dofMJYowE/2BZhtksY1WNRmrS 28pP0KOFz8SR2BhhcUoM+3A0NQr7VPn5d5xZTl6Gp6uuXS6raOaWhcdMAd8VT0DBYaeJ sUH3d1saSdxhxO99XSj5HzsOp4pNPTZIEaThYUhzH4MvRtlOI3mlQVcvzf0SW3SiLzu7 hWhQ== X-Gm-Message-State: AOAM530bft0xW5mYThibbuppywlwBeDp/KTahoelRXqETKMp1pe98jpt N/xxmy1jj1ALktdYeiuWQr6fE5n12yU= X-Google-Smtp-Source: ABdhPJzfsJNKrP6D8EIo7WicsBO7hELSmQ9NlLZ9I1irgfQIeDFnEd1LczHc8YsxQNHauJs2XFI52w== X-Received: by 2002:a9d:5603:: with SMTP id e3mr17136766oti.178.1628039366715; Tue, 03 Aug 2021 18:09:26 -0700 (PDT) Received: from carlos-mbp.lan (104-1-92-200.lightspeed.sntcca.sbcglobal.net. [104.1.92.200]) by smtp.gmail.com with ESMTPSA id c21sm179721oiw.16.2021.08.03.18.09.25 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Aug 2021 18:09:26 -0700 (PDT) From: =?utf-8?q?Carlo_Marcelo_Arenas_Bel=C3=B3n?= To: git@vger.kernel.org, paulus@samba.org Cc: pietzsch@mycroft.speedport.ip, sunshine@sunshineco.com, tair.sabirgaliev@bee.kz, lists@haller-berlin.de, =?utf-8?q?Carlo_Marcelo_Ar?= =?utf-8?q?enas_Bel=C3=B3n?= Subject: [PATCH 2/3] gitk: avoid fatal error if `exec osascript` fails Date: Tue, 3 Aug 2021 18:08:59 -0700 Message-Id: <20210804010900.33133-3-carenas@gmail.com> X-Mailer: git-send-email 2.33.0.rc0.433.g9a510e7e11 In-Reply-To: <20210804010900.33133-1-carenas@gmail.com> References: <20210804010900.33133-1-carenas@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org starting with macOS 10.14 calling "System Events" requires an "Automation" grant, that will result in a fatal error showing: Error in startup script: 66:111: execution error: Not authorized to send Apple events to System Events. (-1743) instead of aborting catch the error and print a suitable warning. Signed-off-by: Carlo Marcelo Arenas Belón --- gitk | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/gitk b/gitk index f68d983..b62c12f 100755 --- a/gitk +++ b/gitk @@ -12291,11 +12291,15 @@ if {[catch {package require Tk 8.4} err]} { # on macOS bring the current Wish process window to front if needed if {[tk windowingsystem] eq "aqua"} { if {$tcl_version < 8.6} { - exec osascript -e [format { - tell application "System Events" - set frontmost of processes whose unix id is %d to true - end tell - } [pid] ] + if {[catch { + exec osascript -e [format { + tell application "System Events" + set frontmost of processes whose unix id is %d to true + end tell + } [pid] ] + } ]} { + puts stderr [mc "Warning: 'System Events' access denied"] + } } } From patchwork Wed Aug 4 01:09:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Carlo_Marcelo_Arenas_Bel=C3=B3n?= X-Patchwork-Id: 12417707 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 650F0C4320A for ; Wed, 4 Aug 2021 01:09:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4C20860F6F for ; Wed, 4 Aug 2021 01:09:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232630AbhHDBJm (ORCPT ); Tue, 3 Aug 2021 21:09:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232495AbhHDBJk (ORCPT ); Tue, 3 Aug 2021 21:09:40 -0400 Received: from mail-oi1-x233.google.com (mail-oi1-x233.google.com [IPv6:2607:f8b0:4864:20::233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A2C7C06175F for ; Tue, 3 Aug 2021 18:09:28 -0700 (PDT) Received: by mail-oi1-x233.google.com with SMTP id q6so987963oiw.7 for ; Tue, 03 Aug 2021 18:09:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=rT0rJ4kuZOyGeSNbcmERBlY7prURfPrk/PZ6ZLhKZK4=; b=c27cjS+HxuoEc6uXpxGRSNsGM3kwXCfxNcOZCjYJoylVrHbBxCQQJl2FEsPF2kFOPb EH6+MDzOon9UBtuVRnHzzHFQ9clZVaYrnHeybj1fdGXscioY6tPc5vEKexm+cwC83itp I76UlUU866j0RD7hIt5zFO+9aijvmKvxSg/ziEqnzAcrhGaMUJHsIROJFW4zhqByv9yX qlq23stic2yo7hpKU8RM2A83YOmkLf/O1CX51P1RFT3BlyU/qWLjKmmdpVmTGQYL1zhI jYpguc4MtpVNmDyfFTejyCDe79LfoNZKgoR09m7OePogYZ3pmQal9l3JaR7yBBHXXoMa fUvQ== 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:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=rT0rJ4kuZOyGeSNbcmERBlY7prURfPrk/PZ6ZLhKZK4=; b=ZA22MY4cZvHlPjYRydX5GsiEgwbobvwLnQpie0DvZisjTNsrotKmaXEm348uaGJ+fX 49aSPTdENleOy7NdDNThC5rsq2O4Ma2lMQrcVo5Ixpz3g3bB3Dhznxp7We91YRVRLHHO R4pJsKvIR4qcdvvAsjdrRBnJLkskcKi/r9eD+lbeKO3wSfA1fg8yZa3Wu9uAx1+krAbF wkmJkN9hWOrPXvhRJUCCTDZspcY7BJIAtQdrYfQs94OqnOX51UVCqBd2He6SR6z4QBLO GktJI48UXqCu/ujDroqYO9CU56yy7N12vVgr5Vv27tIpzUD9OdFJHjRETwpNisynJaZW 4T3w== X-Gm-Message-State: AOAM530AG+Omkq0ugLS2XzkNYPbsMmA7ZiQ9nBoqlwwa61ypcdkNJtkG GpQS1xfo8uV6pioCAbY+a3uf0YQd+Dg= X-Google-Smtp-Source: ABdhPJxRktGbocTnpfz7BSe0wmBj4wltHJ3bCkXV2oOrn7zptmuVFvFaWmT6nwn1X0zKcdDLAehJ6g== X-Received: by 2002:aca:aacd:: with SMTP id t196mr16229612oie.12.1628039367685; Tue, 03 Aug 2021 18:09:27 -0700 (PDT) Received: from carlos-mbp.lan (104-1-92-200.lightspeed.sntcca.sbcglobal.net. [104.1.92.200]) by smtp.gmail.com with ESMTPSA id c21sm179721oiw.16.2021.08.03.18.09.26 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Aug 2021 18:09:27 -0700 (PDT) From: =?utf-8?q?Carlo_Marcelo_Arenas_Bel=C3=B3n?= To: git@vger.kernel.org, paulus@samba.org Cc: pietzsch@mycroft.speedport.ip, sunshine@sunshineco.com, tair.sabirgaliev@bee.kz, lists@haller-berlin.de, =?utf-8?q?Carlo_Marcelo_Ar?= =?utf-8?q?enas_Bel=C3=B3n?= Subject: [PATCH 3/3] gitk: check main window visibility before waiting for it to show Date: Tue, 3 Aug 2021 18:09:00 -0700 Message-Id: <20210804010900.33133-4-carenas@gmail.com> X-Mailer: git-send-email 2.33.0.rc0.433.g9a510e7e11 In-Reply-To: <20210804010900.33133-1-carenas@gmail.com> References: <20210804010900.33133-1-carenas@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Tobias Pietzsch If the main window is already visible when gitk waits for it to become visible, gitk hangs forever. This commit adds a check whether the window is already visible. See https://wiki.tcl-lang.org/page/tkwait+visibility Signed-off-by: Tobias Pietzsch Signed-off-by: Carlo Marcelo Arenas Belón --- gitk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gitk b/gitk index b62c12f..cc587b5 100755 --- a/gitk +++ b/gitk @@ -12664,7 +12664,7 @@ catch { wm iconphoto . -default gitlogo gitlogo32 } # wait for the window to become visible -tkwait visibility . +if {![winfo viewable .]} {tkwait visibility .} set_window_title update readrefs