From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu Newsgroups: gmane.emacs.devel Subject: Re: master 30dbdecd4a: * src/xterm.c: Add a small writeup on input handling on X. Date: Sat, 15 Jan 2022 18:10:45 +0800 Message-ID: <87sftpb97e.fsf@yahoo.com> References: <164216105411.7395.2418079616938679655@vcs2.savannah.gnu.org> <20220114115054.720EBC0DA2E@vcs2.savannah.gnu.org> <87r19afs1z.fsf@yahoo.com> <658c420a-ed76-8a3d-aaf3-9ee2c0dc8f56@gmx.at> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22562"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.60 (gnu/linux) Cc: emacs-devel@gnu.org To: martin rudalics Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Jan 15 11:15:55 2022 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 1n8g6D-0005dr-90 for ged-emacs-devel@m.gmane-mx.org; Sat, 15 Jan 2022 11:15:53 +0100 Original-Received: from localhost ([::1]:44372 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n8g6C-0002J6-4M for ged-emacs-devel@m.gmane-mx.org; Sat, 15 Jan 2022 05:15:52 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:52948) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n8g1e-000053-T6 for emacs-devel@gnu.org; Sat, 15 Jan 2022 05:11:14 -0500 Original-Received: from sonic308-56.consmr.mail.ne1.yahoo.com ([66.163.187.31]:35537) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n8g1a-0001Pn-QA for emacs-devel@gnu.org; Sat, 15 Jan 2022 05:11:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1642241454; bh=d4hSPeeKLAVxn/OuooMIOJ8k/ykS9gAmONhcUnPjw2s=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=im9qztYO92G4QAxthEkLkV2dkMGRaH2+7hECAnVNeP8t+zVG9lpySizpddnjM0++Ve6wG0rlBvG/jPkR8Iv/+85heBu/weAEyFDUdnpOJRHlqXKR8CGyhsJ43jNmNavDoUaUHWoYqM9huc8676nXppV9Dz50XdIBeMaDQXKYIQ7Uy3Fmot9xWZ1xkGXJZ9g0ykWrNTmQ9lAgY9Hwq3EkEFOwNnKO8mj13xxJLS0DHFWilGdp5Q4aNq/7Z6CQE4ZhIc2lEQRpThqslhCQiGJS6pEQeqVnWWJNz5FV+zK2oCf3Kybs676Cxw13pUn/uj3hilmWIPT/b5VrFffl0PYCng== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1642241454; bh=d5MWb9g+GR+1SumW5VJOwT7uJdbvBJHvGnoT4MfLwHJ=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=GlBrhcAdhQyDJ//v1zphX6uloJczt4CYBU+bZJCDRV61Km4HNbEv1KCkpDIRNUpMf/Gu9ahiSChp+pZBX5R4woP0ByDEv9fnXdHTG49S3n++s5f3w2jrZmb23MFUsJinSWESBnVwaO9WzL0od11iURN3lg+XnGJxFERiOkh1PmchHDMB0MI7qgHYER/HNUCEHDde+iLihqKN6oy/Gy8U7BvC2OUEtKW4jqVl0C97ZxOmmVqNldCG5OGExTQLu0m6X+2m0o3xUFBMQAF8ePdhcE2Cl7PpvqR98G83BoK3G0PNVK7zY9wreAbmFwqe0EvWERzy2DtjZS30cMDhSWfdrA== X-YMail-OSG: i3HWZNMVM1k.qzEXPUNfD1Us4BO1zTsb0YsvIBi.XfOCj.Dd1XNwbF971w_qP01 so0VAQVKLyi9iViAMWJ4DrXz3WzCYT3HdR_OD109.8XnL_3XZ_lQ2R9RE73PaHZQpIUmlS4s4XRV yubGOP73UGSOJOFrbUhgRZQQojr_1DV6rsn5B83Jm_1kKOpkMFefL.HE4e_R68UCLb7f_qiKcmO. Xb_8UEI2cNZI2.YWw0sLINxiiU0l6brZxA3ebygeZTGJCkuVI0hScsG92Lts4ZF1dbybXBYvndj8 FjV_UgSQ7BtCnezSkzpC8uesKq4b1WwZxc1BKOZcYCK5B856okxC25usgs1IDgf2MOLGQH0fBTI_ _by3m6F3pB5f8R20l5fsPpILr2Hz0FJMdyF_cWwKpdxtmO34tvL4CRkTa.IAH93Zbf1w_iBwemFM Vnnc51R1KYq_7jACESCdP1oAG9hvxI7jmNbmq5VEXFXPCp9ODUD9WduD3wdZree1UVv0sOQT1vPs 2c0jZNSscivFyng19uihMjhfBZncSKv5NHpdWBHGXwfHAfjY2HJnYz7oRPpbBVFIJ3IFlWmF4irE C7eg3ARGGsA21.ISZ5y59yQ7.6ktLFaowZyhpeLO.acCb7d65ea1YZP.6qXZmFjOpKpne6V.Qade 9agMPhX8q1p.kBbvUY.okKWRJloTxjgGhT4AmaJHNKD.raRx9tp_3uXEKX2OFe.rB5uuHj40RwUT IZB6SJL60T.mPIX1gM2oHYoKLN58yyLuA92mZY0bQKvDZXmPOrlPMGNpQ180mGGKArGMTqeC2R8_ CUd4L8NsnEXXWT5zOPDhGRBs5Qh.cgTHHsaboHIuEm X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic308.consmr.mail.ne1.yahoo.com with HTTP; Sat, 15 Jan 2022 10:10:54 +0000 Original-Received: by kubenode510.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 51997be4eec4082883af94444a252bdd; Sat, 15 Jan 2022 10:10:49 +0000 (UTC) In-Reply-To: <658c420a-ed76-8a3d-aaf3-9ee2c0dc8f56@gmx.at> (martin rudalics's message of "Sat, 15 Jan 2022 10:31:17 +0100") X-Mailer: WebService/1.1.19594 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Received-SPF: pass client-ip=66.163.187.31; envelope-from=luangruo@yahoo.com; helo=sonic308-56.consmr.mail.ne1.yahoo.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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:284771 Archived-At: martin rudalics writes: > I can do that but note that most of the frame resizing code is shared > among X and other backends - in particular, the necessity to call > change_frame_size, set delayed_size_change there, call adjust_frame_size > eventually ... I think xterm.c is still the right place to put that information, since xterm is essentially the reference implementation for an Emacs window system. > Can you see any necessity to call widget_update_wm_size_hints here? Yes. Xt has its own idea about size hints, and bad things will happen if Xt doesn't know about them. Ideally, we would actually just set the size hints on the EmacsShell widget (that is the WMShell, since EmacsShell extends ApplicationShell, which subclasses WMShell), and rely on Xt to do the heavy lifting. I will give that a look soon enough. > The second question is with XSetWMSizeHints in emacsgtkfixed.c: _My_ > version of its starts as > > /* Override the X function so we can intercept Gtk+ 3 calls. > Use our values for min_width/height so that KDE don't freak out > (Bug#8919), and so users can resize our frames as they wish. > > 2021 REMIX: But do override only if x_gtk_override_size_hints is true > (the default). If x_gtk_override_size_hints is false, proceed with > the original specification so shrinking frames with a specified > minimum size works as intended (Bug#46963) and Emacs is always > informed of the real sizes the WM reserves for its windows. > > We really should default x_gtk_override_size_hints to nil by default, > but this can be done only after sufficient experience has been > gathered, in particular on KDE. Ideally, the code below will be > dropped, the sooner the better. */ > > void > XSetWMSizeHints (Display *d, Window w, XSizeHints *hints, Atom prop) > { > struct x_display_info *dpyinfo = x_display_info_for_display (d); > struct frame *f = x_top_window_to_frame (dpyinfo, w); > long data[18]; > > data[0] = hints->flags; > ... > data[17] = hints->win_gravity; > > if (x_gtk_override_size_hints && hints->flags & PMinSize && f) > { > #ifdef HAVE_PGTK > int w = f->output_data.pgtk->size_hints.min_width; > int h = f->output_data.pgtk->size_hints.min_height; > #else > int w = f->output_data.x->size_hints.min_width; > int h = f->output_data.x->size_hints.min_height; > #endif > data[5] = w; > data[6] = h; > } > > Do you think we could eventually drop that overriding code invented by > Jan back then? Yes, I think we could (and should). But I would introduce that option first, ask most of the the people tracking master to set it to nil, and if it seems okay after a year or two to then delete the code entirely. > BTW one of these > > #ifndef HAVE_PGTK > #ifdef HAVE_PGTK > #else > #endif > #endif > > in that code should be eliminated - but I don't know which. #ifdef HAVE_PGTK int w = f->output_data.pgtk->size_hints.min_width; int h = f->output_data.pgtk->size_hints.min_height; #else int w = f->output_data.x->size_hints.min_width; int h = f->output_data.x->size_hints.min_height; #endif Should be replaced by the contents of the !HAVE_PGTK branch, since no X function is overridden on PGTK. Thanks.