Pier Angelo Vendrame pushed to branch mullvad-browser-128.3.0esr-14.0-1 at The Tor Project / Applications / Mullvad Browser
Commits:
666891c7 by stransky at 2024-10-15T22:24:49+02:00
Bug 1501744 [Linux] Fill PointerEvents on the Gtk backend r=emilio
Patch author is tpxp <tpxp(a)live.fr>
Differential Revision: https://phabricator.services.mozilla.com/D215201
- - - - -
1 changed file:
- widget/gtk/nsWindow.cpp
Changes:
=====================================
widget/gtk/nsWindow.cpp
=====================================
@@ -784,6 +784,53 @@ void nsWindow::ReparentNativeWidget(nsIWidget* aNewParent) {
GtkWindowSetTransientFor(GTK_WINDOW(mShell), newParentWidget);
}
+static void InitPenEvent(WidgetMouseEvent& aGeckoEvent, GdkEvent* aEvent) {
+ // Find the source of the event
+ GdkDevice* device = gdk_event_get_source_device(aEvent);
+ GdkInputSource eSource = gdk_device_get_source(device);
+ gdouble value;
+
+ // We distinguish touch screens from pens using the event type
+ // Eraser corresponds to the pen with the "erase" button pressed
+ if (eSource != GDK_SOURCE_PEN && eSource != GDK_SOURCE_ERASER) {
+ bool XWaylandPen = false;
+#ifdef MOZ_X11
+ // Workaround : When using Xwayland, pens are reported as
+ // GDK_SOURCE_TOUCHSCREEN If eSource is GDK_SOURCE_TOUCHSCREEN and the
+ // GDK_AXIS_XTILT and GDK_AXIS_YTILT axes are reported then it's a pen and
+ // not a finger on a screen. Yes, that's a stupid heuristic but it works...
+ // Note, however, that the tilt values are not reliable
+ // Another approach could be use the device tool type, but that's only
+ // available in GTK > 3.22
+ XWaylandPen = (eSource == GDK_SOURCE_TOUCHSCREEN && GdkIsX11Display() &&
+ gdk_event_get_axis(aEvent, GDK_AXIS_XTILT, &value) &&
+ gdk_event_get_axis(aEvent, GDK_AXIS_YTILT, &value));
+#endif
+ if (!XWaylandPen) {
+ return;
+ }
+ LOGW("InitPenEvent(): Is XWayland pen");
+ }
+
+ aGeckoEvent.mInputSource = dom::MouseEvent_Binding::MOZ_SOURCE_PEN;
+ aGeckoEvent.pointerId = 1;
+
+ // The range of xtilt and ytilt are -1 to 1. Normalize it to -90 to 90.
+ if (gdk_event_get_axis(aEvent, GDK_AXIS_XTILT, &value)) {
+ aGeckoEvent.tiltX = int32_t(NS_round(value * 90));
+ }
+ if (gdk_event_get_axis(aEvent, GDK_AXIS_YTILT, &value)) {
+ aGeckoEvent.tiltY = int32_t(NS_round(value * 90));
+ }
+ if (gdk_event_get_axis(aEvent, GDK_AXIS_PRESSURE, &value)) {
+ aGeckoEvent.mPressure = (float)value;
+ // Make sure the pression is acceptable
+ MOZ_ASSERT(aGeckoEvent.mPressure >= 0.0 && aGeckoEvent.mPressure <= 1.0);
+ }
+
+ LOGW("InitPenEvent(): pressure %f\n", aGeckoEvent.mPressure);
+}
+
void nsWindow::SetModal(bool aModal) {
LOG("nsWindow::SetModal %d\n", aModal);
if (mIsDestroyed) {
@@ -4530,6 +4577,7 @@ void nsWindow::OnMotionNotifyEvent(GdkEventMotion* aEvent) {
event.AssignEventTime(GetWidgetEventTime(aEvent->time));
KeymapWrapper::InitInputEvent(event, aEvent->state);
+ InitPenEvent(event, (GdkEvent*)aEvent);
DispatchInputEvent(&event);
}
@@ -4806,6 +4854,7 @@ void nsWindow::OnButtonPressEvent(GdkEventButton* aEvent) {
InitButtonEvent(event, aEvent, refPoint);
event.mPressure = mLastMotionPressure;
+ InitPenEvent(event, (GdkEvent*)aEvent);
nsIWidget::ContentAndAPZEventStatus eventStatus = DispatchInputEvent(&event);
const bool defaultPrevented =
@@ -4875,6 +4924,8 @@ void nsWindow::OnButtonReleaseEvent(GdkEventButton* aEvent) {
// to use it for the doubleclick position check.
const LayoutDeviceIntPoint pos = event.mRefPoint;
+ InitPenEvent(event, (GdkEvent*)aEvent);
+
nsIWidget::ContentAndAPZEventStatus eventStatus = DispatchInputEvent(&event);
const bool defaultPrevented =
View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/commit/666…
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/commit/666…
You're receiving this email because of your account on gitlab.torproject.org.
Pier Angelo Vendrame pushed to branch base-browser-128.3.0esr-14.0-1 at The Tor Project / Applications / Tor Browser
Commits:
e9810c42 by stransky at 2024-10-15T22:22:35+02:00
Bug 1501744 [Linux] Fill PointerEvents on the Gtk backend r=emilio
Patch author is tpxp <tpxp(a)live.fr>
Differential Revision: https://phabricator.services.mozilla.com/D215201
- - - - -
1 changed file:
- widget/gtk/nsWindow.cpp
Changes:
=====================================
widget/gtk/nsWindow.cpp
=====================================
@@ -784,6 +784,53 @@ void nsWindow::ReparentNativeWidget(nsIWidget* aNewParent) {
GtkWindowSetTransientFor(GTK_WINDOW(mShell), newParentWidget);
}
+static void InitPenEvent(WidgetMouseEvent& aGeckoEvent, GdkEvent* aEvent) {
+ // Find the source of the event
+ GdkDevice* device = gdk_event_get_source_device(aEvent);
+ GdkInputSource eSource = gdk_device_get_source(device);
+ gdouble value;
+
+ // We distinguish touch screens from pens using the event type
+ // Eraser corresponds to the pen with the "erase" button pressed
+ if (eSource != GDK_SOURCE_PEN && eSource != GDK_SOURCE_ERASER) {
+ bool XWaylandPen = false;
+#ifdef MOZ_X11
+ // Workaround : When using Xwayland, pens are reported as
+ // GDK_SOURCE_TOUCHSCREEN If eSource is GDK_SOURCE_TOUCHSCREEN and the
+ // GDK_AXIS_XTILT and GDK_AXIS_YTILT axes are reported then it's a pen and
+ // not a finger on a screen. Yes, that's a stupid heuristic but it works...
+ // Note, however, that the tilt values are not reliable
+ // Another approach could be use the device tool type, but that's only
+ // available in GTK > 3.22
+ XWaylandPen = (eSource == GDK_SOURCE_TOUCHSCREEN && GdkIsX11Display() &&
+ gdk_event_get_axis(aEvent, GDK_AXIS_XTILT, &value) &&
+ gdk_event_get_axis(aEvent, GDK_AXIS_YTILT, &value));
+#endif
+ if (!XWaylandPen) {
+ return;
+ }
+ LOGW("InitPenEvent(): Is XWayland pen");
+ }
+
+ aGeckoEvent.mInputSource = dom::MouseEvent_Binding::MOZ_SOURCE_PEN;
+ aGeckoEvent.pointerId = 1;
+
+ // The range of xtilt and ytilt are -1 to 1. Normalize it to -90 to 90.
+ if (gdk_event_get_axis(aEvent, GDK_AXIS_XTILT, &value)) {
+ aGeckoEvent.tiltX = int32_t(NS_round(value * 90));
+ }
+ if (gdk_event_get_axis(aEvent, GDK_AXIS_YTILT, &value)) {
+ aGeckoEvent.tiltY = int32_t(NS_round(value * 90));
+ }
+ if (gdk_event_get_axis(aEvent, GDK_AXIS_PRESSURE, &value)) {
+ aGeckoEvent.mPressure = (float)value;
+ // Make sure the pression is acceptable
+ MOZ_ASSERT(aGeckoEvent.mPressure >= 0.0 && aGeckoEvent.mPressure <= 1.0);
+ }
+
+ LOGW("InitPenEvent(): pressure %f\n", aGeckoEvent.mPressure);
+}
+
void nsWindow::SetModal(bool aModal) {
LOG("nsWindow::SetModal %d\n", aModal);
if (mIsDestroyed) {
@@ -4530,6 +4577,7 @@ void nsWindow::OnMotionNotifyEvent(GdkEventMotion* aEvent) {
event.AssignEventTime(GetWidgetEventTime(aEvent->time));
KeymapWrapper::InitInputEvent(event, aEvent->state);
+ InitPenEvent(event, (GdkEvent*)aEvent);
DispatchInputEvent(&event);
}
@@ -4806,6 +4854,7 @@ void nsWindow::OnButtonPressEvent(GdkEventButton* aEvent) {
InitButtonEvent(event, aEvent, refPoint);
event.mPressure = mLastMotionPressure;
+ InitPenEvent(event, (GdkEvent*)aEvent);
nsIWidget::ContentAndAPZEventStatus eventStatus = DispatchInputEvent(&event);
const bool defaultPrevented =
@@ -4875,6 +4924,8 @@ void nsWindow::OnButtonReleaseEvent(GdkEventButton* aEvent) {
// to use it for the doubleclick position check.
const LayoutDeviceIntPoint pos = event.mRefPoint;
+ InitPenEvent(event, (GdkEvent*)aEvent);
+
nsIWidget::ContentAndAPZEventStatus eventStatus = DispatchInputEvent(&event);
const bool defaultPrevented =
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/e9810c4…
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/e9810c4…
You're receiving this email because of your account on gitlab.torproject.org.
Pier Angelo Vendrame pushed to branch tor-browser-128.3.0esr-14.0-1 at The Tor Project / Applications / Tor Browser
Commits:
53e645fe by stransky at 2024-10-15T21:56:36+02:00
Bug 1501744 [Linux] Fill PointerEvents on the Gtk backend r=emilio
Patch author is tpxp <tpxp(a)live.fr>
Differential Revision: https://phabricator.services.mozilla.com/D215201
- - - - -
1 changed file:
- widget/gtk/nsWindow.cpp
Changes:
=====================================
widget/gtk/nsWindow.cpp
=====================================
@@ -784,6 +784,53 @@ void nsWindow::ReparentNativeWidget(nsIWidget* aNewParent) {
GtkWindowSetTransientFor(GTK_WINDOW(mShell), newParentWidget);
}
+static void InitPenEvent(WidgetMouseEvent& aGeckoEvent, GdkEvent* aEvent) {
+ // Find the source of the event
+ GdkDevice* device = gdk_event_get_source_device(aEvent);
+ GdkInputSource eSource = gdk_device_get_source(device);
+ gdouble value;
+
+ // We distinguish touch screens from pens using the event type
+ // Eraser corresponds to the pen with the "erase" button pressed
+ if (eSource != GDK_SOURCE_PEN && eSource != GDK_SOURCE_ERASER) {
+ bool XWaylandPen = false;
+#ifdef MOZ_X11
+ // Workaround : When using Xwayland, pens are reported as
+ // GDK_SOURCE_TOUCHSCREEN If eSource is GDK_SOURCE_TOUCHSCREEN and the
+ // GDK_AXIS_XTILT and GDK_AXIS_YTILT axes are reported then it's a pen and
+ // not a finger on a screen. Yes, that's a stupid heuristic but it works...
+ // Note, however, that the tilt values are not reliable
+ // Another approach could be use the device tool type, but that's only
+ // available in GTK > 3.22
+ XWaylandPen = (eSource == GDK_SOURCE_TOUCHSCREEN && GdkIsX11Display() &&
+ gdk_event_get_axis(aEvent, GDK_AXIS_XTILT, &value) &&
+ gdk_event_get_axis(aEvent, GDK_AXIS_YTILT, &value));
+#endif
+ if (!XWaylandPen) {
+ return;
+ }
+ LOGW("InitPenEvent(): Is XWayland pen");
+ }
+
+ aGeckoEvent.mInputSource = dom::MouseEvent_Binding::MOZ_SOURCE_PEN;
+ aGeckoEvent.pointerId = 1;
+
+ // The range of xtilt and ytilt are -1 to 1. Normalize it to -90 to 90.
+ if (gdk_event_get_axis(aEvent, GDK_AXIS_XTILT, &value)) {
+ aGeckoEvent.tiltX = int32_t(NS_round(value * 90));
+ }
+ if (gdk_event_get_axis(aEvent, GDK_AXIS_YTILT, &value)) {
+ aGeckoEvent.tiltY = int32_t(NS_round(value * 90));
+ }
+ if (gdk_event_get_axis(aEvent, GDK_AXIS_PRESSURE, &value)) {
+ aGeckoEvent.mPressure = (float)value;
+ // Make sure the pression is acceptable
+ MOZ_ASSERT(aGeckoEvent.mPressure >= 0.0 && aGeckoEvent.mPressure <= 1.0);
+ }
+
+ LOGW("InitPenEvent(): pressure %f\n", aGeckoEvent.mPressure);
+}
+
void nsWindow::SetModal(bool aModal) {
LOG("nsWindow::SetModal %d\n", aModal);
if (mIsDestroyed) {
@@ -4530,6 +4577,7 @@ void nsWindow::OnMotionNotifyEvent(GdkEventMotion* aEvent) {
event.AssignEventTime(GetWidgetEventTime(aEvent->time));
KeymapWrapper::InitInputEvent(event, aEvent->state);
+ InitPenEvent(event, (GdkEvent*)aEvent);
DispatchInputEvent(&event);
}
@@ -4806,6 +4854,7 @@ void nsWindow::OnButtonPressEvent(GdkEventButton* aEvent) {
InitButtonEvent(event, aEvent, refPoint);
event.mPressure = mLastMotionPressure;
+ InitPenEvent(event, (GdkEvent*)aEvent);
nsIWidget::ContentAndAPZEventStatus eventStatus = DispatchInputEvent(&event);
const bool defaultPrevented =
@@ -4875,6 +4924,8 @@ void nsWindow::OnButtonReleaseEvent(GdkEventButton* aEvent) {
// to use it for the doubleclick position check.
const LayoutDeviceIntPoint pos = event.mRefPoint;
+ InitPenEvent(event, (GdkEvent*)aEvent);
+
nsIWidget::ContentAndAPZEventStatus eventStatus = DispatchInputEvent(&event);
const bool defaultPrevented =
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/53e645f…
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/53e645f…
You're receiving this email because of your account on gitlab.torproject.org.
Pier Angelo Vendrame pushed to branch main at The Tor Project / Applications / tor-browser-build
Commits:
b152b726 by Morgan at 2024-10-10T23:26:31+00:00
Bug 41267: Downgrade go to 1.22 series due to upstream dropping support for macOS 10.15 in 1.23
- - - - -
1 changed file:
- projects/go/config
Changes:
=====================================
projects/go/config
=====================================
@@ -1,5 +1,5 @@
# vim: filetype=yaml sw=2
-version: '1.23.2'
+version: '1.22.8'
filename: '[% project %]-[% c("version") %]-[% c("var/osname") %]-[% c("var/build_id") %].tar.[% c("compress_tar") %]'
container:
use_container: 1
@@ -126,7 +126,7 @@ input_files:
enable: '[% ! c("var/linux") %]'
- URL: 'https://go.dev/dl/go[% c("version") %].src.tar.gz'
name: go
- sha256sum: 36930162a93df417d90bd22c6e14daff4705baac2b02418edda671cdfa9cd07f
+ sha256sum: df12c23ebf19dea0f4bf46a22cbeda4a3eca6f474f318390ce774974278440b8
- project: go-bootstrap
name: go-bootstrap
target_replace:
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/commit/b…
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/commit/b…
You're receiving this email because of your account on gitlab.torproject.org.
Pier Angelo Vendrame pushed to branch tor-browser-128.3.0esr-14.0-1 at The Tor Project / Applications / Tor Browser
Commits:
c06f972b by cypherpunks1 at 2024-10-14T14:16:47+00:00
fixup! [android] Disable features and functionality
Bug 43202: Do not fetch featured addons on Android
- - - - -
2 changed files:
- mobile/android/android-components/components/feature/addons/src/main/java/mozilla/components/feature/addons/AddonManager.kt
- mobile/android/android-components/components/feature/addons/src/main/java/mozilla/components/feature/addons/ui/AddonsManagerAdapter.kt
Changes:
=====================================
mobile/android/android-components/components/feature/addons/src/main/java/mozilla/components/feature/addons/AddonManager.kt
=====================================
@@ -78,7 +78,7 @@ class AddonManager(
* the [addonsProvider] or querying web extension state from the engine / store.
*/
@Throws(AddonManagerException::class)
- @Suppress("TooGenericExceptionCaught")
+ @Suppress("TooGenericExceptionCaught", "UNUSED_PARAMETER")
suspend fun getAddons(waitForPendingActions: Boolean = true, allowCache: Boolean = true): List<Addon> {
try {
// Make sure extension support is initialized, i.e. the state of all installed extensions is known.
@@ -92,6 +92,7 @@ class AddonManager(
// Get all the featured add-ons not installed from provider.
// NB: We're keeping translations only for the default locale.
var featuredAddons = emptyList<Addon>()
+ /* tor-browser#40502: Do not recommend addons on Tor Browser
try {
val userLanguage = Locale.getDefault().language
val locales = listOf(userLanguage)
@@ -103,6 +104,7 @@ class AddonManager(
// Do not throw when we fail to fetch the featured add-ons since there can be installed add-ons.
logger.warn("Failed to get the featured add-ons", throwable)
}
+ */
// Build a list of installed extensions that are not built-in extensions.
val installedAddons = installedExtensions
=====================================
mobile/android/android-components/components/feature/addons/src/main/java/mozilla/components/feature/addons/ui/AddonsManagerAdapter.kt
=====================================
@@ -410,7 +410,7 @@ class AddonsManagerAdapter(
}
// Add recommended section and addons if available
- if (false) { // recommendedAddons.isNotEmpty() tor-browser#40502: Do not recommend addons on Tor Browser
+ if (recommendedAddons.isNotEmpty()) {
itemsWithSections.add(Section(R.string.mozac_feature_addons_recommended_section, true))
val filteredRecommendedAddons = recommendedAddons.filter {
it.id !in excludedAddonIDs
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/c06f972…
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/c06f972…
You're receiving this email because of your account on gitlab.torproject.org.
Pier Angelo Vendrame pushed to branch mullvad-browser-128.3.0esr-14.0-1 at The Tor Project / Applications / Mullvad Browser
Commits:
a21f2f46 by rahulsainani at 2024-10-14T16:09:10+02:00
Bug 1906024 - Format download file names better a=diannaS
Original Revision: https://phabricator.services.mozilla.com/D220559
Differential Revision: https://phabricator.services.mozilla.com/D222254
- - - - -
f5ad7ff5 by rahulsainani at 2024-10-14T16:09:12+02:00
Bug 1906024 - Format download file names a=diannaS
Original Revision: https://phabricator.services.mozilla.com/D221771
Differential Revision: https://phabricator.services.mozilla.com/D222259
- - - - -
24a0b664 by Pier Angelo Vendrame at 2024-10-14T16:09:12+02:00
Bug 43196: Remove the vendor name from media notifications on Linux.
Firefox shows "vendor remoteName" as a title of the "... is playing
media" notification on Linux.
However, for our browser the remote name is enough, and prepending the
vendor to it creates a string users usually never see.
- - - - -
3 changed files:
- mobile/android/android-components/components/support/ktx/src/main/java/mozilla/components/support/ktx/kotlin/String.kt
- mobile/android/android-components/components/support/ktx/src/test/java/mozilla/components/support/ktx/kotlin/StringTest.kt
- widget/gtk/MPRISServiceHandler.cpp
Changes:
=====================================
mobile/android/android-components/components/support/ktx/src/main/java/mozilla/components/support/ktx/kotlin/String.kt
=====================================
@@ -53,6 +53,8 @@ const val MAX_URI_LENGTH = 25000
private const val FILE_PREFIX = "file://"
private const val MAX_VALID_PORT = 65_535
+private const val SPACE = " "
+private const val UNDERSCORE = "_"
/**
* Shortens URLs to be more user friendly.
@@ -307,7 +309,9 @@ fun String.sanitizeFileName(): String {
file.name.replace("\\.\\.+".toRegex(), ".")
} else {
file.name.replace(".", "")
- }.replaceEscapedCharacters()
+ }.replaceContinuousSpaces()
+ .replaceEscapedCharacters()
+ .trim()
}
/**
@@ -315,8 +319,16 @@ fun String.sanitizeFileName(): String {
* and is correctly displayed.
*/
private fun String.replaceEscapedCharacters(): String {
- val controlCharactersRegex = "[\\x00-\\x13/*\"?<>:|\\\\]".toRegex()
- return replace(controlCharactersRegex, "_")
+ val escapedCharactersRegex = "[\\x00-\\x13*\"?<>:|\\\\]".toRegex()
+ return replace(escapedCharactersRegex, UNDERSCORE)
+}
+
+/**
+ * Replaces continuous spaces with a single space.
+ */
+private fun String.replaceContinuousSpaces(): String {
+ val escapedCharactersRegex = "[\\p{Z}\\s]+".toRegex()
+ return replace(escapedCharactersRegex, SPACE)
}
/**
=====================================
mobile/android/android-components/components/support/ktx/src/test/java/mozilla/components/support/ktx/kotlin/StringTest.kt
=====================================
@@ -199,11 +199,11 @@ class StringTest {
"acknowledge\u0006signal" to "acknowledge_signal",
"bell\u0007sound" to "bell_sound",
"back\u0008space" to "back_space",
- "horizontal\u0009tab" to "horizontal_tab",
- "new\u000Aline" to "new_line",
- "vertical\u000Btab" to "vertical_tab",
- "form\u000Cfeed" to "form_feed",
- "return\u000Dcarriage" to "return_carriage",
+ "horizontal\u0009tab" to "horizontal tab",
+ "new\u000Aline" to "new line",
+ "vertical\u000Btab" to "vertical tab",
+ "form\u000Cfeed" to "form feed",
+ "return\u000Dcarriage" to "return carriage",
"shift\u000Eout" to "shift_out",
"shift\u000Fin" to "shift_in",
"escape\u0010data" to "escape_data",
=====================================
widget/gtk/MPRISServiceHandler.cpp
=====================================
@@ -414,8 +414,10 @@ void MPRISServiceHandler::InitIdentity() {
do_GetService("@mozilla.org/xre/app-info;1", &rv);
MOZ_ASSERT(NS_SUCCEEDED(rv));
+#ifndef BASE_BROWSER_VERSION
rv = appInfo->GetVendor(mIdentity);
MOZ_ASSERT(NS_SUCCEEDED(rv));
+#endif
if (gAppData) {
mDesktopEntry = gAppData->remotingName;
@@ -424,7 +426,9 @@ void MPRISServiceHandler::InitIdentity() {
MOZ_ASSERT(NS_SUCCEEDED(rv));
}
+#ifndef BASE_BROWSER_VERSION
mIdentity.Append(' ');
+#endif
mIdentity.Append(mDesktopEntry);
// Compute the desktop entry name like nsAppRunner does for g_set_prgname
View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/compare/2a…
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/compare/2a…
You're receiving this email because of your account on gitlab.torproject.org.