summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--vcl/unx/gtk/gtksys.cxx18
1 files changed, 15 insertions, 3 deletions
diff --git a/vcl/unx/gtk/gtksys.cxx b/vcl/unx/gtk/gtksys.cxx
index e663bb91beb6..a29e7218a864 100644
--- a/vcl/unx/gtk/gtksys.cxx
+++ b/vcl/unx/gtk/gtksys.cxx
@@ -62,6 +62,17 @@ GtkSalSystem::GetDisplayXScreenCount()
namespace
{
+struct GdkRectangleCoincidentLess
+{
+ // fdo#78799 - detect and elide overlaying monitors of different sizes
+ bool operator()(GdkRectangle const& rLeft, GdkRectangle const& rRight)
+ {
+ return
+ rLeft.x < rRight.x
+ || rLeft.y < rRight.y
+ ;
+ }
+};
struct GdkRectangleCoincident
{
// fdo#78799 - detect and elide overlaying monitors of different sizes
@@ -101,10 +112,11 @@ GtkSalSystem::countScreenMonitors()
gdk_screen_get_monitor_geometry(pScreen, j, &aGeometry);
aGeometries.push_back(aGeometry);
}
- GdkRectangleCoincident aCmp;
- std::sort(aGeometries.begin(), aGeometries.end(), aCmp);
+ std::sort(aGeometries.begin(), aGeometries.end(),
+ GdkRectangleCoincidentLess());
const std::vector<GdkRectangle>::iterator aUniqueEnd(
- std::unique(aGeometries.begin(), aGeometries.end(), aCmp));
+ std::unique(aGeometries.begin(), aGeometries.end(),
+ GdkRectangleCoincident()));
nMonitors = std::distance(aGeometries.begin(), aUniqueEnd);
}
maScreenMonitors.push_back(std::make_pair(pScreen, nMonitors));