From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Arthur Miller Newsgroups: gmane.emacs.bugs Subject: bug#43672: 28.0.50; select-frame-set-input-focus does not set focus first time called Date: Mon, 28 Sep 2020 15:34:33 +0200 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20232"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) To: 43672@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Sep 28 15:50:38 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kMtY5-00057F-CU for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 28 Sep 2020 15:50:37 +0200 Original-Received: from localhost ([::1]:40446 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kMtY4-0007V6-66 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 28 Sep 2020 09:50:36 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40566) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kMtXW-0007TY-ER for bug-gnu-emacs@gnu.org; Mon, 28 Sep 2020 09:50:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40420) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kMtXW-0006eV-0k for bug-gnu-emacs@gnu.org; Mon, 28 Sep 2020 09:50:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kMtXV-00045M-VJ for bug-gnu-emacs@gnu.org; Mon, 28 Sep 2020 09:50:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Arthur Miller Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 28 Sep 2020 13:50:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 43672 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.160130098815671 (code B ref -1); Mon, 28 Sep 2020 13:50:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 28 Sep 2020 13:49:48 +0000 Original-Received: from localhost ([127.0.0.1]:51964 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kMtXH-00044h-ED for submit@debbugs.gnu.org; Mon, 28 Sep 2020 09:49:47 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:34270) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kMtXF-00044Z-Vf for submit@debbugs.gnu.org; Mon, 28 Sep 2020 09:49:46 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40440) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kMtXD-000780-Sa for bug-gnu-emacs@gnu.org; Mon, 28 Sep 2020 09:49:44 -0400 Original-Received: from mail-oln040092064082.outbound.protection.outlook.com ([40.92.64.82]:14727 helo=EUR01-DB5-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kMtX9-0006d3-IQ for bug-gnu-emacs@gnu.org; Mon, 28 Sep 2020 09:49:42 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Dk3Zl/Jh9a7EY9FZNfOlF27fJYMeMFVpIwgZMiiqg1/Yyz9ai4z4EMAZwB5lNro+cCySN2zqpNkjaeYzcsRL5NklC/iYXnLpSbMj7T2i/9dPvZfHtjs1kx5lwgUZsSF99Ze7av1VgZe/55L4ZvxxPTCD1voav9/jzfH7cWMc4qZdAvqtndg+lbotscyZ/+zHC1b7a8yUYcAqBPcBTkKkJRrUGE5DEp/Fm17slF67wuG1KYre2BoZMWEi13dur0aQACPf5my6gkxex+zv8MbGUcQ5MlzZV3+1KSJutC8F4cBWakyz+huQdIFrDjsIbtsqprGkLKtpNER5EDdqfH4XRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QfNuOmwpxqwWqBG55gnSAF6byqlEZ373U4jT1CX+fFQ=; b=J27Qt8HJMj9GIIIhuPRNftv+ddjihBpnl9BGQtQZYxFD94D/omuQVjQ/iZL8tm++AWqfxG++oyRkgru8PlHgptaU2TC5D4I7t2YMv396rqg9uQMP+inM1teu28W8VroFpvZpU0jRekwvR5PLwUmxKlQBlS0CxSo9FuLhRoeSRUR9fHSG4FOzNHlBB1DE/riVbL7Jna2KO909T+hxnkpgSwYHhigYfBUYZvE6kkR3HJoMFwtkydv9bvBfdQDsuSI/Ztxqx6m6/ismL9avOfTNdHguWBk6BuEGgxWByVixVYEMjf/5Vfi/4utKFK+l60Q2+dQc7c/vOhZySi5fAuXaMg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=live.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QfNuOmwpxqwWqBG55gnSAF6byqlEZ373U4jT1CX+fFQ=; b=OTbplrMATfPWGnfMn545+K5UBNhLwglApykS2oPHD2N7EuKpMwdEU+uBDvdsGVo2NglMj/3qYdeeBbcI8NjBj+iuJWzQPcmIHcjWBS5ODEdcok+XtKVEBPr71LYQBgEAIoyJhqtVF7YkUKpvEYa4QVX7eN4Hio6nGmcQYpDOg2tRmHnsiy2egE3X9aAmFRB4qbiyCtKcNvvxc+oO3y+EQU0wtR83lO4h+Fcx2oKa/tohDfNb5b5PD8MBGuqrqTjO1wrvtuL/gvad5y/cKvt8NbhaPPZW7jOTtvY+qecS6jtIHFgwSQuX708HVnkOEmvP4oULUqGK88Pl2XvVFtnnfw== Original-Received: from DB5EUR01FT006.eop-EUR01.prod.protection.outlook.com (2a01:111:e400:7e1a::53) by DB5EUR01HT132.eop-EUR01.prod.protection.outlook.com (2a01:111:e400:7e1a::368) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3412.21; Mon, 28 Sep 2020 13:34:34 +0000 Original-Received: from VI1PR06MB4526.eurprd06.prod.outlook.com (2a01:111:e400:7e1a::4e) by DB5EUR01FT006.mail.protection.outlook.com (2a01:111:e400:7e1a::134) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3412.21 via Frontend Transport; Mon, 28 Sep 2020 13:34:34 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:A9DBC429C7DD3FB5ABFC48047951967DEE50B348B59075A4D774E2EB4A5CD319; UpperCasedChecksum:CF410FB85F367EDEFB040615AE791158D02FEFC07884EA520A5DB8F0AB36EE61; SizeAsReceived:7297; Count:44 Original-Received: from VI1PR06MB4526.eurprd06.prod.outlook.com ([fe80::b547:51cd:16c5:4487]) by VI1PR06MB4526.eurprd06.prod.outlook.com ([fe80::b547:51cd:16c5:4487%7]) with mapi id 15.20.3412.028; Mon, 28 Sep 2020 13:34:34 +0000 X-ClientProxiedBy: AM5PR1001CA0008.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:206:2::21) To VI1PR06MB4526.eurprd06.prod.outlook.com (2603:10a6:803:ac::17) X-Microsoft-Original-Message-ID: <87o8lq10uu.fsf@live.com> X-MS-Exchange-MessageSentRepresentingType: 1 Original-Received: from pascal.homepc (90.230.29.56) by AM5PR1001CA0008.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:206:2::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3412.20 via Frontend Transport; Mon, 28 Sep 2020 13:34:34 +0000 X-Microsoft-Original-Message-ID: <87o8lq10uu.fsf@live.com> X-TMN: [ixC7uLYAYnFjIVOdHT6lPft26/AiCakM] X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 44 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 7a53fdd8-adea-4714-5277-08d863b33cd4 X-MS-TrafficTypeDiagnostic: DB5EUR01HT132: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GiDwdHE8uEdpe5b60+V81KJ7oix7JirpxPXNangbkET5kj8XGNbg2PWu4tL65UhnFkgU6cTNvjEeQcYmoPGIPGMzduR/SrhiljWYr81gWSHTSk/ziJuauH4l5ACeN2iF84lgrC+onAKl1rVvrTiw2ln1aZT9Yy+sCU4THx4nMNQy5LaxOSWwu0qeTsPKTvNvELlMd3RAx6rDrpregWOwNw== X-MS-Exchange-AntiSpam-MessageData: YpQt6TRLUTEiNAcHIGFmOpHRGcFvzxTGbO7Hj8uTFLp/3slMMHYWZg7+WJYHfoYLPFk9FRPV2uKbSLwg2cX7eorZdJVImAlP8TJkJE6LG1dfkrIF9H0nUPqbb+n7zBGTWFyvYYcP/RbFTIa2B0/kdA== X-OriginatorOrg: live.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7a53fdd8-adea-4714-5277-08d863b33cd4 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Sep 2020 13:34:34.8346 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: DB5EUR01FT006.eop-EUR01.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5EUR01HT132 Received-SPF: pass client-ip=40.92.64.82; envelope-from=arthur.miller@live.com; helo=EUR01-DB5-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/28 09:49:37 X-ACL-Warn: Detected OS = Windows NT kernel [generic] [fuzzy] X-Spam_score_int: -33 X-Spam_score: -3.4 X-Spam_bar: --- X-Spam_report: (-3.4 / 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, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.614, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:189198 Archived-At: --=-=-= Content-Type: text/plain When calling (select-frame-set-input-focus some-frame) the frame is raised, but does not recieve the focus. I have to call twice to 'select-frame-set-input-focus' for the frame to get focused. Docs says "focused if possible", so I am not sure if it some bug or/and how much does it depend on my window manager used; but calling it twice consecutively works. I have attached an example code. To reproduce, emacs -Q, an eval attached code. If I missunderstand docs, or am calling it wrongly, dissregard the rapport plz :-). --=-=-= Content-Type: text/plain Content-Disposition: attachment; filename=poor-man-menu.el Content-Description: test example ;;; poor-man-menu.el --- -*- lexical-binding: t; -*- (defun pm-test () (interactive) (let ((test (get-buffer "testmenu"))) (when (not test) (with-current-buffer (get-buffer-create "testmenu") (insert "one") (newline) (insert "two") (newline) (insert "three") (newline) (insert "four")))) (pm-show-at-point "testmenu")) (define-minor-mode pm-minor-mode :keymap (let ((map (make-sparse-keymap))) map)) (defun pm-quit () (interactive) (let ((b (window-buffer))) (when b (kill-buffer b))) (delete-frame (selected-frame))) (defun pm-show-at-point (menuname) (let ((position (pos-visible-in-window-p nil nil t))) (pm-create-menu menuname (nth 0 position) (nth 1 position)))) (defun pm-show-at-cursor (menuname) (let ((cursor-pos (mouse-pixel-position))) (pm-create-menu menuname (cadr cursor-pos) (cddr cursor-pos)))) (defun pm-create-menu (menuname x y) (when (not (get-buffer menuname)) (pm-load-menu menuname)) (with-current-buffer (get-buffer menuname) (pm-minor-mode) (define-key pm-minor-mode-map (kbd "C-g") 'pm-quit) (setq tab-line-format nil) (setq mode-line-format nil) (let ((parent (selected-frame)) (child-frame (make-frame '((visible . 0) (undecorated . 0) (keep-ratio . t) (menu-bar-lines . 0) (tool-bar-lines . 0) (left-fringe . 0) (right-fringe . 0) (line-spacing . 0) (unsplittable . t) (minibuffer . nil) (no-other-frame . t) (drag-internal-border . t) (inhibit-double-buffering . t) (desktop-dont-save . t))))) (set-frame-parameter child-frame 'parent-frame parent) (fit-frame-to-buffer child-frame) (set-frame-position child-frame x y) ;;(raise-frame child-frame) ;; needs two calls to get raised AND focused (select-frame-set-input-focus child-frame) (select-frame-set-input-focus child-frame)))) (provide 'poor-man-menu) --=-=-= Content-Type: text/plain In GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.23, cairo version 1.17.3) of 2020-09-27 built on pascal Repository revision: dc0cf16c7a60f36aafcf9b56513a855cefa7e1ad Repository branch: feature/native-comp Windowing system distributor 'The X.Org Foundation', version 11.0.12009000 System Description: Arch Linux Configured using: 'configure --with-gnutls --without-gconf --with-rsvg --with-x --with-xwidgets --without-toolkit-scroll-bars --without-xaw3d --without-gsettings --with-mailutils --with-nativecomp 'CFLAGS=-O3 -mtune=native -march=native -fomit-frame-pointer'' Configured features: XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND GPM DBUS GLIB NOTIFY INOTIFY ACL GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF ZLIB GTK3 X11 XDBE XIM MODULES NATIVE_COMP THREADS XWIDGETS LIBSYSTEMD JSON PDUMPER LCMS2 Important settings: value of $LANG: sv_SE.UTF-8 locale-coding-system: utf-8-unix Major mode: ELisp/l Minor modes in effect: tooltip-mode: t global-eldoc-mode: t eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs rfc822 mml easymenu mml-sec epa derived epg epg-config gnus-util rmail rmail-loaddefs auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache json map text-property-search seq byte-opt gv bytecomp byte-compile cconv mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils edmacro kmacro time-date subr-x cl-loaddefs cl-lib pure-menu easy-mmode tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice button loaddefs faces cus-face pcase macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads xwidget-internal dbusbind inotify lcms2 dynamic-setting font-render-setting cairo move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 65534 9142) (symbols 48 7061 0) (strings 32 19304 1280) (string-bytes 1 699011) (vectors 16 12611) (vector-slots 8 276483 9931) (floats 8 26 105) (intervals 56 610 517) (buffers 992 13)) --=-=-=--