Merge ~3v1n0/ubuntu/+source/mutter:ubuntu/master into ~ubuntu-desktop/ubuntu/+source/mutter:ubuntu/master

Proposed by Marco Trevisan (Treviño) on 2019-04-03
Status: Merged
Merged at revision: de028410be38c2ee6140f90da0b24c10f91b5fe4
Proposed branch: ~3v1n0/ubuntu/+source/mutter:ubuntu/master
Merge into: ~ubuntu-desktop/ubuntu/+source/mutter:ubuntu/master
Diff against target: 810 lines (+111/-344)
2 files modified
debian/changelog (+8/-0)
debian/patches/x11-Add-support-for-fractional-scaling-using-Randr.patch (+103/-344)
Reviewer Review Type Date Requested Status
Daniel van Vugt (community) Approve on 2019-04-05
Ubuntu Desktop 2019-04-03 Pending
Review via email: mp+365502@code.launchpad.net
To post a comment you must log in.
Daniel van Vugt (vanvugt) wrote :

Sounds and looks sensible.

Although it's never easy to read the diff-of-a-diff, the fact that the patch is shrinking is also good.

review: Approve
Marco Trevisan (Treviño) (3v1n0) wrote :

> Although it's never easy to read the diff-of-a-diff, the fact that the patch
> is shrinking is also good.

In such cases I suggest you to fetch the ubuntu-desktop ubuntu/master branch and do:
 gbp pq import

Fetch my branch locally (say you call it marco-ubuntu), and there again
 gbp pq import

Then you can easily diff things with
  git diff patch-queue/ubuntu/master patch-queue/marco-ubuntu/master

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/debian/changelog b/debian/changelog
index d096e50..67c17c0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
1mutter (3.32.0-1ubuntu2) UNRELEASED; urgency=medium
2
3 * debian/patches/x11-Add-support-for-fractional-scaling-using-Randr.patch:
4 - Don't invert the screen size when rotation is enabled (LP: #1822513)
5 - Remove unneeded cleanup changes
6
7 -- Marco Trevisan (Treviño) <marco@ubuntu.com> Wed, 03 Apr 2019 19:19:59 -0400
8
1mutter (3.32.0-1ubuntu1) disco; urgency=medium9mutter (3.32.0-1ubuntu1) disco; urgency=medium
210
3 * debian/control:11 * debian/control:
diff --git a/debian/patches/x11-Add-support-for-fractional-scaling-using-Randr.patch b/debian/patches/x11-Add-support-for-fractional-scaling-using-Randr.patch
index 987f4f9..ea6c35f 100644
--- a/debian/patches/x11-Add-support-for-fractional-scaling-using-Randr.patch
+++ b/debian/patches/x11-Add-support-for-fractional-scaling-using-Randr.patch
@@ -1,19 +1,25 @@
1From: =?utf-8?b?Ik1hcmNvIFRyZXZpc2FuIChUcmV2acOxbyki?= <mail@3v1n0.net>1From: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
2Date: Wed, 27 Mar 2019 06:44:56 +01002Date: Wed, 3 Apr 2019 19:18:03 -0400
3Subject: X11: Add support for fractional scaling using Randr3Subject: x11-Add-support-for-fractional-scaling-using-Randr
4MIME-Version: 1.0
5Content-Type: text/plain; charset="utf-8"
6Content-Transfer-Encoding: 8bit
7
8commit ed760c44b1998fc5fadde18186c51e74525038cc
9Author: Marco Trevisan (Treviño) <mail@3v1n0.net>
10Date: Wed Apr 3 18:57:28 2019 -0400
411
5Add scaling support using randr under x11.12Add scaling support using randr under x11.
613
14Origin: https://gitlab.gnome.org/3v1n0/mutter/commits/xrandr-scaling
7Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/mutter/+bug/182085015Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/mutter/+bug/1820850
8Forwarded: No, forwarding is in progress and planned though16Forwarded: No, forwarding is in progress and planned though
9---17---
10 data/meson.build | 7 +18 data/meson.build | 7 +
11 data/org.gnome.mutter.gschema.xml.in | 5 +19 data/org.gnome.mutter.gschema.xml.in | 5 +
12 data/org.gnome.mutter.x11.gschema.xml.in | 30 ++20 data/org.gnome.mutter.x11.gschema.xml.in | 30 ++
13 meson.build | 2 +-
14 src/backends/meta-crtc.h | 1 +21 src/backends/meta-crtc.h | 1 +
15 src/backends/meta-logical-monitor.c | 36 +--22 src/backends/meta-monitor-config-manager.c | 150 +++++++++-
16 src/backends/meta-monitor-config-manager.c | 150 ++++++++-
17 src/backends/meta-monitor-config-migration.c | 15 +-23 src/backends/meta-monitor-config-migration.c | 15 +-
18 src/backends/meta-monitor-config-store.c | 1 +24 src/backends/meta-monitor-config-store.c | 1 +
19 src/backends/meta-monitor-manager-dummy.c | 24 +-25 src/backends/meta-monitor-manager-dummy.c | 24 +-
@@ -22,26 +28,22 @@ Forwarded: No, forwarding is in progress and planned though
22 src/backends/meta-monitor.c | 60 ++--28 src/backends/meta-monitor.c | 60 ++--
23 src/backends/meta-monitor.h | 6 +-29 src/backends/meta-monitor.h | 6 +-
24 src/backends/meta-settings-private.h | 9 +30 src/backends/meta-settings-private.h | 9 +
25 src/backends/meta-settings.c | 80 ++++-31 src/backends/meta-settings.c | 76 ++++-
26 src/backends/native/meta-monitor-manager-kms.c | 44 ++-32 src/backends/native/meta-monitor-manager-kms.c | 44 ++-
27 src/backends/x11/meta-crtc-xrandr.c | 87 +++++-33 src/backends/x11/meta-crtc-xrandr.c | 87 +++++-
28 src/backends/x11/meta-crtc-xrandr.h | 13 +-34 src/backends/x11/meta-crtc-xrandr.h | 13 +-
29 src/backends/x11/meta-gpu-xrandr.c | 89 +++++-35 src/backends/x11/meta-gpu-xrandr.c | 89 +++++-
30 src/backends/x11/meta-gpu-xrandr.h | 4 +36 src/backends/x11/meta-gpu-xrandr.h | 4 +
31 src/backends/x11/meta-monitor-manager-xrandr.c | 407 +++++++++++++++++--------37 src/backends/x11/meta-monitor-manager-xrandr.c | 399 +++++++++++++++++--------
32 src/backends/x11/meta-monitor-manager-xrandr.h | 4 +-38 src/backends/x11/meta-monitor-manager-xrandr.h | 4 +-
33 src/backends/x11/meta-output-xrandr.c | 5 +-39 src/backends/x11/meta-output-xrandr.c | 5 +-
34 src/compositor/compositor-private.h | 2 +40 src/compositor/compositor.c | 54 ++++
35 src/compositor/compositor.c | 96 +++++-41 src/core/boxes-private.h | 4 +
36 src/core/boxes-private.h | 8 +42 src/core/boxes.c | 21 ++
37 src/core/boxes.c | 53 ++++
38 src/core/display.c | 3 +-
39 src/core/window.c | 19 ++43 src/core/window.c | 19 ++
40 src/meta/compositor.h | 5 +
41 src/meta/display.h | 8 +-
42 src/org.gnome.Mutter.DisplayConfig.xml | 5 +44 src/org.gnome.Mutter.DisplayConfig.xml | 5 +
43 src/tests/meta-monitor-manager-test.c | 14 +-45 src/tests/meta-monitor-manager-test.c | 14 +-
44 34 files changed, 1366 insertions(+), 303 deletions(-)46 28 files changed, 1269 insertions(+), 254 deletions(-)
45 create mode 100644 data/org.gnome.mutter.x11.gschema.xml.in47 create mode 100644 data/org.gnome.mutter.x11.gschema.xml.in
4648
47diff --git a/data/meson.build b/data/meson.build49diff --git a/data/meson.build b/data/meson.build
@@ -114,19 +116,6 @@ index 0000000..3696659
114+ </schema>116+ </schema>
115+117+
116+</schemalist>118+</schemalist>
117diff --git a/meson.build b/meson.build
118index cafbde4..afcbd31 100644
119--- a/meson.build
120+++ b/meson.build
121@@ -9,7 +9,7 @@ mutter_plugin_api_version = '3'
122 libmutter_api_version = '4'
123
124 # generic version requirements
125-glib_req = '>= 2.53.2'
126+glib_req = '>= 2.56'
127 gi_req = '>= 0.9.5'
128 gtk3_req = '>= 3.19.8'
129 gdk_pixbuf_req = '>= 2.0'
130diff --git a/src/backends/meta-crtc.h b/src/backends/meta-crtc.h119diff --git a/src/backends/meta-crtc.h b/src/backends/meta-crtc.h
131index ddacfea..8d16455 100644120index ddacfea..8d16455 100644
132--- a/src/backends/meta-crtc.h121--- a/src/backends/meta-crtc.h
@@ -139,58 +128,6 @@ index ddacfea..8d16455 100644
139 128
140 MetaLogicalMonitor *logical_monitor;129 MetaLogicalMonitor *logical_monitor;
141 130
142diff --git a/src/backends/meta-logical-monitor.c b/src/backends/meta-logical-monitor.c
143index 99a35f7..a2d8f41 100644
144--- a/src/backends/meta-logical-monitor.c
145+++ b/src/backends/meta-logical-monitor.c
146@@ -45,6 +45,7 @@
147 #include "backends/meta-backend-private.h"
148 #include "backends/meta-crtc.h"
149 #include "backends/meta-output.h"
150+#include "core/boxes-private.h"
151
152 G_DEFINE_TYPE (MetaLogicalMonitor, meta_logical_monitor, G_TYPE_OBJECT)
153
154@@ -302,37 +303,6 @@ meta_logical_monitor_has_neighbor (MetaLogicalMonitor *logical_monitor,
155 MetaLogicalMonitor *neighbor,
156 MetaDisplayDirection neighbor_direction)
157 {
158- switch (neighbor_direction)
159- {
160- case META_DISPLAY_RIGHT:
161- if (neighbor->rect.x == (logical_monitor->rect.x +
162- logical_monitor->rect.width) &&
163- meta_rectangle_vert_overlap (&neighbor->rect,
164- &logical_monitor->rect))
165- return TRUE;
166- break;
167- case META_DISPLAY_LEFT:
168- if (logical_monitor->rect.x == (neighbor->rect.x +
169- neighbor->rect.width) &&
170- meta_rectangle_vert_overlap (&neighbor->rect,
171- &logical_monitor->rect))
172- return TRUE;
173- break;
174- case META_DISPLAY_UP:
175- if (logical_monitor->rect.y == (neighbor->rect.y +
176- neighbor->rect.height) &&
177- meta_rectangle_horiz_overlap (&neighbor->rect,
178- &logical_monitor->rect))
179- return TRUE;
180- break;
181- case META_DISPLAY_DOWN:
182- if (neighbor->rect.y == (logical_monitor->rect.y +
183- logical_monitor->rect.height) &&
184- meta_rectangle_horiz_overlap (&neighbor->rect,
185- &logical_monitor->rect))
186- return TRUE;
187- break;
188- }
189-
190- return FALSE;
191+ return meta_rectangle_has_neighbor (&logical_monitor->rect, &neighbor->rect,
192+ (MetaSide) neighbor_direction);
193 }
194diff --git a/src/backends/meta-monitor-config-manager.c b/src/backends/meta-monitor-config-manager.c131diff --git a/src/backends/meta-monitor-config-manager.c b/src/backends/meta-monitor-config-manager.c
195index 771c57f..5d620a3 100644132index 771c57f..5d620a3 100644
196--- a/src/backends/meta-monitor-config-manager.c133--- a/src/backends/meta-monitor-config-manager.c
@@ -774,7 +711,7 @@ index 3b951c6..3b375a0 100644
774 meta_monitor_manager_get_capabilities (MetaMonitorManager *manager);711 meta_monitor_manager_get_capabilities (MetaMonitorManager *manager);
775 712
776diff --git a/src/backends/meta-monitor-manager.c b/src/backends/meta-monitor-manager.c713diff --git a/src/backends/meta-monitor-manager.c b/src/backends/meta-monitor-manager.c
777index c4ed245..7cb3415 100644714index c4ed245..8b5b983 100644
778--- a/src/backends/meta-monitor-manager.c715--- a/src/backends/meta-monitor-manager.c
779+++ b/src/backends/meta-monitor-manager.c716+++ b/src/backends/meta-monitor-manager.c
780@@ -104,8 +104,18 @@ static gboolean717@@ -104,8 +104,18 @@ static gboolean
@@ -1196,7 +1133,7 @@ index c4ed245..7cb3415 100644
1196+ {1133+ {
1197+ MetaLogicalMonitorConfig *logical_monitor_config = l->data;1134+ MetaLogicalMonitorConfig *logical_monitor_config = l->data;
1198+1135+
1199+ if (logical_monitor_config->scale != scale)1136+ if (fabs (logical_monitor_config->scale - scale) > FLT_EPSILON)
1200+ return FALSE;1137+ return FALSE;
1201+ }1138+ }
1202+1139+
@@ -1509,7 +1446,7 @@ index 619de17..8d20b88 100644
1509 1446
1510 #endif /* META_SETTINGS_PRIVATE_H */1447 #endif /* META_SETTINGS_PRIVATE_H */
1511diff --git a/src/backends/meta-settings.c b/src/backends/meta-settings.c1448diff --git a/src/backends/meta-settings.c b/src/backends/meta-settings.c
1512index 34d49b3..52c6632 1006441449index 34d49b3..e54317e 100644
1513--- a/src/backends/meta-settings.c1450--- a/src/backends/meta-settings.c
1514+++ b/src/backends/meta-settings.c1451+++ b/src/backends/meta-settings.c
1515@@ -40,6 +40,7 @@ enum1452@@ -40,6 +40,7 @@ enum
@@ -1537,7 +1474,7 @@ index 34d49b3..52c6632 100644
1537 };1474 };
1538 1475
1539 G_DEFINE_TYPE (MetaSettings, meta_settings, G_TYPE_OBJECT)1476 G_DEFINE_TYPE (MetaSettings, meta_settings, G_TYPE_OBJECT)
1540@@ -77,14 +81,37 @@ calculate_ui_scaling_factor (MetaSettings *settings)1477@@ -77,14 +81,33 @@ calculate_ui_scaling_factor (MetaSettings *settings)
1541 {1478 {
1542 MetaMonitorManager *monitor_manager =1479 MetaMonitorManager *monitor_manager =
1543 meta_backend_get_monitor_manager (settings->backend);1480 meta_backend_get_monitor_manager (settings->backend);
@@ -1547,28 +1484,24 @@ index 34d49b3..52c6632 100644
1547- meta_monitor_manager_get_primary_logical_monitor (monitor_manager);1484- meta_monitor_manager_get_primary_logical_monitor (monitor_manager);
1548- if (!primary_logical_monitor)1485- if (!primary_logical_monitor)
1549- return 1;1486- return 1;
1550 1487+ if (!meta_is_wayland_compositor () &&
1551- return (int) meta_logical_monitor_get_scale (primary_logical_monitor);1488+ (settings->experimental_features &
1552+ if (settings->experimental_features &1489+ META_EXPERIMENTAL_FEATURE_X11_RANDR_FRACTIONAL_SCALING))
1553+ META_EXPERIMENTAL_FEATURE_X11_RANDR_FRACTIONAL_SCALING)
1554+ {1490+ {
1555+ if (settings->x11_scale_mode == META_X11_SCALE_MODE_UP)1491+ float scale = 1;
1556+ return 1;
1557+1492+
1558+ if (monitor_manager &&1493+ if (monitor_manager &&
1559+ settings->x11_scale_mode == META_X11_SCALE_MODE_UI_DOWN)1494+ settings->x11_scale_mode == META_X11_SCALE_MODE_UI_DOWN)
1560+ {1495+ scale =
1561+ float max_scale =1496+ ceilf (meta_monitor_manager_get_maximum_crtc_scale (monitor_manager));
1562+ meta_monitor_manager_get_maximum_crtc_scale (monitor_manager);
1563+ return ceilf (max_scale);
1564+ }
1565+1497+
1566+ return 1;1498+ return scale;
1567+ }1499+ }
1568+ else if (monitor_manager)1500+ else if (monitor_manager)
1569+ {1501+ {
1570+ MetaLogicalMonitor *primary_logical_monitor;1502+ MetaLogicalMonitor *primary_logical_monitor;
1571+1503
1504- return (int) meta_logical_monitor_get_scale (primary_logical_monitor);
1572+ primary_logical_monitor =1505+ primary_logical_monitor =
1573+ meta_monitor_manager_get_primary_logical_monitor (monitor_manager);1506+ meta_monitor_manager_get_primary_logical_monitor (monitor_manager);
1574+ if (!primary_logical_monitor)1507+ if (!primary_logical_monitor)
@@ -1581,7 +1514,7 @@ index 34d49b3..52c6632 100644
1581 }1514 }
1582 1515
1583 static gboolean1516 static gboolean
1584@@ -264,6 +291,8 @@ experimental_features_handler (GVariant *features_variant,1517@@ -264,6 +287,8 @@ experimental_features_handler (GVariant *features_variant,
1585 features |= META_EXPERIMENTAL_FEATURE_SCALE_MONITOR_FRAMEBUFFER;1518 features |= META_EXPERIMENTAL_FEATURE_SCALE_MONITOR_FRAMEBUFFER;
1586 else if (g_str_equal (feature, "kms-modifiers"))1519 else if (g_str_equal (feature, "kms-modifiers"))
1587 features |= META_EXPERIMENTAL_FEATURE_KMS_MODIFIERS;1520 features |= META_EXPERIMENTAL_FEATURE_KMS_MODIFIERS;
@@ -1590,7 +1523,7 @@ index 34d49b3..52c6632 100644
1590 else1523 else
1591 g_info ("Unknown experimental feature '%s'\n", feature);1524 g_info ("Unknown experimental feature '%s'\n", feature);
1592 }1525 }
1593@@ -392,6 +421,25 @@ wayland_settings_changed (GSettings *wayland_settings,1526@@ -392,6 +417,25 @@ wayland_settings_changed (GSettings *wayland_settings,
1594 }1527 }
1595 }1528 }
1596 1529
@@ -1616,7 +1549,7 @@ index 34d49b3..52c6632 100644
1616 void1549 void
1617 meta_settings_get_xwayland_grab_patterns (MetaSettings *settings,1550 meta_settings_get_xwayland_grab_patterns (MetaSettings *settings,
1618 GPtrArray **whitelist_patterns,1551 GPtrArray **whitelist_patterns,
1619@@ -407,6 +455,12 @@ gboolean1552@@ -407,6 +451,12 @@ gboolean
1620 return (settings->xwayland_allow_grabs);1553 return (settings->xwayland_allow_grabs);
1621 }1554 }
1622 1555
@@ -1629,7 +1562,7 @@ index 34d49b3..52c6632 100644
1629 MetaSettings *1562 MetaSettings *
1630 meta_settings_new (MetaBackend *backend)1563 meta_settings_new (MetaBackend *backend)
1631 {1564 {
1632@@ -426,6 +480,7 @@ meta_settings_dispose (GObject *object)1565@@ -426,6 +476,7 @@ meta_settings_dispose (GObject *object)
1633 g_clear_object (&settings->mutter_settings);1566 g_clear_object (&settings->mutter_settings);
1634 g_clear_object (&settings->interface_settings);1567 g_clear_object (&settings->interface_settings);
1635 g_clear_object (&settings->wayland_settings);1568 g_clear_object (&settings->wayland_settings);
@@ -1637,7 +1570,7 @@ index 34d49b3..52c6632 100644
1637 g_clear_pointer (&settings->xwayland_grab_whitelist_patterns,1570 g_clear_pointer (&settings->xwayland_grab_whitelist_patterns,
1638 g_ptr_array_unref);1571 g_ptr_array_unref);
1639 g_clear_pointer (&settings->xwayland_grab_blacklist_patterns,1572 g_clear_pointer (&settings->xwayland_grab_blacklist_patterns,
1640@@ -449,6 +504,10 @@ meta_settings_init (MetaSettings *settings)1573@@ -449,6 +500,10 @@ meta_settings_init (MetaSettings *settings)
1641 g_signal_connect (settings->wayland_settings, "changed",1574 g_signal_connect (settings->wayland_settings, "changed",
1642 G_CALLBACK (wayland_settings_changed),1575 G_CALLBACK (wayland_settings_changed),
1643 settings);1576 settings);
@@ -1648,7 +1581,7 @@ index 34d49b3..52c6632 100644
1648 1581
1649 /* Chain up inter-dependent settings. */1582 /* Chain up inter-dependent settings. */
1650 g_signal_connect (settings, "global-scaling-factor-changed",1583 g_signal_connect (settings, "global-scaling-factor-changed",
1651@@ -460,6 +519,7 @@ meta_settings_init (MetaSettings *settings)1584@@ -460,6 +515,7 @@ meta_settings_init (MetaSettings *settings)
1652 update_experimental_features (settings);1585 update_experimental_features (settings);
1653 update_xwayland_grab_access_rules (settings);1586 update_xwayland_grab_access_rules (settings);
1654 update_xwayland_allow_grabs (settings);1587 update_xwayland_allow_grabs (settings);
@@ -1656,7 +1589,7 @@ index 34d49b3..52c6632 100644
1656 }1589 }
1657 1590
1658 static void1591 static void
1659@@ -514,6 +574,14 @@ meta_settings_class_init (MetaSettingsClass *klass)1592@@ -514,6 +570,14 @@ meta_settings_class_init (MetaSettingsClass *klass)
1660 NULL, NULL, NULL,1593 NULL, NULL, NULL,
1661 G_TYPE_NONE, 0);1594 G_TYPE_NONE, 0);
1662 1595
@@ -2063,7 +1996,7 @@ index aad49d0..4ac32b9 100644
2063 int *max_width,1996 int *max_width,
2064 int *max_height);1997 int *max_height);
2065diff --git a/src/backends/x11/meta-monitor-manager-xrandr.c b/src/backends/x11/meta-monitor-manager-xrandr.c1998diff --git a/src/backends/x11/meta-monitor-manager-xrandr.c b/src/backends/x11/meta-monitor-manager-xrandr.c
2066index 784bbde..9594bf4 1006441999index 784bbde..47d19d6 100644
2067--- a/src/backends/x11/meta-monitor-manager-xrandr.c2000--- a/src/backends/x11/meta-monitor-manager-xrandr.c
2068+++ b/src/backends/x11/meta-monitor-manager-xrandr.c2001+++ b/src/backends/x11/meta-monitor-manager-xrandr.c
2069@@ -63,6 +63,9 @@2002@@ -63,6 +63,9 @@
@@ -2072,7 +2005,7 @@ index 784bbde..9594bf4 100644
2072 #define DPI_FALLBACK 96.02005 #define DPI_FALLBACK 96.0
2073+#define RANDR_VERSION_FORMAT(major, minor) ((major * 100) + minor)2006+#define RANDR_VERSION_FORMAT(major, minor) ((major * 100) + minor)
2074+#define RANDR_TILING_MIN_VERSION RANDR_VERSION_FORMAT (1, 5)2007+#define RANDR_TILING_MIN_VERSION RANDR_VERSION_FORMAT (1, 5)
2075+#define RANDR_TRANSFOMR_MIN_VERSION RANDR_VERSION_FORMAT (1, 3)2008+#define RANDR_TRANSFORM_MIN_VERSION RANDR_VERSION_FORMAT (1, 3)
2076 2009
2077 struct _MetaMonitorManagerXrandr2010 struct _MetaMonitorManagerXrandr
2078 {2011 {
@@ -2374,7 +2307,7 @@ index 784bbde..9594bf4 100644
2374 }2307 }
2375 }2308 }
2376 2309
2377@@ -568,8 +681,64 @@ meta_monitor_manager_xrandr_rebuild_derived (MetaMonitorManager *manager,2310@@ -568,8 +681,56 @@ meta_monitor_manager_xrandr_rebuild_derived (MetaMonitorManager *manager,
2378 {2311 {
2379 MetaMonitorManagerXrandr *manager_xrandr =2312 MetaMonitorManagerXrandr *manager_xrandr =
2380 META_MONITOR_MANAGER_XRANDR (manager);2313 META_MONITOR_MANAGER_XRANDR (manager);
@@ -2408,21 +2341,13 @@ index 784bbde..9594bf4 100644
2408+ scale = crtc->scale > 1.0f ? crtc->scale : 1.0f;2341+ scale = crtc->scale > 1.0f ? crtc->scale : 1.0f;
2409+ }2342+ }
2410+2343+
2411+ if (meta_monitor_transform_is_rotated (crtc->transform))2344+ /* When computing the screen size from the crtc rects we don't have to
2412+ {2345+ * use inverted values when monitors are rotated, because this is already
2413+ screen_width = MAX (screen_width, crtc->rect.x +2346+ * taken in account in the crtc rectangles */
2414+ roundf (crtc->rect.height * scale));2347+ screen_width = MAX (screen_width, crtc->rect.x +
2415+ screen_height = MAX (screen_height, crtc->rect.y +2348+ roundf (crtc->rect.width * scale));
2416+ roundf (crtc->rect.width * scale));2349+ screen_height = MAX (screen_height, crtc->rect.y +
2417+ }2350+ roundf (crtc->rect.height * scale));
2418+ else
2419+ {
2420+ screen_width = MAX (screen_width, crtc->rect.x +
2421+ roundf (crtc->rect.width * scale));
2422+ screen_height = MAX (screen_height, crtc->rect.y +
2423+ roundf (crtc->rect.height * scale));
2424+ }
2425+
2426+ ++n_crtcs;2351+ ++n_crtcs;
2427+2352+
2428+ /* This value isn't completely exact, since it doesn't take care of the2353+ /* This value isn't completely exact, since it doesn't take care of the
@@ -2440,7 +2365,7 @@ index 784bbde..9594bf4 100644
2440 meta_monitor_manager_rebuild_derived (manager, config);2365 meta_monitor_manager_rebuild_derived (manager, config);
2441 }2366 }
2442 2367
2443@@ -595,6 +764,9 @@ meta_monitor_manager_xrandr_apply_monitors_config (MetaMonitorManager *mana2368@@ -595,6 +756,9 @@ meta_monitor_manager_xrandr_apply_monitors_config (MetaMonitorManager *mana
2444 2369
2445 if (method != META_MONITORS_CONFIG_METHOD_VERIFY)2370 if (method != META_MONITORS_CONFIG_METHOD_VERIFY)
2446 {2371 {
@@ -2450,7 +2375,7 @@ index 784bbde..9594bf4 100644
2450 /*2375 /*
2451 * If the assignment has not changed, we won't get any notification about2376 * If the assignment has not changed, we won't get any notification about
2452 * any new configuration from the X server; but we still need to update2377 * any new configuration from the X server; but we still need to update
2453@@ -615,6 +787,8 @@ meta_monitor_manager_xrandr_apply_monitors_config (MetaMonitorManager *mana2378@@ -615,6 +779,8 @@ meta_monitor_manager_xrandr_apply_monitors_config (MetaMonitorManager *mana
2454 crtc_infos->len,2379 crtc_infos->len,
2455 (MetaOutputInfo **) output_infos->pdata,2380 (MetaOutputInfo **) output_infos->pdata,
2456 output_infos->len);2381 output_infos->len);
@@ -2459,7 +2384,7 @@ index 784bbde..9594bf4 100644
2459 }2384 }
2460 else2385 else
2461 {2386 {
2462@@ -748,7 +922,8 @@ meta_monitor_manager_xrandr_tiled_monitor_added (MetaMonitorManager *manager,2387@@ -748,7 +914,8 @@ meta_monitor_manager_xrandr_tiled_monitor_added (MetaMonitorManager *manager,
2463 GList *l;2388 GList *l;
2464 int i;2389 int i;
2465 2390
@@ -2469,7 +2394,7 @@ index 784bbde..9594bf4 100644
2469 return;2394 return;
2470 2395
2471 product = meta_monitor_get_product (monitor);2396 product = meta_monitor_get_product (monitor);
2472@@ -797,7 +972,8 @@ meta_monitor_manager_xrandr_tiled_monitor_removed (MetaMonitorManager *manager,2397@@ -797,7 +964,8 @@ meta_monitor_manager_xrandr_tiled_monitor_removed (MetaMonitorManager *manager,
2473 2398
2474 int monitor_count;2399 int monitor_count;
2475 2400
@@ -2479,7 +2404,7 @@ index 784bbde..9594bf4 100644
2479 return;2404 return;
2480 2405
2481 monitor_xrandr_data = meta_monitor_xrandr_data_from_monitor (monitor);2406 monitor_xrandr_data = meta_monitor_xrandr_data_from_monitor (monitor);
2482@@ -815,10 +991,12 @@ meta_monitor_manager_xrandr_tiled_monitor_removed (MetaMonitorManager *manager,2407@@ -815,10 +983,12 @@ meta_monitor_manager_xrandr_tiled_monitor_removed (MetaMonitorManager *manager,
2483 static void2408 static void
2484 meta_monitor_manager_xrandr_init_monitors (MetaMonitorManagerXrandr *manager_xrandr)2409 meta_monitor_manager_xrandr_init_monitors (MetaMonitorManagerXrandr *manager_xrandr)
2485 {2410 {
@@ -2493,7 +2418,7 @@ index 784bbde..9594bf4 100644
2493 return;2418 return;
2494 2419
2495 /* delete any tiled monitors setup, as mutter will want to recreate2420 /* delete any tiled monitors setup, as mutter will want to recreate
2496@@ -849,83 +1027,26 @@ meta_monitor_manager_xrandr_is_transform_handled (MetaMonitorManager *manager,2421@@ -849,83 +1019,26 @@ meta_monitor_manager_xrandr_is_transform_handled (MetaMonitorManager *manager,
2497 return TRUE;2422 return TRUE;
2498 }2423 }
2499 2424
@@ -2506,25 +2431,25 @@ index 784bbde..9594bf4 100644
2506 {2431 {
2507- return meta_monitor_calculate_mode_scale (monitor, monitor_mode);2432- return meta_monitor_calculate_mode_scale (monitor, monitor_mode);
2508-}2433-}
2509+ MetaMonitorScalesConstraint constraints = 0;2434-
2510
2511-static void2435-static void
2512-add_supported_scale (GArray *supported_scales,2436-add_supported_scale (GArray *supported_scales,
2513- float scale)2437- float scale)
2514-{2438-{
2515- unsigned int i;2439- unsigned int i;
2516+ if (meta_monitor_manager_get_capabilities (manager) &2440-
2517+ META_MONITOR_MANAGER_CAPABILITY_GLOBAL_SCALE_REQUIRED)
2518+ constraints |= META_MONITOR_SCALES_CONSTRAINT_NO_FRAC;
2519
2520- for (i = 0; i < supported_scales->len; i++)2441- for (i = 0; i < supported_scales->len; i++)
2521- {2442- {
2522- float supported_scale = g_array_index (supported_scales, float, i);2443- float supported_scale = g_array_index (supported_scales, float, i);
2523-2444+ MetaMonitorScalesConstraint constraints = 0;
2445
2524- if (scale == supported_scale)2446- if (scale == supported_scale)
2525- return;2447- return;
2526- }2448- }
2527-2449+ if (meta_monitor_manager_get_capabilities (manager) &
2450+ META_MONITOR_MANAGER_CAPABILITY_GLOBAL_SCALE_REQUIRED)
2451+ constraints |= META_MONITOR_SCALES_CONSTRAINT_NO_FRAC;
2452
2528- g_array_append_val (supported_scales, scale);2453- g_array_append_val (supported_scales, scale);
2529+ return constraints;2454+ return constraints;
2530 }2455 }
@@ -2532,7 +2457,12 @@ index 784bbde..9594bf4 100644
2532-static int2457-static int
2533-compare_scales (gconstpointer a,2458-compare_scales (gconstpointer a,
2534- gconstpointer b)2459- gconstpointer b)
2535-{2460+static float
2461+meta_monitor_manager_xrandr_calculate_monitor_mode_scale (MetaMonitorManager *manager,
2462+ MetaLogicalMonitorLayoutMode layout_mode,
2463+ MetaMonitor *monitor,
2464+ MetaMonitorMode *monitor_mode)
2465 {
2536- float f = *(float *) a - *(float *) b;2466- float f = *(float *) a - *(float *) b;
2537-2467-
2538- if (f < 0)2468- if (f < 0)
@@ -2544,12 +2474,7 @@ index 784bbde..9594bf4 100644
2544-2474-
2545-static void2475-static void
2546-ensure_supported_monitor_scales (MetaMonitorManager *manager)2476-ensure_supported_monitor_scales (MetaMonitorManager *manager)
2547+static float2477-{
2548+meta_monitor_manager_xrandr_calculate_monitor_mode_scale (MetaMonitorManager *manager,
2549+ MetaLogicalMonitorLayoutMode layout_mode,
2550+ MetaMonitor *monitor,
2551+ MetaMonitorMode *monitor_mode)
2552 {
2553- MetaMonitorManagerXrandr *manager_xrandr =2478- MetaMonitorManagerXrandr *manager_xrandr =
2554- META_MONITOR_MANAGER_XRANDR (manager);2479- META_MONITOR_MANAGER_XRANDR (manager);
2555- MetaMonitorScalesConstraint constraints;2480- MetaMonitorScalesConstraint constraints;
@@ -2591,7 +2516,7 @@ index 784bbde..9594bf4 100644
2591 }2516 }
2592 2517
2593 static float *2518 static float *
2594@@ -935,21 +1056,35 @@ meta_monitor_manager_xrandr_calculate_supported_scales (MetaMonitorManager2519@@ -935,21 +1048,35 @@ meta_monitor_manager_xrandr_calculate_supported_scales (MetaMonitorManager
2595 MetaMonitorMode *monitor_mode,2520 MetaMonitorMode *monitor_mode,
2596 int *n_supported_scales)2521 int *n_supported_scales)
2597 {2522 {
@@ -2625,7 +2550,7 @@ index 784bbde..9594bf4 100644
2625+2550+
2626+ if (meta_settings_is_experimental_feature_enabled (settings,2551+ if (meta_settings_is_experimental_feature_enabled (settings,
2627+ META_EXPERIMENTAL_FEATURE_X11_RANDR_FRACTIONAL_SCALING) &&2552+ META_EXPERIMENTAL_FEATURE_X11_RANDR_FRACTIONAL_SCALING) &&
2628+ xrandr_manager->randr_version >= RANDR_TRANSFOMR_MIN_VERSION)2553+ xrandr_manager->randr_version >= RANDR_TRANSFORM_MIN_VERSION)
2629+ {2554+ {
2630+ capabilities |= META_MONITOR_MANAGER_CAPABILITY_NATIVE_OUTPUT_SCALING |2555+ capabilities |= META_MONITOR_MANAGER_CAPABILITY_NATIVE_OUTPUT_SCALING |
2631+ META_MONITOR_MANAGER_CAPABILITY_LAYOUT_MODE;2556+ META_MONITOR_MANAGER_CAPABILITY_LAYOUT_MODE;
@@ -2637,7 +2562,7 @@ index 784bbde..9594bf4 100644
2637 }2562 }
2638 2563
2639 static gboolean2564 static gboolean
2640@@ -966,9 +1101,30 @@ meta_monitor_manager_xrandr_get_max_screen_size (MetaMonitorManager *manager,2565@@ -966,9 +1093,30 @@ meta_monitor_manager_xrandr_get_max_screen_size (MetaMonitorManager *manager,
2641 return TRUE;2566 return TRUE;
2642 }2567 }
2643 2568
@@ -2668,7 +2593,7 @@ index 784bbde..9594bf4 100644
2668 return META_LOGICAL_MONITOR_LAYOUT_MODE_PHYSICAL;2593 return META_LOGICAL_MONITOR_LAYOUT_MODE_PHYSICAL;
2669 }2594 }
2670 2595
2671@@ -978,10 +1134,15 @@ meta_monitor_manager_xrandr_constructed (GObject *object)2596@@ -978,10 +1126,15 @@ meta_monitor_manager_xrandr_constructed (GObject *object)
2672 MetaMonitorManagerXrandr *manager_xrandr =2597 MetaMonitorManagerXrandr *manager_xrandr =
2673 META_MONITOR_MANAGER_XRANDR (object);2598 META_MONITOR_MANAGER_XRANDR (object);
2674 MetaMonitorManager *manager = META_MONITOR_MANAGER (manager_xrandr);2599 MetaMonitorManager *manager = META_MONITOR_MANAGER (manager_xrandr);
@@ -2687,7 +2612,7 @@ index 784bbde..9594bf4 100644
2687 2612
2688 manager_xrandr->gpu = META_GPU (meta_gpu_xrandr_new (manager_xrandr));2613 manager_xrandr->gpu = META_GPU (meta_gpu_xrandr_new (manager_xrandr));
2689 meta_monitor_manager_add_gpu (manager, manager_xrandr->gpu);2614 meta_monitor_manager_add_gpu (manager, manager_xrandr->gpu);
2690@@ -1003,16 +1164,13 @@ meta_monitor_manager_xrandr_constructed (GObject *object)2615@@ -1003,16 +1156,13 @@ meta_monitor_manager_xrandr_constructed (GObject *object)
2691 | RRCrtcChangeNotifyMask2616 | RRCrtcChangeNotifyMask
2692 | RROutputPropertyNotifyMask);2617 | RROutputPropertyNotifyMask);
2693 2618
@@ -2709,7 +2634,7 @@ index 784bbde..9594bf4 100644
2709 meta_monitor_manager_xrandr_init_monitors (manager_xrandr);2634 meta_monitor_manager_xrandr_init_monitors (manager_xrandr);
2710 }2635 }
2711 2636
2712@@ -1026,7 +1184,6 @@ meta_monitor_manager_xrandr_finalize (GObject *object)2637@@ -1026,7 +1176,6 @@ meta_monitor_manager_xrandr_finalize (GObject *object)
2713 2638
2714 g_clear_object (&manager_xrandr->gpu);2639 g_clear_object (&manager_xrandr->gpu);
2715 g_hash_table_destroy (manager_xrandr->tiled_monitor_atoms);2640 g_hash_table_destroy (manager_xrandr->tiled_monitor_atoms);
@@ -2756,47 +2681,35 @@ index 515389d..3bc7f0b 100644
2756 return;2681 return;
2757 2682
2758 tile_atom = XInternAtom (xdisplay, "TILE", FALSE);2683 tile_atom = XInternAtom (xdisplay, "TILE", FALSE);
2759diff --git a/src/compositor/compositor-private.h b/src/compositor/compositor-private.h
2760index 0f92d42..13a8a6a 100644
2761--- a/src/compositor/compositor-private.h
2762+++ b/src/compositor/compositor-private.h
2763@@ -13,6 +13,8 @@
2764
2765 struct _MetaCompositor
2766 {
2767+ GObject parent;
2768+
2769 MetaDisplay *display;
2770
2771 guint pre_paint_func_id;
2772diff --git a/src/compositor/compositor.c b/src/compositor/compositor.c2684diff --git a/src/compositor/compositor.c b/src/compositor/compositor.c
2773index 0854a19..7fc2943 1006442685index 0854a19..e412784 100644
2774--- a/src/compositor/compositor.c2686--- a/src/compositor/compositor.c
2775+++ b/src/compositor/compositor.c2687+++ b/src/compositor/compositor.c
2776@@ -86,6 +86,8 @@2688@@ -92,6 +92,11 @@ on_presented (ClutterStage *stage,
2777 #include "wayland/meta-wayland-private.h"2689 ClutterFrameInfo *frame_info,
2778 #endif2690 MetaCompositor *compositor);
2779 2691
2780+G_DEFINE_TYPE (MetaCompositor, meta_compositor, G_TYPE_OBJECT)2692+static void
2693+on_redirected_monitor_changed (MetaWindow *window,
2694+ int old_monitor,
2695+ MetaCompositor *compositor);
2781+2696+
2782 static void2697 static gboolean
2783 on_presented (ClutterStage *stage,2698 is_modal (MetaDisplay *display)
2784 CoglFrameEvent event,
2785@@ -131,11 +133,8 @@ meta_switch_workspace_completed (MetaCompositor *compositor)
2786 void
2787 meta_compositor_destroy (MetaCompositor *compositor)
2788 {2699 {
2789- clutter_threads_remove_repaint_func (compositor->pre_paint_func_id);2700@@ -134,6 +139,11 @@ meta_compositor_destroy (MetaCompositor *compositor)
2790- clutter_threads_remove_repaint_func (compositor->post_paint_func_id);2701 clutter_threads_remove_repaint_func (compositor->pre_paint_func_id);
2791-2702 clutter_threads_remove_repaint_func (compositor->post_paint_func_id);
2792- if (compositor->have_x11_sync_object)
2793- meta_sync_ring_destroy ();
2794+ g_object_run_dispose (G_OBJECT (compositor));
2795+ g_object_unref (compositor);
2796 }
2797 2703
2798 static void2704+ if (compositor->unredirected_window)
2799@@ -635,16 +634,54 @@ meta_shape_cow_for_window (MetaCompositor *compositor,2705+ g_signal_handlers_disconnect_by_func (compositor->unredirected_window,
2706+ on_redirected_monitor_changed,
2707+ compositor);
2708+
2709 if (compositor->have_x11_sync_object)
2710 meta_sync_ring_destroy ();
2711 }
2712@@ -635,16 +645,54 @@ meta_shape_cow_for_window (MetaCompositor *compositor,
2800 }2713 }
2801 }2714 }
2802 2715
@@ -2851,81 +2764,21 @@ index 0854a19..7fc2943 100644
2851 meta_window_actor_set_unredirected (window_actor, FALSE);2764 meta_window_actor_set_unredirected (window_actor, FALSE);
2852 }2765 }
2853 2766
2854@@ -654,6 +691,13 @@ set_unredirected_window (MetaCompositor *compositor,2767@@ -654,6 +702,12 @@ set_unredirected_window (MetaCompositor *compositor,
2855 if (compositor->unredirected_window != NULL)2768 if (compositor->unredirected_window != NULL)
2856 {2769 {
2857 MetaWindowActor *window_actor = META_WINDOW_ACTOR (meta_window_get_compositor_private (compositor->unredirected_window));2770 MetaWindowActor *window_actor = META_WINDOW_ACTOR (meta_window_get_compositor_private (compositor->unredirected_window));
2858+2771+
2859+ meta_monitor_manager_disable_scale_for_monitor (monitor_manager,2772+ meta_monitor_manager_disable_scale_for_monitor (monitor_manager,
2860+ window->monitor);2773+ window->monitor);
2861+ g_signal_connect_object (window, "monitor-changed",2774+ g_signal_connect (window, "monitor-changed",
2862+ G_CALLBACK (on_redirected_monitor_changed),2775+ G_CALLBACK (on_redirected_monitor_changed), compositor);
2863+ compositor, 0);
2864+2776+
2865 meta_window_actor_set_unredirected (window_actor, TRUE);2777 meta_window_actor_set_unredirected (window_actor, TRUE);
2866 }2778 }
2867 }2779 }
2868@@ -1274,12 +1318,20 @@ on_shadow_factory_changed (MetaShadowFactory *factory,
2869 MetaCompositor *
2870 meta_compositor_new (MetaDisplay *display)
2871 {
2872- MetaBackend *backend = meta_get_backend ();
2873- ClutterBackend *clutter_backend = meta_backend_get_clutter_backend (backend);
2874 MetaCompositor *compositor;
2875
2876- compositor = g_new0 (MetaCompositor, 1);
2877+ compositor = g_object_new (META_TYPE_COMPOSITOR, NULL);
2878 compositor->display = display;
2879+
2880+ return compositor;
2881+}
2882+
2883+static void
2884+meta_compositor_init (MetaCompositor *compositor)
2885+{
2886+ MetaBackend *backend = meta_get_backend ();
2887+ ClutterBackend *clutter_backend = meta_backend_get_clutter_backend (backend);
2888+
2889 compositor->context = clutter_backend->cogl_context;
2890
2891 g_signal_connect (meta_shadow_factory_get_default (),
2892@@ -1297,7 +1349,33 @@ meta_compositor_new (MetaDisplay *display)
2893 meta_post_paint_func,
2894 compositor,
2895 NULL);
2896- return compositor;
2897+}
2898+
2899+static void
2900+meta_compositor_dispose (GObject *gobject)
2901+{
2902+ MetaCompositor *compositor = META_COMPOSITOR (gobject);
2903+
2904+ g_clear_handle_id (&compositor->pre_paint_func_id,
2905+ clutter_threads_remove_repaint_func);
2906+ g_clear_handle_id (&compositor->post_paint_func_id,
2907+ clutter_threads_remove_repaint_func);
2908+
2909+ if (compositor->have_x11_sync_object)
2910+ {
2911+ meta_sync_ring_destroy ();
2912+ compositor->have_x11_sync_object = FALSE;
2913+ }
2914+
2915+ G_OBJECT_CLASS (meta_compositor_parent_class)->dispose (gobject);
2916+}
2917+
2918+static void
2919+meta_compositor_class_init (MetaCompositorClass *klass)
2920+{
2921+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
2922+
2923+ gobject_class->dispose = meta_compositor_dispose;
2924 }
2925
2926 /**
2927diff --git a/src/core/boxes-private.h b/src/core/boxes-private.h2780diff --git a/src/core/boxes-private.h b/src/core/boxes-private.h
2928index 24c596b..bb88083 1006442781index 24c596b..f92837a 100644
2929--- a/src/core/boxes-private.h2782--- a/src/core/boxes-private.h
2930+++ b/src/core/boxes-private.h2783+++ b/src/core/boxes-private.h
2931@@ -157,6 +157,10 @@ gboolean meta_rectangle_overlaps_with_region (2784@@ -157,6 +157,10 @@ gboolean meta_rectangle_overlaps_with_region (
@@ -2939,17 +2792,8 @@ index 24c596b..bb88083 100644
2939 /* Make the rectangle small enough to fit into one of the spanning_rects,2792 /* Make the rectangle small enough to fit into one of the spanning_rects,
2940 * but make it no smaller than min_size.2793 * but make it no smaller than min_size.
2941 */2794 */
2942@@ -284,4 +288,8 @@ void meta_rectangle_crop_and_scale (const MetaRectangle *rect,
2943 int dst_height,
2944 MetaRectangle *dest);
2945
2946+gboolean meta_rectangle_has_neighbor (const MetaRectangle *rect,
2947+ const MetaRectangle *neighbor,
2948+ MetaSide neighbor_side);
2949+
2950 #endif /* META_BOXES_PRIVATE_H */
2951diff --git a/src/core/boxes.c b/src/core/boxes.c2795diff --git a/src/core/boxes.c b/src/core/boxes.c
2952index 87f2d5d..7c30153 1006442796index 87f2d5d..95978c1 100644
2953--- a/src/core/boxes.c2797--- a/src/core/boxes.c
2954+++ b/src/core/boxes.c2798+++ b/src/core/boxes.c
2955@@ -911,6 +911,27 @@ meta_rectangle_overlaps_with_region (const GList *spanning_rects,2799@@ -911,6 +911,27 @@ meta_rectangle_overlaps_with_region (const GList *spanning_rects,
@@ -2966,7 +2810,7 @@ index 87f2d5d..7c30153 100644
2966+ {2810+ {
2967+ MetaRectangle *other = (MetaRectangle *) l->data;2811+ MetaRectangle *other = (MetaRectangle *) l->data;
2968+2812+
2969+ if (other == rect)2813+ if (rect == other || meta_rectangle_equal (rect, other))
2970+ continue;2814+ continue;
2971+2815+
2972+ if (meta_rectangle_is_adjecent_to ((MetaRectangle *) rect, other))2816+ if (meta_rectangle_is_adjecent_to ((MetaRectangle *) rect, other))
@@ -2980,56 +2824,6 @@ index 87f2d5d..7c30153 100644
2980 2824
2981 void2825 void
2982 meta_rectangle_clamp_to_fit_into_region (const GList *spanning_rects,2826 meta_rectangle_clamp_to_fit_into_region (const GList *spanning_rects,
2983@@ -2201,3 +2222,35 @@ meta_rectangle_crop_and_scale (const MetaRectangle *rect,
2984
2985 meta_rectangle_from_clutter_rect (&tmp, META_ROUNDING_STRATEGY_GROW, dest);
2986 }
2987+
2988+gboolean
2989+meta_rectangle_has_neighbor (const MetaRectangle *rect,
2990+ const MetaRectangle *neighbor,
2991+ MetaSide neighbor_side)
2992+{
2993+ switch (neighbor_side)
2994+ {
2995+ case META_SIDE_RIGHT:
2996+ if (neighbor->x == (rect->x + rect->width) &&
2997+ meta_rectangle_vert_overlap (neighbor, rect))
2998+ return TRUE;
2999+ break;
3000+ case META_SIDE_LEFT:
3001+ if (rect->x == (neighbor->x + neighbor->width) &&
3002+ meta_rectangle_vert_overlap (neighbor, rect))
3003+ return TRUE;
3004+ break;
3005+ case META_SIDE_TOP:
3006+ if (rect->y == (neighbor->y + neighbor->height) &&
3007+ meta_rectangle_horiz_overlap (neighbor, rect))
3008+ return TRUE;
3009+ break;
3010+ case META_SIDE_BOTTOM:
3011+ if (neighbor->y == (rect->y + rect->height) &&
3012+ meta_rectangle_horiz_overlap (neighbor, rect))
3013+ return TRUE;
3014+ break;
3015+ }
3016+
3017+ return FALSE;
3018+}
3019diff --git a/src/core/display.c b/src/core/display.c
3020index e1477d3..0a55d90 100644
3021--- a/src/core/display.c
3022+++ b/src/core/display.c
3023@@ -946,8 +946,7 @@ meta_display_close (MetaDisplay *display,
3024 g_hash_table_destroy (display->wayland_windows);
3025 g_hash_table_destroy (display->stamps);
3026
3027- if (display->compositor)
3028- meta_compositor_destroy (display->compositor);
3029+ g_clear_object (&display->compositor);
3030
3031 if (display->x11_display)
3032 {
3033diff --git a/src/core/window.c b/src/core/window.c2827diff --git a/src/core/window.c b/src/core/window.c
3034index 62b2df8..d1cf7c3 1006442828index 62b2df8..d1cf7c3 100644
3035--- a/src/core/window.c2829--- a/src/core/window.c
@@ -3074,41 +2868,6 @@ index 62b2df8..d1cf7c3 100644
3074 if (old)2868 if (old)
3075 g_signal_emit_by_name (window->display, "window-left-monitor",2869 g_signal_emit_by_name (window->display, "window-left-monitor",
3076 old->number, window);2870 old->number, window);
3077diff --git a/src/meta/compositor.h b/src/meta/compositor.h
3078index 31d14dd..7fad05b 100644
3079--- a/src/meta/compositor.h
3080+++ b/src/meta/compositor.h
3081@@ -28,6 +28,11 @@
3082 #include <meta/window.h>
3083 #include <meta/workspace.h>
3084
3085+#define META_TYPE_COMPOSITOR (meta_compositor_get_type ())
3086+
3087+META_EXPORT
3088+G_DECLARE_FINAL_TYPE (MetaCompositor, meta_compositor, META, COMPOSITOR, GObject)
3089+
3090 /**
3091 * MetaCompEffect:
3092 * @META_COMP_EFFECT_CREATE: The window is newly created
3093diff --git a/src/meta/display.h b/src/meta/display.h
3094index 1703920..0eb1629 100644
3095--- a/src/meta/display.h
3096+++ b/src/meta/display.h
3097@@ -226,10 +226,10 @@ void meta_display_set_cursor (MetaDisplay *display,
3098 */
3099 typedef enum
3100 {
3101- META_DISPLAY_UP,
3102- META_DISPLAY_DOWN,
3103- META_DISPLAY_LEFT,
3104- META_DISPLAY_RIGHT
3105+ META_DISPLAY_UP = META_DIRECTION_UP,
3106+ META_DISPLAY_DOWN = META_DIRECTION_DOWN,
3107+ META_DISPLAY_LEFT = META_DIRECTION_LEFT,
3108+ META_DISPLAY_RIGHT = META_DIRECTION_RIGHT,
3109 } MetaDisplayDirection;
3110
3111 META_EXPORT
3112diff --git a/src/org.gnome.Mutter.DisplayConfig.xml b/src/org.gnome.Mutter.DisplayConfig.xml2871diff --git a/src/org.gnome.Mutter.DisplayConfig.xml b/src/org.gnome.Mutter.DisplayConfig.xml
3113index 3abfa15..4ec6cd4 1006442872index 3abfa15..4ec6cd4 100644
3114--- a/src/org.gnome.Mutter.DisplayConfig.xml2873--- a/src/org.gnome.Mutter.DisplayConfig.xml

Subscribers

People subscribed via source and target branches