From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?UTF-8?Q?Cl=c3=a9ment_Pit--Claudel?= Newsgroups: gmane.emacs.devel Subject: Re: Creating a "borderless" frame (without WM chrome) (was Re: Could x-show-tip be reimplemented in Elisp? How does one create borderless frames from Elisp?) Date: Wed, 17 Feb 2016 09:55:55 -0500 Message-ID: <56C489FB.7050506@gmail.com> References: <56BDF3DE.2050704@gmail.com> <56BEA48F.9020400@gmail.com> <56C382C7.8080306@gmail.com> <56C3A8D7.9010207@gmail.com> <56C3B4CD.5020404@gmail.com> <56C439AD.9040002@gmx.at> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="AGBMc59cgi6uE55ExDRCrAcXA78PUbnCU" X-Trace: ger.gmane.org 1455720994 2958 80.91.229.3 (17 Feb 2016 14:56:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 17 Feb 2016 14:56:34 +0000 (UTC) Cc: emacs-devel To: Chris Feng , martin rudalics Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Feb 17 15:56:25 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aW3Wi-0002ro-Rl for ged-emacs-devel@m.gmane.org; Wed, 17 Feb 2016 15:56:25 +0100 Original-Received: from localhost ([::1]:58188 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aW3Wf-0000o6-1W for ged-emacs-devel@m.gmane.org; Wed, 17 Feb 2016 09:56:21 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48532) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aW3WN-0000mm-U1 for emacs-devel@gnu.org; Wed, 17 Feb 2016 09:56:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aW3WI-000782-Ly for emacs-devel@gnu.org; Wed, 17 Feb 2016 09:56:03 -0500 Original-Received: from mout.kundenserver.de ([212.227.126.134]:49576) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aW3WI-00077P-CW for emacs-devel@gnu.org; Wed, 17 Feb 2016 09:55:58 -0500 Original-Received: from [18.189.87.242] ([18.189.87.242]) by mrelayeu.kundenserver.de (mreue001) with ESMTPSA (Nemesis) id 0LyeMJ-1ZsAdH3o9P-016AlC; Wed, 17 Feb 2016 15:55:57 +0100 X-Enigmail-Draft-Status: N1110 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 In-Reply-To: X-Provags-ID: V03:K0:IOVDRZZjRqWZWxA9hu85CdKi4+AkHZfARKaD/sY+3G50zX1jWbw O25nLhm6H6HpotftiCtEOaLrHH8f7ZVDN0jOKP0a6vFbH3dFqsn7EgLQ9ZQGbq1klUJHtH8 S2sBAus1zBPFCPkulKZW+WTFwZHxyGGBGu8c13mhiAlIxhEuGSd8cuqjQ/EIUKZWzyJXHdu byDZ/yvid5NvyRCq9koKQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:pzNHeohFZ/k=:CDzNBy9YlkLwCPMAXJqm3F mKCaLL3RUYtg+Ch6k7nYiWz6M7GA1JqaRfybxFNw5TPWeTEeNGx3rvgjEyB2AR52XFuccrpzf yizv7FL4By2iEe0ldTRiqV6JWGjOFhwv8/hwsUWCwrN7Kf47qxtPgoBB5FCHpyXCPBpjEg0oX KjsZbRbT8ymcgBfAzvtmXarSNTZketnaM31nuc2XZYTL4I1KE7tptZ9N4vUl4mTPx0FL6BAvn byLxSFGbT9Sh6rD43o2iRv5xONzQIb6PBvaVYYvXnk2RRpZoaD0GX9Q2v0fhzmGfFoyX8uSfS 6969FcdwaqSBdKPH60MZRqv7DSIME5R/LcUAiylav/bw7LOFHLc2LK0mzyvdjZsbXZY1SdbLW p8vLSP0QzxpraalicWgb5NiWR4/vgpLwbpEfaWlVjRfhlWHTV6TvGB1l3lEedn2Q5Aqxz1xGI a49Qu8IC5D6xYVbdjK9+eHaVElVVTTkXmVjbHiWIreh1fOnIlXAVOhzMWERi4mQbpgMJf3Row L/kRvt3aJwbHgXNV9wpoGFNgLZboeo4X0for1TjtpgFJakU5hrmiARwl9Yi/tpjSlkpcBj4XW cfbSkePtn5bWUFDhBnUWrQyhz1ln0My7k1mHfsIC1/Z5Ttyfi8GDiy9LhQ5NAWn1iYixiH07y O2+4FCnHYqZBwgf5r6Sqd9w+0ibDbOlEmJmSq726g+Rw1VAKMdZ2o5px9ykrfHH/vink= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.126.134 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:200084 Archived-At: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --AGBMc59cgi6uE55ExDRCrAcXA78PUbnCU Content-Type: multipart/mixed; boundary="------------080904080002040404020503" This is a multi-part message in MIME format. --------------080904080002040404020503 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 02/17/2016 08:49 AM, Chris Feng wrote: >>> * add a frame parameter to frame_parms in frame.c, say "chromeless" >> >> I'd prefer "decorated" as in gtk_window_set-decorated. >=20 > Agree. We call it "decoration" in X almost exclusively. >=20 >>> * add an x_set_chromeless slot in each of frame_parm_handler >>> x_frame_parm_handlers[], frame_parm_handler w32_frame_parm_handlers[]= , >>> frame_parm_handler ns_frame_parm_handlers[]; for the last two point t= o 0 for >>> now; for the first one point to a new function x_set_chromeless. >>> * In x-create-frame, add something like >>> x_default_parameter (f, parms, Qchromeless, Qnil, >>> "chromeless", "Chromeless", RES_TYPE_BOOLEA= N); >=20 > I don't think we need to make this customizable through X resources, > so the fifth and sixth parameters to x_default_parameter should be > NULL. Thanks. I've attached a rough patch draft (that is, frames are decorated = by default, but (make-frame '((decorated . nil))) creates an undecorated = frame), which works with --with-x-toolkit=3Dnone. >> For X I doubt that it's always possible to add/remove the decorations = of >> an existing frame. >=20 > Yes but it may require remapping if it's already mapped. Got it; is this why the attached patch doesn't do anything with Gtk? I lo= oked at the Xlib documentation, but I'm not sure how to check if the wind= ow is already mapped, and only remap it in that case. Cheers, Cl=C3=A9ment. --------------080904080002040404020503 Content-Type: text/x-diff; name="0001-Prototype-for-undecorated-frames.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="0001-Prototype-for-undecorated-frames.patch" =46rom e4cd5c03947a29e73fe7d75167a12ef0b2ed55f3 Mon Sep 17 00:00:00 2001 From: =3D?UTF-8?q?Cl=3DC3=3DA9ment=3D20Pit--Claudel?=3D Date: Tue, 16 Feb 2016 18:49:57 -0500 Subject: [PATCH] Prototype for undecorated frames Only works with --with-x-toolkit=3Dnone --- src/frame.c | 2 ++ src/nsfns.m | 1 + src/w32fns.c | 1 + src/xfns.c | 14 ++++++++++++++ 4 files changed, 18 insertions(+) diff --git a/src/frame.c b/src/frame.c index 8c86afe..0c74dce 100644 --- a/src/frame.c +++ b/src/frame.c @@ -3065,6 +3065,7 @@ static const struct frame_parm_table frame_parms[] = =3D {"fullscreen", SYMBOL_INDEX (Qfullscreen)}, {"font-backend", SYMBOL_INDEX (Qfont_backend)}, {"alpha", SYMBOL_INDEX (Qalpha)}, + {"decorated", SYMBOL_INDEX (Qdecorated)}, {"sticky", SYMBOL_INDEX (Qsticky)}, {"tool-bar-position", SYMBOL_INDEX (Qtool_bar_position)}, }; @@ -4982,6 +4983,7 @@ syms_of_frame (void) #endif =20 DEFSYM (Qalpha, "alpha"); + DEFSYM (Qdecorated, "decorated"); DEFSYM (Qauto_lower, "auto-lower"); DEFSYM (Qauto_raise, "auto-raise"); DEFSYM (Qborder_color, "border-color"); diff --git a/src/nsfns.m b/src/nsfns.m index eda94c4..346c1a6 100644 --- a/src/nsfns.m +++ b/src/nsfns.m @@ -1006,6 +1006,7 @@ frame_parm_handler ns_frame_parm_handlers[] =3D x_set_fullscreen, /* generic OK */ x_set_font_backend, /* generic OK */ x_set_alpha, + 0, /* x_set_decorated */ 0, /* x_set_sticky */ 0, /* x_set_tool_bar_position */ }; diff --git a/src/w32fns.c b/src/w32fns.c index a5018ae..226246b 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -9258,6 +9258,7 @@ frame_parm_handler w32_frame_parm_handlers[] =3D x_set_fullscreen, x_set_font_backend, x_set_alpha, + 0, /* x_set_decorated */ 0, /* x_set_sticky */ 0, /* x_set_tool_bar_position */ }; diff --git a/src/xfns.c b/src/xfns.c index 20ac627..56bae7ce 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -3511,6 +3511,8 @@ This function is an internal primitive--use `make-f= rame' instead. */) RES_TYPE_NUMBER); x_default_parameter (f, parms, Qalpha, Qnil, "alpha", "Alpha", RES_TYPE_NUMBER); + x_default_parameter (f, parms, Qdecorated, Qt, + NULL, NULL, RES_TYPE_BOOLEAN); =20 #if defined (USE_X_TOOLKIT) || defined (USE_GTK) /* Create the menu bar. */ @@ -5773,6 +5775,17 @@ compute_tip_xy (struct frame *f, Lisp_Object parms= , Lisp_Object dx, Lisp_Object *root_x =3D min_x; } =20 +void +x_set_decorated (struct frame *f, Lisp_Object new_value, Lisp_Object old= _value) +{ + XSetWindowAttributes attributes; + attributes.override_redirect =3D NILP(new_value) ? True : False; + + block_input (); + XChangeWindowAttributes (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), + CWOverrideRedirect, &attributes); + unblock_input (); +} =20 DEFUN ("x-show-tip", Fx_show_tip, Sx_show_tip, 1, 6, 0, doc: /* Show STRING in a "tooltip" window on frame FRAME. @@ -6791,6 +6804,7 @@ frame_parm_handler x_frame_parm_handlers[] =3D x_set_fullscreen, x_set_font_backend, x_set_alpha, + x_set_decorated, x_set_sticky, x_set_tool_bar_position, }; --=20 2.7.1 --------------080904080002040404020503-- --AGBMc59cgi6uE55ExDRCrAcXA78PUbnCU Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAEBAgAGBQJWxIn7AAoJEPqg+cTm90wjtOIP/A0lbCqRBQig8J6vI33pANdK Me86dxywQBSVMBA4tVvDQhzjoylWGmppgkLchlqbY6mSd8dprCg4wlcai1nl6leK oiay59SAEjoYcOdk4XwZ6BHq8vfX0lowUI3iWNZShpliMM9iCqXNW3qtGyqFClFj tGyUkY7sDzhEaC1zRAv4LpBCqgChg0xa1enffe3Ezpc5wTbmJ94zvL5P1SE8jsEE V7MW/RBBulkE01O15/KwM53x93GcZ3R7h3mhImOmVV99af6xcFns+yncEzMhuC5U wWYgIYFaTdWDsu9oUCYRwgW0OtgxCXS+1r6USCEA0MlKVHfGIyJTxl3HRKecVnsT 3v6w5sq080YU7ZPQbMMI2Ot0qaRxSBWsQWtS8VfcxCiiJuPW+i5uixkonX6RYLpD 9Oj1OX2xg3WSz6bzFI5HZxjvg4B9qdFEiSeqv9If9enNGMFaqahyjx6l7gu34i80 DrFOw8BOOhg43oOrArAA/U4sQkf6kZv5KpJHmRFWEQlFGrmyR9V0xXEmQpFj+zn3 WI/1XBv8k/yz4MAtXln8Ub1aqXEe1tOG/FOumbhJPwUHLDQ/QK6lgk+jPtaFHq7K uN+Va8qpYfBar0Vmpwsi/UqwYlvACEYkcjRhGkui00grVDNyGhOe6z4hCzmwByZe 8dChUgo+9XzQCyWI28di =see4 -----END PGP SIGNATURE----- --AGBMc59cgi6uE55ExDRCrAcXA78PUbnCU--