unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Madhu <enometh@meer.net>
Cc: Po Lu <luangruo@yahoo.com>, Yuuki Harano <masm+emacs@masm11.me>,
	emacs-devel@gnu.org
Subject: Re: Deiconifying GTK frames on GNOME shell
Date: Wed, 8 Dec 2021 12:00:56 +0100	[thread overview]
Message-ID: <42555c74-d13d-64eb-d0ff-fd775ee97b8a@gmx.at> (raw)
In-Reply-To: <20211206.210507.1015981090870439275.enometh@meer.net>

[-- Attachment #1: Type: text/plain, Size: 504 bytes --]

 > Implementing that in pgtk with the attached patch seems to work. To
 > test:
 >
 > emacs -Q -l test.el
 >
 > (setq $a (make-frame)); move the new frame out of the way and
 > ;; go back to the first frame.
 > (select-frame-set-input-focus $a)
 > ;; after the patch this sets the input focus - on mutter 41 the cursor
 > ;; is still over the old window
 >
 > I'm hoping a pgtk user can test this/comment on if this is a right
 > approach?

Yuuki Harano, Po Lu - any comments on that patch?

TIA, martin

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: pgtk-workaround-frame-focus-on-wayland.patch --]
[-- Type: text/x-patch; name="pgtk-workaround-frame-focus-on-wayland.patch", Size: 902 bytes --]

>From 8f3fcc9e80fbff04165c6a3f8bcc05b91c270268 Mon Sep 17 00:00:00 2001
From: Madhu <enometh@net.meer>
Date: Mon, 6 Dec 2021 20:55:45 +0530
Subject: [PATCH] pgtkterm: workaround frame focus on wayland

* src/pgktterm.c: (pgtk_focus_frame): force wayland to raise the frame
with a call to gtk_window_present_with_time with a faked up timestamp.
---
 src/pgtkterm.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/pgtkterm.c b/src/pgtkterm.c
index bf863c8474..499a4dd03a 100644
--- a/src/pgtkterm.c
+++ b/src/pgtkterm.c
@@ -4381,6 +4381,10 @@ pgtk_focus_frame (struct frame *f, bool noactivate)
     {
       block_input ();
       gtk_widget_grab_focus (wid);
+      if (FRAME_GTK_OUTER_WIDGET (f))
+	{
+	  gtk_window_present_with_time (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), g_get_monotonic_time () / 1000L);
+	}
       unblock_input ();
     }
 }
--
2.31.0


  reply	other threads:[~2021-12-08 11:00 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-05  9:39 Deiconifying GTK frames on GNOME shell martin rudalics
2021-09-05 10:26 ` Colin Baxter
2021-09-06  8:31   ` martin rudalics
2021-09-05 19:19 ` Dmitry Gutov
2021-09-06  8:32   ` martin rudalics
2021-09-07  0:45     ` Dmitry Gutov
2021-09-07  8:16       ` martin rudalics
2021-09-09 13:13         ` Madhu
2021-09-10  8:34           ` martin rudalics
2021-09-10 12:04             ` Madhu
2021-09-11  8:38               ` martin rudalics
2021-12-06 15:35                 ` Madhu
2021-12-08 11:00                   ` martin rudalics [this message]
2021-12-08 11:09                     ` Po Lu
2021-12-08 16:02                       ` Yuuki Harano
2021-12-09  0:28                         ` Po Lu
2021-12-09  2:30                           ` Madhu
2021-12-09  2:46                             ` Po Lu
2021-12-09  9:20                               ` Eli Zaretskii
2021-12-08 16:33                       ` Madhu
2021-12-09  0:31                         ` Po Lu
2021-12-09  2:33                           ` Madhu
2021-09-10  8:33       ` martin rudalics
2021-09-11 14:48         ` Dmitry Gutov
2021-09-11 16:43           ` martin rudalics

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=42555c74-d13d-64eb-d0ff-fd775ee97b8a@gmx.at \
    --to=rudalics@gmx.at \
    --cc=emacs-devel@gnu.org \
    --cc=enometh@meer.net \
    --cc=luangruo@yahoo.com \
    --cc=masm+emacs@masm11.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).