From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?=EC=A1=B0=EC=84=B1=EB=B9=88?= Newsgroups: gmane.emacs.bugs Subject: bug#58271: 29.0.50; [PATCH] Handle sharing Cocoa xwidgets more gracefully Date: Mon, 3 Oct 2022 18:32:20 +0900 Message-ID: <3B2D7E85-0137-4460-B182-F7F5F39A192E@daum.net> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.200.92\)) Content-Type: multipart/mixed; boundary="Apple-Mail=_3A5F2BCA-C58A-402B-AAB4-C04ECABE5A49" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38404"; mail-complaints-to="usenet@ciao.gmane.io" To: 58271@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Oct 03 16:25:49 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1ofMOD-0009oa-F2 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 03 Oct 2022 16:25:49 +0200 Original-Received: from localhost ([::1]:49538 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ofMOC-0003rv-Gy for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 03 Oct 2022 10:25:48 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57782) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ofMIc-0006t7-Cq for bug-gnu-emacs@gnu.org; Mon, 03 Oct 2022 10:20:07 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52405) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ofMIc-0007HW-33 for bug-gnu-emacs@gnu.org; Mon, 03 Oct 2022 10:20:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ofMIb-0007na-UO for bug-gnu-emacs@gnu.org; Mon, 03 Oct 2022 10:20:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?=EC=A1=B0=EC=84=B1=EB=B9=88?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 03 Oct 2022 14:20:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 58271 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.166480675429843 (code B ref -1); Mon, 03 Oct 2022 14:20:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 3 Oct 2022 14:19:14 +0000 Original-Received: from localhost ([127.0.0.1]:51465 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ofMHo-0007lB-HI for submit@debbugs.gnu.org; Mon, 03 Oct 2022 10:19:14 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:44738) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ofHon-000134-Vo for submit@debbugs.gnu.org; Mon, 03 Oct 2022 05:32:58 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53550) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ofHoj-0002MC-1Q for bug-gnu-emacs@gnu.org; Mon, 03 Oct 2022 05:32:57 -0400 Original-Received: from mail-smail-vm101.daum.net ([211.231.106.176]:12217 helo=mail-smail-vm101.hanmail.net) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ofHoc-0001dD-Gu for bug-gnu-emacs@gnu.org; Mon, 03 Oct 2022 05:32:52 -0400 Original-Received: from mail-hmail-smtp1 ([10.194.31.49]) by mail-smail-vm101.hanmail.net (8.13.8/8.9.1) with SMTP id 2939WVHJ016092; Mon, 3 Oct 2022 18:32:31 +0900 X-Kakaomail-MID: CsIfMQAAJDIAAAGDnTCWfgADZpI= X-Hermes-Message-Id: q93IWUizd1206118983 X-Originating-IP: 1.230.108.64 Original-Received: from mail-qpsmtp-vm9 ([10.61.241.136]) by hermes of mail-hmail-smtp1 (10.194.31.49) with ESMTP id q93IWUizd1206118983 for ; Mon, 03 Oct 2022 18:32:30 +0900 (KST) Original-Received: from [1.230.108.64] (HELO smtpclient.apple) (1.230.108.64) by (8.12.9/8.9.1) with ESMTPA; Mon, 03 Oct 2022 18:32:30 +0900 Authentication-Results: mail-qpsmtp-vm9; auth=pass (plain) smtp.auth=goranmoomin@daum.net X-Mailer: Apple Mail (2.3731.200.92) X-HM-UT: uZgUAxfuZctRLmiSmPa88DOPNRA+bHyTw3HQj6tM3jc= Received-SPF: pass client-ip=211.231.106.176; envelope-from=goranmoomin@daum.net; helo=mail-smail-vm101.hanmail.net X-Spam_score_int: 17 X-Spam_score: 1.7 X-Spam_bar: + X-Spam_report: (1.7 / 5.0 requ) BAYES_40=-0.001, FREEMAIL_FROM=0.001, KHOP_HELO_FCRDNS=0.399, RCVD_IN_VALIDITY_RPBL=1.31, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Mon, 03 Oct 2022 10:19:11 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:244307 Archived-At: --Apple-Mail=_3A5F2BCA-C58A-402B-AAB4-C04ECABE5A49 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Severity: normal Tags: patch The previous implementation of Cocoa xwidgets poorly handled cases where = the user tried to share xwidgets between multiple views (by spamming = messages to *Messages* on every redisplay, and not drawing anything on the second = xwidget). The attached patch fixes this issue by showing a warning label in the = place of the xwidget view. --Apple-Mail=_3A5F2BCA-C58A-402B-AAB4-C04ECABE5A49 Content-Disposition: attachment; filename=0001-Handle-sharing-Cocoa-xwidgets-more-gracefully.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0001-Handle-sharing-Cocoa-xwidgets-more-gracefully.patch" Content-Transfer-Encoding: quoted-printable =46rom=20ea24ca5d49bb0c1d09be98ab032bbc50668ae627=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20VirtualBuddy=20= =0ADate:=20Mon,=203=20Oct=202022=20= 17:32:45=20+0900=0ASubject:=20[PATCH]=20Handle=20sharing=20Cocoa=20= xwidgets=20more=20gracefully=0A=0A*=20etc/NEWS:=20Mention=20fix.=0A*=20= src/nsxwidget.h:=20Remove=20now-unused=20NSView=20subclasses=20and=20= functions.=0A*=20src/nsxwidget.m:=0A([XwWebView=20mouseDown:],=20= [XwWebView=20mouseUp:],=20[XwWebView=20keyDown:])=0A([XwWebView=20= userContentController:didReceiveScriptMessage:]):=20Rename=20field=20of=0A= xwidget_view=20from=20emacswindow=20to=20emacsFrame=20to=20better=20= match=20emacs=20terminology.=0A(nsxwidget_init,=20nsxwidget_resize_view,=20= nsxwidget_move_widget_in_view):=0ASimplify=20logic=20by=20removing=20= field=20xwWindow=20and=20using=20the=20xvWindow=20as=20the=0Acontainer.=0A= (nsxwidget_resize,=20XwWindow,=20XvWindow):=20Remove=20now-unused=20= code.=0A(nsxwidget_init_view,=20nsxwidget_delete_view):=20Handle=20= creating=20non-primary=0Axwidget=20views.=0A(nsxwidget_show_view,=20= nsxwidget_hide_view):=20Remove=20poor=20hack=20to=20hide=20views.=0A*=20= src/xwidget.c=20(xwidget_init_view):=20Update=20formatting.=0A= (x_draw_xwidget_glyph_string):=20Handle=20displaying=20non-primary=20= xwidget=20views=20and=0Aremove=20previous=20message=20warning.=0A= (Fxwidget_resize):=20Remove=20useless=20call=20to=20nsxwidget_resize,=20= as=20the=20subsequent=0Aredisplay=20handles=20them=20via=20= nsxwidget_resize_view.=0A*=20src/xwidget.h=20(struct=20xwidget):=20= Remove=20field=20xwWindow=20and=20update=20comments=0Ato=20be=20more=20= accurate.=0A(struct=20xwidget_view):=20Add=20field=20xvWidget=20and=20= rename=20field=20emacswindow=20to=0AemacsFrame=20to=20better=20match=20= emacs=20terminology.=0A---=0A=20etc/NEWS=20=20=20=20=20=20=20=20|=20=208=20= +++++=0A=20src/nsxwidget.h=20|=2014=20--------=0A=20src/nsxwidget.m=20|=20= 87=20++++++++++++++++++++-----------------------------=0A=20= src/xwidget.c=20=20=20|=2011=20++-----=0A=20src/xwidget.h=20=20=20|=2015=20= ++++-----=0A=205=20files=20changed,=2053=20insertions(+),=2082=20= deletions(-)=0A=0Adiff=20--git=20a/etc/NEWS=20b/etc/NEWS=0Aindex=20= ec23f10b1f..ec85d0ba41=20100644=0A---=20a/etc/NEWS=0A+++=20b/etc/NEWS=0A= @@=20-4016,6=20+4016,14=20@@=20has=20built-in=20support=20for=20= displaying=20BMP=20images.=0A=20---=0A=20***=20'process-attributes'=20is=20= now=20implemented.=0A=20=0A+**=20macOS=0A+---=0A+***=20Attempts=20to=20= share=20an=20xwidget=20is=20now=20handled=20more=20gracefully.=0A= +Attempts=20to=20share=20an=20xwidget=20between=20multiple=20views=20now=20= results=20in=0A+views=20other=20than=20the=20primary=20view=20displaying=20= warnings.=20=20If=20the=20primary=0A+view=20disappears,=20one=20of=20the=20= left=20views=20becomes=20the=20primary=20view=20that=0A+displays=20the=20= widget.=0A+=0A=20=0C=0A=20= ----------------------------------------------------------------------=0A= =20This=20file=20is=20part=20of=20GNU=20Emacs.=0Adiff=20--git=20= a/src/nsxwidget.h=20b/src/nsxwidget.h=0Aindex=20666509744a..f7c744d405=20= 100644=0A---=20a/src/nsxwidget.h=0A+++=20b/src/nsxwidget.h=0A@@=20-42,26=20= +42,12=20@@=20#define=20NSXWIDGET_H_INCLUDED=0A=20=0A=20/*=20Functions=20= for=20xwidget=20model.=20=20*/=0A=20=0A-#ifdef=20__OBJC__=0A-@interface=20= XwWindow=20:=20NSView=0A-@property=20struct=20xwidget=20*xw;=0A-@end=0A= -#endif=0A-=0A=20void=20nsxwidget_init=20(struct=20xwidget=20*xw);=0A=20= void=20nsxwidget_kill=20(struct=20xwidget=20*xw);=0A-void=20= nsxwidget_resize=20(struct=20xwidget=20*xw);=0A=20Lisp_Object=20= nsxwidget_get_size=20(struct=20xwidget=20*xw);=0A=20=0A=20/*=20Functions=20= for=20xwidget=20view.=20=20*/=0A=20=0A-#ifdef=20__OBJC__=0A-@interface=20= XvWindow=20:=20NSView=0A-@property=20struct=20xwidget=20*xw;=0A= -@property=20struct=20xwidget_view=20*xv;=0A-@end=0A-#endif=0A-=0A=20= void=20nsxwidget_init_view=20(struct=20xwidget_view=20*xv,=0A=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= struct=20xwidget=20*xww,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20struct=20glyph_string=20*s,=0Adiff=20= --git=20a/src/nsxwidget.m=20b/src/nsxwidget.m=0Aindex=20= be0eba0bcb..da4069e2f1=20100644=0A---=20a/src/nsxwidget.m=0A+++=20= b/src/nsxwidget.m=0A@@=20-199,13=20+199,13=20@@=20-=20= (void)webView:(WKWebView=20*)webView=0A=20=0A=20-=20= (void)mouseDown:(NSEvent=20*)event=0A=20{=0A-=20=20= [self.xw->xv->emacswindow=20mouseDown:event];=0A+=20=20= [self.xw->xv->emacsFrame=20mouseDown:event];=0A=20=20=20[super=20= mouseDown:event];=0A=20}=0A=20=0A=20-=20(void)mouseUp:(NSEvent=20*)event=0A= =20{=0A-=20=20[self.xw->xv->emacswindow=20mouseUp:event];=0A+=20=20= [self.xw->xv->emacsFrame=20mouseUp:event];=0A=20=20=20[super=20= mouseUp:event];=0A=20}=0A=20=0A@@=20-220,15=20+220,15=20@@=20-=20= (void)keyDown:(NSEvent=20*)event=0A=20=20=20Lisp_Object=20val=20=3D=20= buffer_local_value=20(var,=20Fcurrent_buffer=20());=0A=20=20=20if=20(!EQ=20= (val,=20Qunbound)=20&&=20!EQ=20(val,=20Qnil))=0A=20=20=20=20=20{=0A-=20=20= =20=20=20=20[self.window=20makeFirstResponder:self.xw->xv->emacswindow];=0A= -=20=20=20=20=20=20[self.xw->xv->emacswindow=20keyDown:event];=0A+=20=20=20= =20=20=20[self.window=20makeFirstResponder:self.xw->xv->emacsFrame];=0A+=20= =20=20=20=20=20[self.xw->xv->emacsFrame=20keyDown:event];=0A=20=20=20=20=20= =20=20return;=0A=20=20=20=20=20}=0A=20=0A=20=20=20/*=20Emacs=20handles=20= keyboard=20events=20when=20javascript=20is=20blocked.=20=20*/=0A=20=20=20= if=20([self.urlScriptBlocked[self.URL]=20boolValue])=0A=20=20=20=20=20{=0A= -=20=20=20=20=20=20[self.xw->xv->emacswindow=20keyDown:event];=0A+=20=20=20= =20=20=20[self.xw->xv->emacsFrame=20keyDown:event];=0A=20=20=20=20=20=20=20= return;=0A=20=20=20=20=20}=0A=20=0A@@=20-237,13=20+237,13=20@@=20-=20= (void)keyDown:(NSEvent=20*)event=0A=20=20=20=20=20=20=20if=20(error)=0A=20= =20=20=20=20=20=20=20=20{=0A=20=20=20=20=20=20=20=20=20=20=20NSLog=20= (@"xwHasFocus:=20%@",=20error);=0A-=20=20=20=20=20=20=20=20=20=20= [self.xw->xv->emacswindow=20keyDown:event];=0A+=20=20=20=20=20=20=20=20=20= =20[self.xw->xv->emacsFrame=20keyDown:event];=0A=20=20=20=20=20=20=20=20=20= }=0A=20=20=20=20=20=20=20else=20if=20(result)=0A=20=20=20=20=20=20=20=20=20= {=0A=20=20=20=20=20=20=20=20=20=20=20NSNumber=20*hasFocus=20=3D=20= result;=20/*=20__NSCFBoolean=20*/=0A=20=20=20=20=20=20=20=20=20=20=20if=20= (!hasFocus.boolValue)=0A-=20=20=20=20=20=20=20=20=20=20=20=20= [self.xw->xv->emacswindow=20keyDown:event];=0A+=20=20=20=20=20=20=20=20=20= =20=20=20[self.xw->xv->emacsFrame=20keyDown:event];=0A=20=20=20=20=20=20=20= =20=20=20=20else=0A=20=20=20=20=20=20=20=20=20=20=20=20=20[super=20= keyDown:event];=0A=20=20=20=20=20=20=20=20=20}=0A@@=20-291,7=20+291,7=20= @@=20-=20(void)userContentController:(WKUserContentController=20= *)userContentController=0A=20=20=20=20=20{=0A=20=20=20=20=20=20=20/*=20= Just=20give=20up=20focus,=20no=20relay=20"C-g"=20to=20emacs,=20another=20= "C-g"=0A=20=20=20=20=20=20=20=20=20=20follows=20will=20be=20handled=20by=20= emacs.=20=20*/=0A-=20=20=20=20=20=20[self.window=20= makeFirstResponder:self.xw->xv->emacswindow];=0A+=20=20=20=20=20=20= [self.window=20makeFirstResponder:self.xw->xv->emacsFrame];=0A=20=20=20=20= =20}=0A=20}=0A=20=0A@@=20-437,16=20+437,10=20@@=20-=20= (void)userContentController:(WKUserContentController=20= *)userContentController=0A=20=20=20=20=20}];=0A=20}=0A=20=0A-/*=20Window=20= containing=20an=20xwidget.=20=20*/=0A-=0A-@implementation=20XwWindow=0A= --=20(BOOL)isFlipped=20{=20return=20YES;=20}=0A-@end=0A-=0A=20/*=20= Xwidget=20model,=20macOS=20Cocoa=20part.=20=20*/=0A=20=0A=20void=0A= -nsxwidget_init(struct=20xwidget=20*xw)=0A+nsxwidget_init=20(struct=20= xwidget=20*xw)=0A=20{=0A=20=20=20block_input=20();=0A=20=20=20NSRect=20= rect=20=3D=20NSMakeRect=20(0,=200,=20xw->width,=20xw->height);=0A@@=20= -454,9=20+448,6=20@@=20-=20(BOOL)isFlipped=20{=20return=20YES;=20}=0A=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20initWithFrame:rect=0A= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= configuration:[[WKWebViewConfiguration=20alloc]=20init]=0A=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= xwidget:xw];=0A-=20=20xw->xwWindow=20=3D=20[[XwWindow=20alloc]=0A-=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20initWithFrame:rect];=0A-=20= =20[xw->xwWindow=20addSubview:xw->xwWidget];=0A=20=20=20xw->xv=20=3D=20= NULL;=20/*=20for=201=20to=201=20relationship=20of=20webkit2.=20=20*/=0A=20= =20=20unblock_input=20();=0A=20}=0A@@=20-481,22=20+472,10=20@@=20-=20= (BOOL)isFlipped=20{=20return=20YES;=20}=0A=20=20=20=20=20=20=20= [((XwWebView=20*)=20xw->xwWidget).urlScriptBlocked=20release];=0A=20=20=20= =20=20=20=20[xw->xwWidget=20removeFromSuperviewWithoutNeedingDisplay];=0A= =20=20=20=20=20=20=20[xw->xwWidget=20release];=0A-=20=20=20=20=20=20= [xw->xwWindow=20removeFromSuperviewWithoutNeedingDisplay];=0A-=20=20=20=20= =20=20[xw->xwWindow=20release];=0A=20=20=20=20=20=20=20xw->xwWidget=20=3D=20= nil;=0A=20=20=20=20=20}=0A=20}=0A=20=0A-void=0A-nsxwidget_resize=20= (struct=20xwidget=20*xw)=0A-{=0A-=20=20if=20(xw->xwWidget)=0A-=20=20=20=20= {=0A-=20=20=20=20=20=20[xw->xwWindow=20= setFrameSize:NSMakeSize(xw->width,=20xw->height)];=0A-=20=20=20=20=20=20= [xw->xwWidget=20setFrameSize:NSMakeSize(xw->width,=20xw->height)];=0A-=20= =20=20=20}=0A-}=0A-=0A=20Lisp_Object=0A=20nsxwidget_get_size=20(struct=20= xwidget=20*xw)=0A=20{=0A@@=20-504,12=20+483,6=20@@=20-=20(BOOL)isFlipped=20= {=20return=20YES;=20}=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20xw->xwWidget.frame.size.height);=0A=20}=0A=20=0A-/*=20Xwidget=20view,=20= macOS=20Cocoa=20part.=20=20*/=0A-=0A-@implementation=20XvWindow=20:=20= NSView=0A--=20(BOOL)isFlipped=20{=20return=20YES;=20}=0A-@end=0A-=0A=20= void=0A=20nsxwidget_init_view=20(struct=20xwidget_view=20*xv,=0A=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20struct=20= xwidget=20*xw,=0A@@=20-526,16=20+499,27=20@@=20-=20(BOOL)isFlipped=20{=20= return=20YES;=20}=0A=20=20=20xv->clip_top=20=3D=200;=0A=20=20=20= xv->clip_bottom=20=3D=20xw->height;=0A=20=0A-=20=20xv->xvWindow=20=3D=20= [[XvWindow=20alloc]=0A+=20=20xv->xvWindow=20=3D=20[[NSView=20alloc]=0A=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= initWithFrame:NSMakeRect=20(x,=20y,=20xw->width,=20xw->height)];=0A-=20=20= xv->xvWindow.xw=20=3D=20xw;=0A-=20=20xv->xvWindow.xv=20=3D=20xv;=0A=20=0A= -=20=20xw->xv=20=3D=20xv;=20/*=20For=201=20to=201=20relationship=20of=20= webkit2.=20=20*/=0A-=20=20[xv->xvWindow=20addSubview:xw->xwWindow];=0A+=20= =20if=20(!xw->xv)=0A+=20=20=20=20{=0A+=20=20=20=20=20=20xw->xv=20=3D=20= xv;=20/*=20For=201=20to=201=20relationship=20of=20webkit2.=20=20*/=0A+=20= =20=20=20=20=20/*=20This=20seems=20like=20it=20should=20be=20retained,=20= but=20tests=20show=20otherwise.=20=20*/=0A+=20=20=20=20=20=20= xv->xvWidget=20=3D=20xw->xwWidget;=0A+=20=20=20=20}=0A+=20=20else=0A+=20=20= =20=20{=0A+=20=20=20=20=20=20NSTextField=20*warningLabel=20=3D=20= [NSTextField=20labelWithString:@"Cocoa=20Xwidgets=20do=20not=20support=20= sharing=20widgets."];=0A+=20=20=20=20=20=20[warningLabel=20= setFrameSize:NSMakeSize=20(xw->width,=20xw->height)];=0A+=20=20=20=20=20=20= warningLabel.drawsBackground=20=3D=20YES;=0A+=20=20=20=20=20=20= warningLabel.backgroundColor=20=3D=20[NSColor=20textBackgroundColor];=0A= +=20=20=20=20=20=20xv->xvWidget=20=3D=20warningLabel;=0A+=20=20=20=20}=0A= =20=0A-=20=20xv->emacswindow=20=3D=20FRAME_NS_VIEW=20(s->f);=0A-=20=20= [xv->emacswindow=20addSubview:xv->xvWindow];=0A+=20=20[xv->xvWindow=20= addSubview:xv->xvWidget];=0A+=20=20xv->emacsFrame=20=3D=20FRAME_NS_VIEW=20= (s->f);=0A+=20=20[xv->emacsFrame=20addSubview:xv->xvWindow];=0A=20}=0A=20= =0A=20void=0A@@=20-544,8=20+528,10=20@@=20-=20(BOOL)isFlipped=20{=20= return=20YES;=20}=0A=20=20=20if=20(!EQ=20(xv->model,=20Qnil))=0A=20=20=20= =20=20{=0A=20=20=20=20=20=20=20struct=20xwidget=20*xw=20=3D=20XXWIDGET=20= (xv->model);=0A-=20=20=20=20=20=20[xw->xwWindow=20= removeFromSuperviewWithoutNeedingDisplay];=0A-=20=20=20=20=20=20xw->xv=20= =3D=20NULL;=20/*=20Now=20model=20has=20no=20view.=20=20*/=0A+=20=20=20=20= =20=20if=20(xw->xv=20=3D=3D=20xv)=0A+=20=20=20=20=20=20=20=20{=0A+=20=20=20= =20=20=20=20=20=20=20xw->xv=20=3D=20NULL;=20/*=20Now=20model=20has=20no=20= view.=20=20*/=0A+=20=20=20=20=20=20=20=20}=0A=20=20=20=20=20}=0A=20=20=20= [xv->xvWindow=20removeFromSuperviewWithoutNeedingDisplay];=0A=20=20=20= [xv->xvWindow=20release];=0A@@=20-555,21=20+541,21=20@@=20-=20= (BOOL)isFlipped=20{=20return=20YES;=20}=0A=20nsxwidget_show_view=20= (struct=20xwidget_view=20*xv)=0A=20{=0A=20=20=20xv->hidden=20=3D=20NO;=0A= -=20=20[xv->xvWindow=20setFrameOrigin:NSMakePoint(xv->x=20+=20= xv->clip_left,=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= xv->y=20+=20xv->clip_top)];=0A+=20=20[xv->xvWindow=20setHidden:NO];=0A=20= }=0A=20=0A=20void=0A=20nsxwidget_hide_view=20(struct=20xwidget_view=20= *xv)=0A=20{=0A=20=20=20xv->hidden=20=3D=20YES;=0A-=20=20[xv->xvWindow=20= setFrameOrigin:NSMakePoint(10000,=2010000)];=0A+=20=20[xv->xvWindow=20= setHidden:YES];=0A=20}=0A=20=0A=20void=0A=20nsxwidget_resize_view=20= (struct=20xwidget_view=20*xv,=20int=20width,=20int=20height)=0A=20{=0A-=20= =20[xv->xvWindow=20setFrameSize:NSMakeSize(width,=20height)];=0A+=20=20= [xv->xvWindow=20setFrameSize:NSMakeSize=20(width,=20height)];=0A+=20=20= [xv->xvWidget=20setFrameSize:NSMakeSize=20(width,=20height)];=0A=20}=0A=20= =0A=20void=0A@@=20-582,8=20+568,7=20@@=20-=20(BOOL)isFlipped=20{=20= return=20YES;=20}=0A=20void=0A=20nsxwidget_move_widget_in_view=20(struct=20= xwidget_view=20*xv,=20int=20x,=20int=20y)=0A=20{=0A-=20=20struct=20= xwidget=20*xww=20=3D=20xv->xvWindow.xw;=0A-=20=20[xww->xwWindow=20= setFrameOrigin:NSMakePoint=20(x,=20y)];=0A+=20=20[xv->xvWidget=20= setFrameOrigin:NSMakePoint=20(x,=20y)];=0A=20}=0A=20=0A=20void=0Adiff=20= --git=20a/src/xwidget.c=20b/src/xwidget.c=0Aindex=20= 8bdfab02fd..013b773a90=20100644=0A---=20a/src/xwidget.c=0A+++=20= b/src/xwidget.c=0A@@=20-2762,7=20+2762,7=20@@=20xwidget_init_view=20= (struct=20xwidget=20*xww,=0A=20=20=20xv->just_resized=20=3D=20false;=0A=20= #elif=20defined=20NS_IMPL_COCOA=0A=20=20=20nsxwidget_init_view=20(xv,=20= xww,=20s,=20x,=20y);=0A-=20=20nsxwidget_resize_view(xv,=20xww->width,=20= xww->height);=0A+=20=20nsxwidget_resize_view=20(xv,=20xww->width,=20= xww->height);=0A=20#endif=0A=20=0A=20=20=20return=20xv;=0A@@=20-2794,7=20= +2794,7=20@@=20x_draw_xwidget_glyph_string=20(struct=20glyph_string=20= *s)=0A=20=0A=20=20=20xv->just_resized=20=3D=20false;=0A=20#elif=20= defined=20NS_IMPL_COCOA=0A-=20=20if=20(!xv)=0A+=20=20if=20(!xv=20||=20= xww->xv=20!=3D=20xv)=0A=20=20=20=20=20{=0A=20=20=20=20=20=20=20/*=20= Enforce=201=20to=201,=20model=20and=20view=20for=20macOS=20Cocoa=20= webkit2.=20=20*/=0A=20=20=20=20=20=20=20if=20(xww->xv)=0A@@=20-2805,11=20= +2805,6=20@@=20x_draw_xwidget_glyph_string=20(struct=20glyph_string=20= *s)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20XSETXWIDGET_VIEW=20= (xvl,=20xww->xv);=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= Fdelete_xwidget_view=20(xvl);=0A=20=20=20=20=20=20=20=20=20=20=20=20=20}=0A= -=20=20=20=20=20=20=20=20=20=20else=0A-=20=20=20=20=20=20=20=20=20=20=20=20= {=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20message=20("You=20can't=20= share=20an=20xwidget=20(webkit2)=20among=20windows.");=0A-=20=20=20=20=20= =20=20=20=20=20=20=20=20=20return;=0A-=20=20=20=20=20=20=20=20=20=20=20=20= }=0A=20=20=20=20=20=20=20=20=20}=0A=20=20=20=20=20=20=20xv=20=3D=20= xwidget_init_view=20(xww,=20s,=20x,=20y);=0A=20=20=20=20=20}=0A@@=20= -3243,8=20+3238,6=20@@=20DEFUN=20("xwidget-resize",=20Fxwidget_resize,=20= Sxwidget_resize,=203,=203,=200,=0A=20=0A=20=20=20=20=20=20=20= gtk_widget_queue_allocate=20(GTK_WIDGET=20(xw->widget_osr));=0A=20=20=20=20= =20}=0A-#elif=20defined=20NS_IMPL_COCOA=0A-=20=20nsxwidget_resize=20= (xw);=0A=20#endif=0A=20=20=20unblock_input=20();=0A=20=0Adiff=20--git=20= a/src/xwidget.h=20b/src/xwidget.h=0Aindex=20502beb6765..3943148e3f=20= 100644=0A---=20a/src/xwidget.h=0A+++=20b/src/xwidget.h=0A@@=20-81,16=20= +81,13=20@@=20#define=20XWIDGET_H_INCLUDED=0A=20=20=20guint=20= hit_result;=0A=20#elif=20defined=20(NS_IMPL_COCOA)=0A=20#=20ifdef=20= __OBJC__=0A-=20=20/*=20For=20offscreen=20widgets,=20unused=20if=20not=20= osr.=20=20*/=0A+=20=20/*=20The=20primary=20widget.=20=20*/=0A=20=20=20= NSView=20*xwWidget;=0A-=20=20XwWindow=20*xwWindow;=0A=20=0A-=20=20/*=20= Used=20only=20for=20xwidget=20types=20(such=20as=20webkit2)=20enforcing=20= 1=20to=201=0A-=20=20=20=20=20relationship=20between=20model=20and=20= view.=20=20*/=0A+=20=20/*=20The=20current=20view=20that=20displays=20the=20= primary=20widget,=20if=20exists.=20=20*/=0A=20=20=20struct=20= xwidget_view=20*xv;=0A=20#=20else=0A=20=20=20void=20*xwWidget;=0A-=20=20= void=20*xwWindow;=0A=20=20=20struct=20xwidget_view=20*xv;=0A=20#=20endif=0A= =20#endif=0A@@=20-136,11=20+133,13=20@@=20#define=20XWIDGET_H_INCLUDED=0A= =20=20=20int=20just_resized;=0A=20#elif=20defined=20(NS_IMPL_COCOA)=0A=20= #=20ifdef=20__OBJC__=0A-=20=20XvWindow=20*xvWindow;=0A-=20=20NSView=20= *emacswindow;=0A+=20=20NSView=20*xvWindow;=0A+=20=20NSView=20*xvWidget;=0A= +=20=20NSView=20*emacsFrame;=0A=20#=20else=0A=20=20=20void=20*xvWindow;=0A= -=20=20void=20*emacswindow;=0A+=20=20void=20*xvWidget;=0A+=20=20void=20= *emacsFrame;=0A=20#=20endif=0A=20#endif=0A=20=0A--=20=0A2.37.0=20(Apple=20= Git-136)=0A=0A= --Apple-Mail=_3A5F2BCA-C58A-402B-AAB4-C04ECABE5A49--