parent
69bddd212f
commit
b5a72b4af2
1
.gitignore
vendored
1
.gitignore
vendored
@ -224,3 +224,4 @@ mutter-2.31.5.tar.bz2
|
||||
/mutter-47.alpha.tar.xz
|
||||
/mutter-47.beta.tar.xz
|
||||
/mutter-47.rc.tar.xz
|
||||
/mutter-47.0.tar.xz
|
||||
|
@ -1,76 +0,0 @@
|
||||
From 2d64965a55f818d40fef0fe04bf3fad70fae29f5 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Jonas=20=C3=85dahl?= <jadahl@gmail.com>
|
||||
Date: Mon, 2 Sep 2024 16:18:47 +0200
|
||||
Subject: [PATCH] window/xwayland: Handle arithmetics close to the int limits
|
||||
|
||||
`(int) (1.0f * (float) INT_MAX)` doesn't necessarily result in INT_MAX
|
||||
due to how floating point arithmetics. Handle this better by setting
|
||||
INT_MIN/MAX explicitly, when the floating point value post scaling
|
||||
exceeds the corresponding limit.
|
||||
|
||||
This fixes resizing of electron windows.
|
||||
|
||||
Fixes: 6e8c7c5f84 ("Add experimental mode to use native scaling of Xwayland clients")
|
||||
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3997>
|
||||
---
|
||||
src/wayland/meta-window-xwayland.c | 28 ++++++++++++++++++++++------
|
||||
1 file changed, 22 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/src/wayland/meta-window-xwayland.c b/src/wayland/meta-window-xwayland.c
|
||||
index 5eeb98ed9d..6c2abf0924 100644
|
||||
--- a/src/wayland/meta-window-xwayland.c
|
||||
+++ b/src/wayland/meta-window-xwayland.c
|
||||
@@ -337,6 +337,22 @@ meta_window_xwayland_stage_to_protocol (MetaWindow *window,
|
||||
*protocol_y = stage_y * scale;
|
||||
}
|
||||
|
||||
+static int
|
||||
+scale_and_handle_overflow (int protocol,
|
||||
+ float scale,
|
||||
+ float (* rounding_function) (float value))
|
||||
+{
|
||||
+ float value;
|
||||
+
|
||||
+ value = rounding_function (protocol * scale);
|
||||
+ if (value >= (float) INT_MAX)
|
||||
+ return INT_MAX;
|
||||
+ else if (value <= (float) INT_MIN)
|
||||
+ return INT_MIN;
|
||||
+ else
|
||||
+ return (int) value;
|
||||
+}
|
||||
+
|
||||
static void
|
||||
meta_window_xwayland_protocol_to_stage (MetaWindow *window,
|
||||
int protocol_x,
|
||||
@@ -360,21 +376,21 @@ meta_window_xwayland_protocol_to_stage (MetaWindow *window,
|
||||
{
|
||||
case MTK_ROUNDING_STRATEGY_SHRINK:
|
||||
if (stage_x)
|
||||
- *stage_x = (int) floorf (protocol_x * scale);
|
||||
+ *stage_x = scale_and_handle_overflow (protocol_x, scale, floorf);
|
||||
if (stage_y)
|
||||
- *stage_y = (int) floorf (protocol_y * scale);
|
||||
+ *stage_y = scale_and_handle_overflow (protocol_y, scale, floorf);
|
||||
break;
|
||||
case MTK_ROUNDING_STRATEGY_GROW:
|
||||
if (stage_x)
|
||||
- *stage_x = (int) ceilf (protocol_x * scale);
|
||||
+ *stage_x = scale_and_handle_overflow (protocol_x, scale, ceilf);
|
||||
if (stage_y)
|
||||
- *stage_y = (int) ceilf (protocol_y * scale);
|
||||
+ *stage_y = scale_and_handle_overflow (protocol_y, scale, ceilf);
|
||||
break;
|
||||
case MTK_ROUNDING_STRATEGY_ROUND:
|
||||
if (stage_x)
|
||||
- *stage_x = (int) roundf (protocol_x * scale);
|
||||
+ *stage_x = scale_and_handle_overflow (protocol_x, scale, roundf);
|
||||
if (stage_y)
|
||||
- *stage_y = (int) roundf (protocol_y * scale);
|
||||
+ *stage_y = scale_and_handle_overflow (protocol_y, scale, roundf);
|
||||
break;
|
||||
}
|
||||
}
|
||||
--
|
||||
2.46.0
|
||||
|
@ -12,7 +12,7 @@
|
||||
%global tarball_version %%(echo %{version} | tr '~' '.')
|
||||
|
||||
Name: mutter
|
||||
Version: 47~rc
|
||||
Version: 47.0
|
||||
Release: %autorelease
|
||||
Summary: Window and compositing manager based on Clutter
|
||||
|
||||
@ -40,10 +40,6 @@ Patch: 0003-Revert-x11-window-Use-correct-bounding-rect-to-deter.patch
|
||||
# Revert deprecation fix to avoid newer glib requirement
|
||||
Patch: 0001-Revert-Replace-deprecated-g_qsort_with_data-with-g_s.patch
|
||||
|
||||
# Fix resizig of electron windows
|
||||
# https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3997
|
||||
Patch: 0001-window-xwayland-Handle-arithmetics-close-to-the-int-.patch
|
||||
|
||||
BuildRequires: pkgconfig(gobject-introspection-1.0) >= 1.41.0
|
||||
BuildRequires: pkgconfig(sm)
|
||||
BuildRequires: pkgconfig(libwacom)
|
||||
|
2
sources
2
sources
@ -1 +1 @@
|
||||
SHA512 (mutter-47.rc.tar.xz) = 5da95bab925ca8b07860647e9a89152435cde13f4ea66f71bc3c320cc3de0d1d3f79763bc1fa17f124f543cf536232088118944857cc450e6e69959fb868f67c
|
||||
SHA512 (mutter-47.0.tar.xz) = 4e9690f2ead28d3fdf5eacd52750190286ab46dbb0b37b771afa01b65da14b15582bd8a1acd32acaa3b3b03135ff2ff51ec015ed30637a37f3df7879453bcf26
|
||||
|
Loading…
Reference in New Issue
Block a user