From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alan Third Newsgroups: gmane.emacs.bugs Subject: bug#28512: 26.0.60; undecorated frames on macOS 10.13 do not resize properly Date: Mon, 16 Oct 2017 21:46:31 +0100 Message-ID: <20171016204631.GA44072@breton.holly.idiocy.org> References: <20170924210548.GA31821@breton.holly.idiocy.org> <20170925101320.GA42266@breton.holly.idiocy.org> <20170925163301.GB45550@breton.holly.idiocy.org> <20171016100119.GA41757@breton.holly.idiocy.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="jI8keyz6grp/JLjh" Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1508186953 9040 195.159.176.226 (16 Oct 2017 20:49:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 16 Oct 2017 20:49:13 +0000 (UTC) User-Agent: Mutt/1.9.0 (2017-09-02) Cc: 28512@debbugs.gnu.org To: Aaron Jensen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Oct 16 22:49:04 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e4CJh-0000G8-RQ for geb-bug-gnu-emacs@m.gmane.org; Mon, 16 Oct 2017 22:48:54 +0200 Original-Received: from localhost ([::1]:35203 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4CJp-0003Ye-Ag for geb-bug-gnu-emacs@m.gmane.org; Mon, 16 Oct 2017 16:49:01 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53353) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4CHx-000209-Nx for bug-gnu-emacs@gnu.org; Mon, 16 Oct 2017 16:47:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e4CHu-0000RZ-JF for bug-gnu-emacs@gnu.org; Mon, 16 Oct 2017 16:47:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:35638) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e4CHu-0000RK-DK for bug-gnu-emacs@gnu.org; Mon, 16 Oct 2017 16:47:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1e4CHt-00057F-VQ for bug-gnu-emacs@gnu.org; Mon, 16 Oct 2017 16:47:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Third Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 16 Oct 2017 20:47:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28512 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 28512-submit@debbugs.gnu.org id=B28512.150818680219635 (code B ref 28512); Mon, 16 Oct 2017 20:47:01 +0000 Original-Received: (at 28512) by debbugs.gnu.org; 16 Oct 2017 20:46:42 +0000 Original-Received: from localhost ([127.0.0.1]:44319 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e4CHZ-00056d-RF for submit@debbugs.gnu.org; Mon, 16 Oct 2017 16:46:42 -0400 Original-Received: from mail-wr0-f171.google.com ([209.85.128.171]:49315) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e4CHY-00056Q-F9 for 28512@debbugs.gnu.org; Mon, 16 Oct 2017 16:46:41 -0400 Original-Received: by mail-wr0-f171.google.com with SMTP id g90so3196501wrd.6 for <28512@debbugs.gnu.org>; Mon, 16 Oct 2017 13:46:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=MVv9Qn1VmMtBm6FJSUwF5AIvI4m5su9uR0vBEWEaC/Q=; b=NZxyShCR1YdH/3REiZbtXSBAtdg0bzA79fs2J5zOqjxHLElRA1PTAT9LlqQ9Dswuhz rN831TIYjFdlbQnpnpuawOmno+G2PUG9nIYWVZAZO0L/Ar+8Wb/YlBQTuArMnKHesR9S yxAD7pQRnuvcChqbOp3RiBFPPIaVWATdEps859VVb+e4/sj6Uc7VGslQZa3KJpUEj1yQ 54YKOVoY1K6/dtpigZu4QuN7g9oR2p0Ej+FHJGRqaSWXmG4qAkb3XTDHW8rh975WYyKk ramUZuY9Rl7juXrTNeFRqA6JqAYX7letblOepSeJNZ2flzrn0ViBQeXFCPCBsG2dFpkH ATXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=MVv9Qn1VmMtBm6FJSUwF5AIvI4m5su9uR0vBEWEaC/Q=; b=Ar67ZyBA1aecxyGo+ZFobS5jw0yE2rrlwxe2/jsdDvo7Rmo4Ciwqkepxl8FDp5yPem ySC4KRkK8gH2nE1h/n1cK+TrDfb0hDEvichXSFmSasjMuRLJFG8V+ZwbGMb8y2SX8hZS 19K6jz/SA82+ceLbJ9S7i/V+v+F04Nhnbm7d5Prxtf1a8yVTtl6NcEA4aKzwFo5m5olc sQAjmui3bEOcD8GWgWfD6/4zhvt4kKfAB3geX/kVwvbwGQnVFr1uR+ePBwbp70Fb+uKR DNyw9ydAYW74OeWB74C1PR5b0HSP6CF3bXiNnYnCQp7Zkq6dX23ClbTKGI7nfoqKTroh OWxA== X-Gm-Message-State: AMCzsaVhTv3rLag3weUWtlqVOiVCcIV5PKk/VCPiK7mlVufVVdmS6EfA lJAD3EXnKO1P0wdb+e0y9tzcoNIf X-Google-Smtp-Source: ABhQp+QjmTiVcKP0SKxV4KEN2/eM49tmaodu6Ahm2DiIolMbH2J9FOtFeQwMeayObJT7l1U1OtjVqw== X-Received: by 10.223.131.65 with SMTP id 59mr1535255wrd.66.1508186794588; Mon, 16 Oct 2017 13:46:34 -0700 (PDT) Original-Received: from breton.holly.idiocy.org (ip6-2001-08b0-03f8-8129-dcdc-51e0-14de-5471.holly.idiocy.org. [2001:8b0:3f8:8129:dcdc:51e0:14de:5471]) by smtp.gmail.com with ESMTPSA id j13sm4364423wrb.18.2017.10.16.13.46.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Oct 2017 13:46:33 -0700 (PDT) Content-Disposition: inline In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:138550 Archived-At: --jI8keyz6grp/JLjh Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit On Mon, Oct 16, 2017 at 08:49:07AM -0400, Aaron Jensen wrote: > On October 16, 2017 at 3:01:14 AM, Alan Third > (alan@idiocy.org(mailto:alan@idiocy.org)) wrote: > > > > 1. Is it possible to create the first frame with undecorated set? > > > > So create the window undecorated, then immediately switch it to > > decorated? > > What I meant was how do I start emacs while telling it to create its > initial frame undecorated if that’s my desire. Setting > `initial-display-alist` to include `(undecorated . t)` in `init.el` > seems to be insufficient, because the frame appears to be created > prior to `init.el` being eval’d. I don’t know for sure, but suspect the answer is that you can’t do that. > > > 2. Would it be difficult to recreate the NSWindow housing the frame > > > when that frame parameter is changed? > > > > I’m not sure. I’ll have to go and have a look. Before I try coding this up, can you try a couple of things for me? It could be that changing individual bits of styleMask is the wrong way to do things, so can you please try the attached patch? If it doesn’t work can you change FRAME_UNDECORATED_FLAGS back to: #define FRAME_UNDECORATED_FLAGS NSWindowStyleMaskBorderless and see if you can resize the frame using lisp? -- Alan Third --jI8keyz6grp/JLjh Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="undecorated.patch" diff --git a/src/nsterm.m b/src/nsterm.m index 0b43c04c0b..e6f650467d 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -429,15 +429,13 @@ - (NSColor *)colorUsingDefaultColorSpace These flags will be OR'd or XOR'd with the NSWindow's styleMask property depending on what we're doing. */ -#ifdef NS_IMPL_COCOA -#define FRAME_DECORATED_FLAGS NSWindowStyleMaskTitled -#else #define FRAME_DECORATED_FLAGS (NSWindowStyleMaskTitled \ | NSWindowStyleMaskResizable \ | NSWindowStyleMaskMiniaturizable \ | NSWindowStyleMaskClosable) -#endif -#define FRAME_UNDECORATED_FLAGS NSWindowStyleMaskBorderless +#define FRAME_UNDECORATED_FLAGS (NSWindowStyleMaskResizable \ + | NSWindowStyleMaskMiniaturizable \ + | NSWindowStyleMaskClosable) /* TODO: get rid of need for these forward declarations */ static void ns_condemn_scroll_bars (struct frame *f); @@ -1883,8 +1881,7 @@ -(void)remove if (NILP (new_value)) { FRAME_UNDECORATED (f) = false; - [window setStyleMask: ((window.styleMask | FRAME_DECORATED_FLAGS) - ^ FRAME_UNDECORATED_FLAGS)]; + [window setStyleMask: FRAME_DECORATED_FLAGS]; [view createToolbar: f]; } @@ -1894,8 +1891,7 @@ -(void)remove /* Do I need to release the toolbar here? */ FRAME_UNDECORATED (f) = true; - [window setStyleMask: ((window.styleMask | FRAME_UNDECORATED_FLAGS) - ^ FRAME_DECORATED_FLAGS)]; + [window setStyleMask: FRAME_UNDECORATED_FLAGS]; } /* At this point it seems we don't have an active NSResponder, --jI8keyz6grp/JLjh--