mirror of
https://forge.fsky.io/oneflux/omegafox.git
synced 2026-02-10 06:42:04 -08:00
Workaround to restore custom match media without disabling HiDPI
This commit is contained in:
parent
aeae79f1b4
commit
c75baab79b
2 changed files with 22 additions and 8 deletions
|
|
@ -28,7 +28,7 @@ index a2b3e60fe5..faa0c113bc 100644
|
||||||
+LOCAL_INCLUDES += ["/camoucfg"]
|
+LOCAL_INCLUDES += ["/camoucfg"]
|
||||||
\ No newline at end of file
|
\ No newline at end of file
|
||||||
diff --git a/gfx/src/nsDeviceContext.cpp b/gfx/src/nsDeviceContext.cpp
|
diff --git a/gfx/src/nsDeviceContext.cpp b/gfx/src/nsDeviceContext.cpp
|
||||||
index 7a4fa8d48f..1f560937a3 100644
|
index 7a4fa8d48f..408b754d92 100644
|
||||||
--- a/gfx/src/nsDeviceContext.cpp
|
--- a/gfx/src/nsDeviceContext.cpp
|
||||||
+++ b/gfx/src/nsDeviceContext.cpp
|
+++ b/gfx/src/nsDeviceContext.cpp
|
||||||
@@ -5,6 +5,7 @@
|
@@ -5,6 +5,7 @@
|
||||||
|
|
@ -39,7 +39,7 @@ index 7a4fa8d48f..1f560937a3 100644
|
||||||
#include <algorithm> // for max
|
#include <algorithm> // for max
|
||||||
#include "gfxContext.h"
|
#include "gfxContext.h"
|
||||||
#include "gfxPoint.h" // for gfxSize
|
#include "gfxPoint.h" // for gfxSize
|
||||||
@@ -177,6 +178,15 @@ bool nsDeviceContext::GetScreenIsHDR() {
|
@@ -177,6 +178,13 @@ bool nsDeviceContext::GetScreenIsHDR() {
|
||||||
}
|
}
|
||||||
|
|
||||||
nsSize nsDeviceContext::GetDeviceSurfaceDimensions() {
|
nsSize nsDeviceContext::GetDeviceSurfaceDimensions() {
|
||||||
|
|
@ -47,11 +47,28 @@ index 7a4fa8d48f..1f560937a3 100644
|
||||||
+ if (auto height = MaskConfig::GetInt32("screen.height"),
|
+ if (auto height = MaskConfig::GetInt32("screen.height"),
|
||||||
+ width = MaskConfig::GetInt32("screen.width");
|
+ width = MaskConfig::GetInt32("screen.width");
|
||||||
+ height && width) {
|
+ height && width) {
|
||||||
+ nsRect outRect = LayoutDeviceIntRect::ToAppUnits(
|
+ nsRect outRect = CSSPixel::ToAppUnits(CSSIntRect(0, 0, width.value(), height.value()));
|
||||||
+ LayoutDeviceIntRect(0, 0, width.value(), height.value()),
|
|
||||||
+ AppUnitsPerDevPixel());
|
|
||||||
+ return outRect.Size();
|
+ return outRect.Size();
|
||||||
+ }
|
+ }
|
||||||
return GetRect().Size();
|
return GetRect().Size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
diff --git a/layout/style/nsMediaFeatures.cpp b/layout/style/nsMediaFeatures.cpp
|
||||||
|
index f83e2c21ca..5362dd77d4 100644
|
||||||
|
--- a/layout/style/nsMediaFeatures.cpp
|
||||||
|
+++ b/layout/style/nsMediaFeatures.cpp
|
||||||
|
@@ -66,14 +66,6 @@ static nsSize GetDeviceSize(const Document& aDocument) {
|
||||||
|
return GetSize(aDocument);
|
||||||
|
}
|
||||||
|
|
||||||
|
- // Media queries in documents in an RDM pane should use the simulated
|
||||||
|
- // device size.
|
||||||
|
- Maybe<CSSIntSize> deviceSize =
|
||||||
|
- nsGlobalWindowOuter::GetRDMDeviceSize(aDocument);
|
||||||
|
- if (deviceSize.isSome()) {
|
||||||
|
- return CSSPixel::ToAppUnits(deviceSize.value());
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
nsPresContext* pc = aDocument.GetPresContext();
|
||||||
|
// NOTE(emilio): We should probably figure out how to return an appropriate
|
||||||
|
// device size here, though in a multi-screen world that makes no sense
|
||||||
|
|
|
||||||
|
|
@ -38,9 +38,6 @@ defaultPref(
|
||||||
"https://raw.githubusercontent.com/daijro/camoufox/refs/heads/main/assets/uBOAssets.json"
|
"https://raw.githubusercontent.com/daijro/camoufox/refs/heads/main/assets/uBOAssets.json"
|
||||||
);
|
);
|
||||||
|
|
||||||
// Disable hidpi by default
|
|
||||||
defaultPref("layout.css.devPixelsPerPx", "1");
|
|
||||||
|
|
||||||
// Tweaks that undo Playwright:
|
// Tweaks that undo Playwright:
|
||||||
|
|
||||||
// Enable content isolation (WAFs can detect this!)
|
// Enable content isolation (WAFs can detect this!)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue