unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Madhu <enometh@meer.net>
To: luangruo@yahoo.com
Cc: rudalics@gmx.at, masm+emacs@masm11.me, emacs-devel@gnu.org
Subject: Re: Deiconifying GTK frames on GNOME shell
Date: Thu, 09 Dec 2021 08:03:24 +0530 (IST)	[thread overview]
Message-ID: <20211209.080324.1660570566307266888.enometh@meer.net> (raw)
In-Reply-To: <87ee6md3g9.fsf@yahoo.com>

[-- Attachment #1: Type: Text/Plain, Size: 995 bytes --]

*  Po Lu <luangruo@yahoo.com> <87ee6md3g9.fsf@yahoo.com>
Wrote on Thu, 09 Dec 2021 08:31:02 +0800
> Madhu <enometh@meer.net> writes:
>> Hello, it is meant to make (select-frame-set-input-focus) "work" on
>> wayland for the time being.  It is not a correct fix.  (x-focus-frame
>> $a t) will raise the frame when it should not be raised.
>
> That's because the GDK developers, in their infinite wisdom, think that
> windows shouldn't give the input focus to themselves without also
> presenting themselves.
>
>> The problem I believe is that the gdk/gtk apis to raise/lower windows
>> just doesn't work on wayland. Implementing frame_raise_lower_hook with, say
>>       gdk_window_raise (gtk_widget_get_window (GTK_WIDGET (FRAME_GTK_OUTER_WIDGET (f))));
>> has no effect.
>
> If it doesn't work on Wayland, at least it will work on X-Windows, or
> Broadway, or some other window system supported by GDK.
>
> I see no reason to keep it unimplemented.

FWIW this is the patch I tried, which failed

[-- Attachment #2: 0001-src-pgtkterm.c-implement-frame-raise-lower-FAIL.patch --]
[-- Type: Text/X-Patch, Size: 2057 bytes --]

From e304e644aeab0732ebe3f6891e155d0939575122 Mon Sep 17 00:00:00 2001
From: Madhu <enometh@net.meer>
Date: Wed, 8 Dec 2021 21:39:59 +0530
Subject: [PATCH] src/pgtkterm.c - implement frame raise lower - FAIL

* src/pgtkterm.c: (pgtk_raise_frame, pgtk_lower_frame,
pgtk_frame_raise_lower): new.  pgtk_create_terminal: hook into
terminal->frame_raise_lower_hook
---
 src/pgtkterm.c | 39 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 38 insertions(+), 1 deletion(-)

diff --git a/src/pgtkterm.c b/src/pgtkterm.c
index 0d9b342e6e..fd193f9e0b 100644
--- a/src/pgtkterm.c
+++ b/src/pgtkterm.c
@@ -195,6 +195,43 @@ frame_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y)
 {
 }
 
+
+/* Raise frame F.  */
+
+static void
+pgtk_raise_frame (struct frame *f)
+{
+
+  if (FRAME_VISIBLE_P (f)) {
+    block_input ();
+    if (FRAME_GTK_OUTER_WIDGET (f))
+      gdk_window_raise (gtk_widget_get_window (GTK_WIDGET (FRAME_GTK_OUTER_WIDGET (f))));
+    unblock_input ();
+  }
+}
+
+/* Lower frame F.  */
+
+static void
+pgtk_lower_frame (struct frame *f)
+{
+  if (FRAME_VISIBLE_P (f))
+    {
+      block_input ();
+      gdk_window_lower (gtk_widget_get_window (GTK_WIDGET (FRAME_GTK_OUTER_WIDGET (f))));
+      unblock_input ();
+    }
+}
+
+static void
+pgtk_frame_raise_lower (struct frame *f, bool raise_flag)
+{
+  if (raise_flag)
+    pgtk_raise_frame (f);
+  else
+    pgtk_lower_frame (f);
+}
+
 /* Free X resources of frame F.  */
 
 void
@@ -4675,7 +4712,7 @@ pgtk_create_terminal (struct pgtk_display_info *dpyinfo)
   terminal->mouse_position_hook = pgtk_mouse_position;
   terminal->frame_rehighlight_hook = XTframe_rehighlight;
   terminal->buffer_flipping_unblocked_hook = pgtk_buffer_flipping_unblocked_hook;
-  /* terminal->frame_raise_lower_hook = pgtk_frame_raise_lower; */
+  terminal->frame_raise_lower_hook = pgtk_frame_raise_lower;
   terminal->frame_visible_invisible_hook = pgtk_make_frame_visible_invisible;
   terminal->fullscreen_hook = pgtk_fullscreen_hook;
   terminal->menu_show_hook = pgtk_menu_show;
-- 
2.31.0


  reply	other threads:[~2021-12-09  2:33 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
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 [this message]
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=20211209.080324.1660570566307266888.enometh@meer.net \
    --to=enometh@meer.net \
    --cc=emacs-devel@gnu.org \
    --cc=luangruo@yahoo.com \
    --cc=masm+emacs@masm11.me \
    --cc=rudalics@gmx.at \
    /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).