From nobody Tue Nov 26 13:40:26 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1707825713; cv=none; d=zohomail.com; s=zohoarc; b=hMBLxgOkM2GbPt7tZQ4zQO0vCVLLwF70krRrPbYZMuEv7rkdcbdMgInFQ9H/ASNQqqwpqu6N2//Ls97XjxY0XFwkB+M9TWsl+ujYdoAenNpz12hAS0lHcWT88qgki9Mj0Q/HA0IH7Oi41mF2+yauqUpZtSoeXsQIlZpcTu40tzk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1707825713; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=xxggzNoSHA/NLM+K6602kCvWVNLthDE/kRWJr7Ttw8g=; b=OB4XuJygmQNPtpkqAtNyrmHbVBZxXHSikmF+b2rsYJfc9KwUudJMPs6p3TKMP+FgbWUkysYG9jGpg/f+zao3pgtEzlW4pIfxFjzeqibF7KObPYoIKjjNEeJZjitK86WR1cm6IGqkdlBR35/RAopp/FCPo5EAJEWbUwXfUO2m1SA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1707825713302268.3144036834419; Tue, 13 Feb 2024 04:01:53 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rZrTw-0004MG-Pf; Tue, 13 Feb 2024 07:01:51 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rZrTn-0004Db-KO for qemu-devel@nongnu.org; Tue, 13 Feb 2024 07:01:40 -0500 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rZrTl-0000xs-E8 for qemu-devel@nongnu.org; Tue, 13 Feb 2024 07:01:39 -0500 Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-6e0fc87fc2dso203217b3a.3 for ; Tue, 13 Feb 2024 04:01:37 -0800 (PST) Received: from localhost ([157.82.207.134]) by smtp.gmail.com with UTF8SMTPSA id y20-20020a056a00181400b006e06af90ff4sm7165010pfa.204.2024.02.13.04.01.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 13 Feb 2024 04:01:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1707825695; x=1708430495; darn=nongnu.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=xxggzNoSHA/NLM+K6602kCvWVNLthDE/kRWJr7Ttw8g=; b=PurE6EucoYmwmVgBbOtXlJNaF3Kz4FXbD2FsO/ug0DrIOP/uuEVN44Qe2rWqXXmwt3 C7QVWqJ80paxi6mAoRkLe7VwXkzuWtpC37R5vnjyBRL3++J35DlYz2hO2uhlduPkr6WU sPQ4r5pxwSOKMvRehXJEfpHV3cJLlwaoZmzDTMNhUHkGb5VecomWylRXFULHqBSX54ep gIChYNL8CgdjiKTQFPif5EPwXcI9MYz7MniWH8W7I0IbMuJIBFV0ZLTPIjm+t/EQgVSj CvCYb7qXCUdtBVuYmCUcJYW7Rls6+piSHG+A6i4PRuXRopJgY/Cvv+35d2ePMKoV+qTp 5EWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707825695; x=1708430495; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xxggzNoSHA/NLM+K6602kCvWVNLthDE/kRWJr7Ttw8g=; b=DUhHjkeIBCrtStWG6kuMKLx3vbe9emptb7OOnTTPoYxtfOBpRKOBaqyCZGOMWpeM0/ bNqxXyj4kdFxpO/WNgRoMY2YAA6/C2Enjcn1RVILivhCAazfns9CQNUfFmAEyU4laj/0 5mZGdjBqfgQMSX5txVl7HOfA6MtFSIj+01vNPwN1er0IKPLW3LZoq2IfI/wS7CtQyOZ6 wpSGk3GtLnEVvNw24DPRsvaLiDi6q4wZTFt4ooXW7oyQQgpz5qZl82zhFrAtKXxtfARU VkpWXUSPTfgfu69ZQ7fjfgr/7ZoKWNZSZPkXYXEcqtUlVWef3vYwdyk6ewwixBsHOLQp Nrcg== X-Gm-Message-State: AOJu0YwsQBJyIXiogwrE9JNyE42Cj44sgj/gsg/drFPcmzXQcu1JuPaw EohFiABTfFX30JFqhveLQ04cokSomwzmpXknjjbQ5c3DYi7s5HsRJ4xJ6ibXjhR6+DYXUz6QiEg K X-Google-Smtp-Source: AGHT+IH69OyZ84u11JypLgfaCsxD20dK6QyJLhdWQ0vnkEKAaf8nPpEtHQmUsqM1y0eQEgjca90HEg== X-Received: by 2002:a62:ce4e:0:b0:6e0:a025:feb2 with SMTP id y75-20020a62ce4e000000b006e0a025feb2mr7793977pfg.11.1707825695110; Tue, 13 Feb 2024 04:01:35 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCWuITPVZOhgMqF73ouEs9ab0OyXijXJpJPWbX5nVB9ICEFuu7FLzRXyHPS0+zXmXx23oGnzCZUgqRs77XWTltYPFrXkEG521Jwak2Mj6No1qdNjGMI4y8Xe/eAIc75myOLsJ5Pmky2B5Tu0/WupXgob78q3e2z6qsduFi16gXrGoo3+fsjv+HPCbO+um8xAAVpKnlBpVxm4Pa7kRwgB9OoYg88rryf+g12OkwQ/AwoPI1qrc3w7uW9WPyHhchn7EG1/jlbWRSNyciO3 From: Akihiko Odaki Date: Tue, 13 Feb 2024 21:01:00 +0900 Subject: [PATCH v9 6/6] ui/cocoa: Remove stretch_video flag MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240213-cocoa-v9-6-d5a5e1bf0490@daynix.com> References: <20240213-cocoa-v9-0-d5a5e1bf0490@daynix.com> In-Reply-To: <20240213-cocoa-v9-0-d5a5e1bf0490@daynix.com> To: Peter Maydell , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Gerd Hoffmann , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Marek Glogowski , BALATON Zoltan , Rene Engel Cc: qemu-devel@nongnu.org, Akihiko Odaki X-Mailer: b4 0.12.3 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::433; envelope-from=akihiko.odaki@daynix.com; helo=mail-pf1-x433.google.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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20230601.gappssmtp.com) X-ZM-MESSAGEID: 1707825713872100001 Evaluate [normalWindow styleMask] & NSWindowStyleMaskResizable instead. Signed-off-by: Akihiko Odaki --- ui/cocoa.m | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/ui/cocoa.m b/ui/cocoa.m index 93e761f09c6e..e68f418d9e42 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -103,7 +103,6 @@ static void cocoa_switch(DisplayChangeListener *dcl, static int left_command_key_enabled =3D 1; static bool swap_opt_cmd; =20 -static bool stretch_video; static NSTextField *pauseLabel; =20 static bool allow_events; @@ -533,7 +532,7 @@ - (void) resizeWindow { [[self window] setContentAspectRatio:NSMakeSize(screen.width, screen.h= eight)]; =20 - if (!stretch_video) { + if (!([[self window] styleMask] & NSWindowStyleMaskResizable)) { [[self window] setContentSize:NSMakeSize(screen.width, screen.heig= ht)]; [[self window] center]; } else if ([[self window] styleMask] & NSWindowStyleMaskFullScreen) { @@ -1296,7 +1295,7 @@ - (BOOL)windowShouldClose:(id)sender =20 - (NSSize) window:(NSWindow *)window willUseFullScreenContentSize:(NSSize)= proposedSize { - if (stretch_video) { + if ([normalWindow styleMask] & NSWindowStyleMaskResizable) { return [cocoaView fixZoomedFullScreenSize:proposedSize]; } =20 @@ -1377,8 +1376,7 @@ - (void)showQEMUDoc:(id)sender /* Stretches video to fit host monitor size */ - (void)zoomToFit:(id) sender { - stretch_video =3D !stretch_video; - if (stretch_video =3D=3D true) { + if (([normalWindow styleMask] & NSWindowStyleMaskResizable) =3D=3D 0) { [normalWindow setStyleMask:[normalWindow styleMask] | NSWindowStyl= eMaskResizable]; [sender setState: NSControlStateValueOn]; } else { @@ -1650,7 +1648,7 @@ static void create_initial_menus(void) menu =3D [[NSMenu alloc] initWithTitle:@"View"]; [menu addItem: [[[NSMenuItem alloc] initWithTitle:@"Enter Fullscreen" = action:@selector(doToggleFullScreen:) keyEquivalent:@"f"] autorelease]]; //= Fullscreen menuItem =3D [[[NSMenuItem alloc] initWithTitle:@"Zoom To Fit" action:= @selector(zoomToFit:) keyEquivalent:@""] autorelease]; - [menuItem setState: stretch_video ? NSControlStateValueOn : NSControlS= tateValueOff]; + [menuItem setState: [normalWindow styleMask] & NSWindowStyleMaskResiza= ble ? NSControlStateValueOn : NSControlStateValueOff]; [menu addItem: menuItem]; menuItem =3D [[[NSMenuItem alloc] initWithTitle:@"View" action:nil key= Equivalent:@""] autorelease]; [menuItem setSubmenu:menu]; @@ -2036,7 +2034,6 @@ static void cocoa_display_init(DisplayState *ds, Disp= layOptions *opts) } =20 if (opts->u.cocoa.has_zoom_to_fit && opts->u.cocoa.zoom_to_fit) { - stretch_video =3D true; [normalWindow setStyleMask:[normalWindow styleMask] | NSWindowStyl= eMaskResizable]; } =20 --=20 2.43.0