From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Madhu Newsgroups: gmane.emacs.devel Subject: Re: Deiconifying GTK frames on GNOME shell Date: Thu, 09 Dec 2021 08:03:24 +0530 (IST) Message-ID: <20211209.080324.1660570566307266888.enometh@meer.net> References: <87ilvze4k5.fsf@yahoo.com> <20211208.220328.997529211206116189.enometh@meer.net> <87ee6md3g9.fsf@yahoo.com> Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="--Next_Part(Thu_Dec__9_08_03_24_2021_855)--" Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10112"; mail-complaints-to="usenet@ciao.gmane.io" Cc: rudalics@gmx.at, masm+emacs@masm11.me, emacs-devel@gnu.org To: luangruo@yahoo.com Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Dec 09 03:34:43 2021 Return-path: Envelope-to: ged-emacs-devel@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 1mv9Gd-0002Nw-2w for ged-emacs-devel@m.gmane-mx.org; Thu, 09 Dec 2021 03:34:43 +0100 Original-Received: from localhost ([::1]:52932 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mv9Gb-0000OD-AU for ged-emacs-devel@m.gmane-mx.org; Wed, 08 Dec 2021 21:34:41 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:46464) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mv9Fx-00088J-RV for emacs-devel@gnu.org; Wed, 08 Dec 2021 21:34:01 -0500 Original-Received: from smtp6.ctinetworks.com ([205.166.61.199]:45706) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mv9FC-0005Mq-38 for emacs-devel@gnu.org; Wed, 08 Dec 2021 21:34:00 -0500 Original-Received: from localhost (unknown [117.254.35.185]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: enometh@meer.net) by smtp6.ctinetworks.com (Postfix) with ESMTPSA id 81C7F84C7D; Wed, 8 Dec 2021 21:33:03 -0500 (EST) In-Reply-To: <87ee6md3g9.fsf@yahoo.com> X-Mailer: Mew version 6.8 on Emacs 29.0.50 X-ctinetworks-Information: Please contact the ISP for more information X-ctinetworks-MailScanner-ID: 81C7F84C7D.A8E21 X-ctinetworks-VirusCheck: Found to be clean X-ctinetworks-Watermark: 1639881192.9252@sGx1/vU0wLPoMIOWn0ACvg Received-SPF: pass client-ip=205.166.61.199; envelope-from=enometh@meer.net; helo=smtp6.ctinetworks.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:281425 Archived-At: ----Next_Part(Thu_Dec__9_08_03_24_2021_855)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit * Po Lu <87ee6md3g9.fsf@yahoo.com> Wrote on Thu, 09 Dec 2021 08:31:02 +0800 > Madhu 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 ----Next_Part(Thu_Dec__9_08_03_24_2021_855)-- Content-Type: Text/X-Patch; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="0001-src-pgtkterm.c-implement-frame-raise-lower-FAIL.patch" >From e304e644aeab0732ebe3f6891e155d0939575122 Mon Sep 17 00:00:00 2001 From: Madhu 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 ----Next_Part(Thu_Dec__9_08_03_24_2021_855)----