2022-03-06 12:10:08 +00:00
|
|
|
diff --git a/gfx/angle/moz.build.common b/gfx/angle/moz.build.common
|
|
|
|
index 8769a2fe96..6976853b35 100644
|
|
|
|
--- a/gfx/angle/moz.build.common
|
|
|
|
+++ b/gfx/angle/moz.build.common
|
|
|
|
@@ -12,6 +12,9 @@ CXXFLAGS += CONFIG['MOZ_X11_CFLAGS']
|
|
|
|
if CONFIG['INTEL_ARCHITECTURE']:
|
|
|
|
CXXFLAGS += CONFIG['SSE2_FLAGS']
|
|
|
|
|
|
|
|
+if not CONFIG['MOZ_X11']:
|
|
|
|
+ DEFINES['EGL_NO_X11'] = True
|
|
|
|
+
|
|
|
|
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
|
|
|
|
DEFINES['ANGLE_IS_WIN'] = True
|
2021-10-05 08:30:33 +00:00
|
|
|
|
|
|
|
diff --git a/gfx/cairo/cairo/src/cairo-features.h b/gfx/cairo/cairo/src/cairo-features.h
|
2022-03-06 12:10:08 +00:00
|
|
|
index cfed9d9a2f..ad9abeaab1 100644
|
2021-10-05 08:30:33 +00:00
|
|
|
--- a/gfx/cairo/cairo/src/cairo-features.h
|
|
|
|
+++ b/gfx/cairo/cairo/src/cairo-features.h
|
2022-03-06 12:10:08 +00:00
|
|
|
@@ -56,7 +56,6 @@
|
2021-10-05 08:30:33 +00:00
|
|
|
#endif
|
|
|
|
|
2022-03-06 12:10:08 +00:00
|
|
|
#ifdef MOZ_X11
|
|
|
|
-#define CAIRO_HAS_PS_SURFACE 1
|
2021-11-04 06:49:47 +00:00
|
|
|
#define CAIRO_HAS_XLIB_XRENDER_SURFACE 0
|
2021-10-05 08:30:33 +00:00
|
|
|
#define CAIRO_HAS_XLIB_SURFACE 1
|
|
|
|
#endif
|
2022-03-06 12:10:08 +00:00
|
|
|
@@ -78,6 +77,7 @@
|
2021-07-08 15:32:23 +00:00
|
|
|
#endif
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2022-03-06 12:10:08 +00:00
|
|
|
#define CAIRO_HAS_TEE_SURFACE 1
|
|
|
|
+#define CAIRO_HAS_PS_SURFACE 1
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2022-03-06 12:10:08 +00:00
|
|
|
#ifdef USE_FC_FREETYPE
|
|
|
|
#define CAIRO_HAS_FC_FONT 1
|
2021-07-08 15:32:23 +00:00
|
|
|
diff --git a/gfx/gl/moz.build b/gfx/gl/moz.build
|
2022-03-06 12:10:08 +00:00
|
|
|
index 03434957cc..c4727d79a1 100644
|
2021-07-08 15:32:23 +00:00
|
|
|
--- a/gfx/gl/moz.build
|
|
|
|
+++ b/gfx/gl/moz.build
|
2022-03-06 12:10:08 +00:00
|
|
|
@@ -13,10 +13,10 @@ elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "cocoa":
|
2021-07-08 15:32:23 +00:00
|
|
|
elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "uikit":
|
|
|
|
gl_provider = "EAGL"
|
|
|
|
elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
|
|
|
|
- if CONFIG["MOZ_EGL_XRENDER_COMPOSITE"]:
|
2022-03-06 12:10:08 +00:00
|
|
|
- gl_provider = "EGL"
|
|
|
|
- else:
|
|
|
|
+ if CONFIG["MOZ_X11"]:
|
2021-07-08 15:32:23 +00:00
|
|
|
gl_provider = "GLX"
|
2022-03-06 12:10:08 +00:00
|
|
|
+ else:
|
|
|
|
+ gl_provider = "EGL"
|
|
|
|
elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "android":
|
|
|
|
gl_provider = "EGL"
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2022-03-06 12:10:08 +00:00
|
|
|
@@ -117,7 +117,10 @@ elif gl_provider == "GLX":
|
|
|
|
EXPORTS += ["GLContextGLX.h", "GLXLibrary.h"]
|
|
|
|
|
|
|
|
if CONFIG["MOZ_WAYLAND"]:
|
|
|
|
- SOURCES += ["GLContextProviderWayland.cpp", "SharedSurfaceDMABUF.cpp"]
|
|
|
|
+ SOURCES += ["SharedSurfaceDMABUF.cpp"]
|
|
|
|
+
|
|
|
|
+if CONFIG["MOZ_X11"] and CONFIG["MOZ_WAYLAND"]:
|
|
|
|
+ SOURCES += ["GLContextProviderWayland.cpp"]
|
|
|
|
|
|
|
|
UNIFIED_SOURCES += [
|
|
|
|
"AndroidSurfaceTexture.cpp",
|
|
|
|
diff --git a/gfx/layers/client/TextureClient.cpp b/gfx/layers/client/TextureClient.cpp
|
|
|
|
index aaec3c3510..65bee9f869 100644
|
|
|
|
--- a/gfx/layers/client/TextureClient.cpp
|
|
|
|
+++ b/gfx/layers/client/TextureClient.cpp
|
|
|
|
@@ -48,8 +48,6 @@
|
|
|
|
# include "mozilla/layers/TextureD3D11.h"
|
|
|
|
#endif
|
|
|
|
#ifdef MOZ_WAYLAND
|
|
|
|
-# include <gtk/gtkx.h>
|
|
|
|
-
|
|
|
|
# include "gfxPlatformGtk.h"
|
|
|
|
# include "mozilla/layers/DMABUFTextureClientOGL.h"
|
|
|
|
# include "mozilla/widget/nsWaylandDisplay.h"
|
2021-07-08 15:32:23 +00:00
|
|
|
diff --git a/gfx/thebes/gfxPlatformGtk.cpp b/gfx/thebes/gfxPlatformGtk.cpp
|
2022-03-06 12:10:08 +00:00
|
|
|
index 1b46a2aab8..4a487e0b78 100644
|
2021-07-08 15:32:23 +00:00
|
|
|
--- a/gfx/thebes/gfxPlatformGtk.cpp
|
|
|
|
+++ b/gfx/thebes/gfxPlatformGtk.cpp
|
2022-03-06 12:10:08 +00:00
|
|
|
@@ -31,11 +31,11 @@
|
2021-10-05 08:30:33 +00:00
|
|
|
#include "mozilla/FontPropertyTypes.h"
|
|
|
|
#include "mozilla/gfx/2D.h"
|
|
|
|
#include "mozilla/gfx/Logging.h"
|
2022-03-06 12:10:08 +00:00
|
|
|
-#include "mozilla/gfx/XlibDisplay.h"
|
2021-10-05 08:30:33 +00:00
|
|
|
#include "mozilla/Monitor.h"
|
|
|
|
#include "mozilla/Preferences.h"
|
|
|
|
#include "mozilla/StaticPrefs_gfx.h"
|
2022-03-06 12:10:08 +00:00
|
|
|
#include "mozilla/StaticPrefs_layers.h"
|
|
|
|
+#include "mozilla/WidgetUtilsGtk.h"
|
|
|
|
#include "nsAppRunner.h"
|
|
|
|
#include "nsIGfxInfo.h"
|
|
|
|
#include "nsMathUtils.h"
|
|
|
|
@@ -52,6 +52,7 @@
|
|
|
|
# include "GLXLibrary.h"
|
|
|
|
# include "mozilla/X11Util.h"
|
|
|
|
# include "SoftwareVsyncSource.h"
|
|
|
|
+# include "mozilla/gfx/XlibDisplay.h"
|
|
|
|
|
|
|
|
/* Undefine the Status from Xlib since it will conflict with system headers on
|
|
|
|
* OSX */
|
2021-07-08 15:32:23 +00:00
|
|
|
diff --git a/gfx/webrender_bindings/RenderCompositorOGLSWGL.cpp b/gfx/webrender_bindings/RenderCompositorOGLSWGL.cpp
|
2022-03-06 12:10:08 +00:00
|
|
|
index 00a6c3ef6d..78c4235268 100644
|
2021-07-08 15:32:23 +00:00
|
|
|
--- a/gfx/webrender_bindings/RenderCompositorOGLSWGL.cpp
|
|
|
|
+++ b/gfx/webrender_bindings/RenderCompositorOGLSWGL.cpp
|
2022-03-06 12:10:08 +00:00
|
|
|
@@ -27,7 +27,6 @@
|
2021-07-08 15:32:23 +00:00
|
|
|
#ifdef MOZ_WIDGET_GTK
|
|
|
|
# include "mozilla/widget/GtkCompositorWidget.h"
|
|
|
|
# include <gdk/gdk.h>
|
2022-03-06 12:10:08 +00:00
|
|
|
-# include <gdk/gdkx.h>
|
2021-07-08 15:32:23 +00:00
|
|
|
#endif
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
namespace mozilla {
|
2022-03-06 12:10:08 +00:00
|
|
|
diff --git a/python/mozboot/mozboot/gentoo.py b/python/mozboot/mozboot/gentoo.py
|
|
|
|
index a33677a0a1..cb9e3dd338 100644
|
|
|
|
--- a/python/mozboot/mozboot/gentoo.py
|
|
|
|
+++ b/python/mozboot/mozboot/gentoo.py
|
|
|
|
@@ -33,7 +33,6 @@ class GentooBootstrapper(LinuxBootstrapper, BaseBootstrapper):
|
|
|
|
"dev-libs/dbus-glib",
|
|
|
|
"media-sound/pulseaudio",
|
|
|
|
"x11-libs/gtk+:3",
|
|
|
|
- "x11-libs/libXt",
|
|
|
|
]
|
|
|
|
)
|
|
|
|
|
|
|
|
diff --git a/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build b/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build
|
|
|
|
index a5cf9234d1..ddce223c19 100644
|
|
|
|
--- a/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build
|
|
|
|
+++ b/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build
|
|
|
|
@@ -93,11 +93,9 @@ if CONFIG["OS_TARGET"] == "Linux":
|
|
|
|
DEFINES["USE_NSS_CERTS"] = "1"
|
|
|
|
DEFINES["USE_OZONE"] = "1"
|
|
|
|
DEFINES["USE_UDEV"] = True
|
|
|
|
- DEFINES["USE_X11"] = "1"
|
|
|
|
DEFINES["WEBRTC_LINUX"] = True
|
|
|
|
DEFINES["WEBRTC_POSIX"] = True
|
|
|
|
DEFINES["WEBRTC_USE_PIPEWIRE"] = True
|
|
|
|
- DEFINES["WEBRTC_USE_X11"] = True
|
|
|
|
DEFINES["_FILE_OFFSET_BITS"] = "64"
|
|
|
|
DEFINES["_GNU_SOURCE"] = True
|
|
|
|
DEFINES["_LARGEFILE64_SOURCE"] = True
|
|
|
|
@@ -115,14 +113,6 @@ if CONFIG["OS_TARGET"] == "Linux":
|
|
|
|
OS_LIBS += [
|
|
|
|
"dl",
|
|
|
|
"rt",
|
|
|
|
- "X11",
|
|
|
|
- "Xcomposite",
|
|
|
|
- "Xdamage",
|
|
|
|
- "Xext",
|
|
|
|
- "Xfixes",
|
|
|
|
- "Xrandr",
|
|
|
|
- "Xrender",
|
|
|
|
- "Xtst"
|
2021-07-08 15:32:23 +00:00
|
|
|
]
|
2022-03-06 12:10:08 +00:00
|
|
|
|
|
|
|
SOURCES += [
|
|
|
|
@@ -130,22 +120,26 @@ if CONFIG["OS_TARGET"] == "Linux":
|
|
|
|
]
|
|
|
|
|
|
|
|
UNIFIED_SOURCES += [
|
|
|
|
- "/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_x11.cc",
|
|
|
|
"/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc",
|
|
|
|
- "/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_x11.cc",
|
|
|
|
- "/third_party/libwebrtc/modules/desktop_capture/linux/shared_x_display.cc",
|
|
|
|
"/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc",
|
|
|
|
- "/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_x11.cc",
|
|
|
|
- "/third_party/libwebrtc/modules/desktop_capture/linux/window_finder_x11.cc",
|
|
|
|
- "/third_party/libwebrtc/modules/desktop_capture/linux/window_list_utils.cc",
|
|
|
|
- "/third_party/libwebrtc/modules/desktop_capture/linux/x_atom_cache.cc",
|
|
|
|
- "/third_party/libwebrtc/modules/desktop_capture/linux/x_error_trap.cc",
|
|
|
|
- "/third_party/libwebrtc/modules/desktop_capture/linux/x_server_pixel_buffer.cc",
|
|
|
|
- "/third_party/libwebrtc/modules/desktop_capture/linux/x_window_property.cc",
|
|
|
|
"/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc",
|
|
|
|
"/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc",
|
|
|
|
"/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc"
|
|
|
|
]
|
|
|
|
+
|
2021-07-08 15:32:23 +00:00
|
|
|
+ if CONFIG["MOZ_X11"]:
|
2022-03-06 12:10:08 +00:00
|
|
|
+ UNIFIED_SOURCES += [
|
|
|
|
+ "/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_x11.cc",
|
|
|
|
+ "/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_x11.cc",
|
|
|
|
+ "/third_party/libwebrtc/modules/desktop_capture/linux/shared_x_display.cc",
|
|
|
|
+ "/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_x11.cc",
|
|
|
|
+ "/third_party/libwebrtc/modules/desktop_capture/linux/window_finder_x11.cc",
|
|
|
|
+ "/third_party/libwebrtc/modules/desktop_capture/linux/window_list_utils.cc",
|
|
|
|
+ "/third_party/libwebrtc/modules/desktop_capture/linux/x_atom_cache.cc",
|
|
|
|
+ "/third_party/libwebrtc/modules/desktop_capture/linux/x_error_trap.cc",
|
|
|
|
+ "/third_party/libwebrtc/modules/desktop_capture/linux/x_server_pixel_buffer.cc",
|
|
|
|
+ "/third_party/libwebrtc/modules/desktop_capture/linux/x_window_property.cc"
|
2021-07-08 15:32:23 +00:00
|
|
|
+ ]
|
2022-03-06 12:10:08 +00:00
|
|
|
|
|
|
|
if CONFIG["OS_TARGET"] == "OpenBSD":
|
|
|
|
|
|
|
|
diff --git a/third_party/libwebrtc/modules/desktop_capture/desktop_capture_gn/moz.build b/third_party/libwebrtc/modules/desktop_capture/desktop_capture_gn/moz.build
|
|
|
|
index 4cf85ddfa7..e5873468ca 100644
|
|
|
|
--- a/third_party/libwebrtc/modules/desktop_capture/desktop_capture_gn/moz.build
|
|
|
|
+++ b/third_party/libwebrtc/modules/desktop_capture/desktop_capture_gn/moz.build
|
|
|
|
@@ -53,10 +53,8 @@ if CONFIG["OS_TARGET"] == "Linux":
|
|
|
|
DEFINES["USE_NSS_CERTS"] = "1"
|
|
|
|
DEFINES["USE_OZONE"] = "1"
|
|
|
|
DEFINES["USE_UDEV"] = True
|
|
|
|
- DEFINES["USE_X11"] = "1"
|
|
|
|
DEFINES["WEBRTC_LINUX"] = True
|
|
|
|
DEFINES["WEBRTC_POSIX"] = True
|
|
|
|
- DEFINES["WEBRTC_USE_X11"] = True
|
|
|
|
DEFINES["_FILE_OFFSET_BITS"] = "64"
|
|
|
|
DEFINES["_GNU_SOURCE"] = True
|
|
|
|
DEFINES["_LARGEFILE64_SOURCE"] = True
|
|
|
|
@@ -67,14 +65,6 @@ if CONFIG["OS_TARGET"] == "Linux":
|
|
|
|
OS_LIBS += [
|
|
|
|
"dl",
|
|
|
|
"rt",
|
|
|
|
- "X11",
|
|
|
|
- "Xcomposite",
|
|
|
|
- "Xdamage",
|
|
|
|
- "Xext",
|
|
|
|
- "Xfixes",
|
|
|
|
- "Xrandr",
|
|
|
|
- "Xrender",
|
|
|
|
- "Xtst"
|
|
|
|
]
|
|
|
|
|
|
|
|
if CONFIG["OS_TARGET"] == "OpenBSD":
|
|
|
|
diff --git a/third_party/libwebrtc/webrtc_gn/moz.build b/third_party/libwebrtc/webrtc_gn/moz.build
|
|
|
|
index 625bd0b5dd..2b0e2276c6 100644
|
|
|
|
--- a/third_party/libwebrtc/webrtc_gn/moz.build
|
|
|
|
+++ b/third_party/libwebrtc/webrtc_gn/moz.build
|
|
|
|
@@ -71,7 +71,6 @@ if CONFIG["OS_TARGET"] == "Linux":
|
|
|
|
DEFINES["USE_NSS_CERTS"] = "1"
|
|
|
|
DEFINES["USE_OZONE"] = "1"
|
|
|
|
DEFINES["USE_UDEV"] = True
|
|
|
|
- DEFINES["USE_X11"] = "1"
|
|
|
|
DEFINES["WEBRTC_LINUX"] = True
|
|
|
|
DEFINES["WEBRTC_POSIX"] = True
|
|
|
|
DEFINES["_FILE_OFFSET_BITS"] = "64"
|
|
|
|
@@ -85,14 +84,6 @@ if CONFIG["OS_TARGET"] == "Linux":
|
|
|
|
"dl",
|
|
|
|
"m",
|
|
|
|
"rt",
|
|
|
|
- "X11",
|
|
|
|
- "Xcomposite",
|
|
|
|
- "Xdamage",
|
|
|
|
- "Xext",
|
|
|
|
- "Xfixes",
|
|
|
|
- "Xrandr",
|
|
|
|
- "Xrender",
|
|
|
|
- "Xtst"
|
|
|
|
]
|
|
|
|
|
|
|
|
if CONFIG["OS_TARGET"] == "OpenBSD":
|
|
|
|
diff --git a/toolkit/components/remote/moz.build b/toolkit/components/remote/moz.build
|
|
|
|
index d3bab6cf9a..656b32c7fa 100644
|
|
|
|
--- a/toolkit/components/remote/moz.build
|
|
|
|
+++ b/toolkit/components/remote/moz.build
|
|
|
|
@@ -26,7 +26,7 @@ if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
|
2021-11-04 06:49:47 +00:00
|
|
|
"nsUnixRemoteServer.h",
|
|
|
|
"RemoteUtils.h",
|
|
|
|
]
|
|
|
|
- else:
|
2022-03-06 12:10:08 +00:00
|
|
|
+ elif CONFIG["MOZ_X11"]:
|
|
|
|
SOURCES += [
|
|
|
|
"nsGTKRemoteServer.cpp",
|
|
|
|
"nsXRemoteClient.cpp",
|
2021-07-08 15:32:23 +00:00
|
|
|
diff --git a/toolkit/components/remote/nsRemoteService.cpp b/toolkit/components/remote/nsRemoteService.cpp
|
2022-03-06 12:10:08 +00:00
|
|
|
index b2499d8191..1d1dc42e9f 100644
|
2021-07-08 15:32:23 +00:00
|
|
|
--- a/toolkit/components/remote/nsRemoteService.cpp
|
|
|
|
+++ b/toolkit/components/remote/nsRemoteService.cpp
|
2022-03-06 12:10:08 +00:00
|
|
|
@@ -12,12 +12,14 @@
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
#ifdef MOZ_WIDGET_GTK
|
|
|
|
# include "mozilla/WidgetUtilsGtk.h"
|
|
|
|
-# include "nsGTKRemoteServer.h"
|
2022-03-06 12:10:08 +00:00
|
|
|
-# ifdef MOZ_ENABLE_DBUS
|
|
|
|
+# if defined(MOZ_ENABLE_DBUS)
|
2021-07-08 15:32:23 +00:00
|
|
|
# include "nsDBusRemoteServer.h"
|
|
|
|
# include "nsDBusRemoteClient.h"
|
2021-11-04 06:49:47 +00:00
|
|
|
-# else
|
2022-03-06 12:10:08 +00:00
|
|
|
+# elif defined(MOZ_X11)
|
|
|
|
# include "nsXRemoteClient.h"
|
|
|
|
+# include "nsGTKRemoteServer.h"
|
|
|
|
+# else
|
2021-07-13 20:43:56 +00:00
|
|
|
+# include "nsRemoteClient.h"
|
2021-11-04 06:49:47 +00:00
|
|
|
# endif
|
2021-07-08 15:32:23 +00:00
|
|
|
#elif defined(XP_WIN)
|
|
|
|
# include "nsWinRemoteServer.h"
|
2022-03-06 12:10:08 +00:00
|
|
|
@@ -102,8 +104,10 @@ RemoteResult nsRemoteService::StartClient(const char* aDesktopStartupID) {
|
2021-11-04 06:49:47 +00:00
|
|
|
#ifdef MOZ_WIDGET_GTK
|
|
|
|
# if defined(MOZ_ENABLE_DBUS)
|
|
|
|
client = MakeUnique<nsDBusRemoteClient>();
|
|
|
|
-# else
|
|
|
|
+# elif defined(MOZ_X11)
|
|
|
|
client = MakeUnique<nsXRemoteClient>();
|
2022-03-06 12:10:08 +00:00
|
|
|
+# else
|
|
|
|
+ return REMOTE_NOT_FOUND;
|
2021-07-08 15:32:23 +00:00
|
|
|
# endif
|
|
|
|
#elif defined(XP_WIN)
|
2022-03-06 12:10:08 +00:00
|
|
|
client = MakeUnique<nsWinRemoteClient>();
|
|
|
|
@@ -146,8 +150,10 @@ void nsRemoteService::StartupServer() {
|
2021-11-04 06:49:47 +00:00
|
|
|
#ifdef MOZ_WIDGET_GTK
|
|
|
|
# if defined(MOZ_ENABLE_DBUS)
|
|
|
|
mRemoteServer = MakeUnique<nsDBusRemoteServer>();
|
|
|
|
-# else
|
|
|
|
+# elif defined(MOZ_X11)
|
|
|
|
mRemoteServer = MakeUnique<nsGTKRemoteServer>();
|
2022-03-06 12:10:08 +00:00
|
|
|
+# else
|
|
|
|
+ return;
|
2021-07-08 15:32:23 +00:00
|
|
|
# endif
|
|
|
|
#elif defined(XP_WIN)
|
2022-03-06 12:10:08 +00:00
|
|
|
mRemoteServer = MakeUnique<nsWinRemoteServer>();
|
2021-07-08 15:32:23 +00:00
|
|
|
diff --git a/toolkit/moz.configure b/toolkit/moz.configure
|
2022-03-06 12:10:08 +00:00
|
|
|
index 539433a6ef..8599a3b838 100644
|
2021-07-08 15:32:23 +00:00
|
|
|
--- a/toolkit/moz.configure
|
|
|
|
+++ b/toolkit/moz.configure
|
2022-03-06 12:10:08 +00:00
|
|
|
@@ -286,7 +286,7 @@ def toolkit_choices(target):
|
|
|
|
elif target.os == "Android":
|
|
|
|
return ("cairo-android",)
|
|
|
|
else:
|
|
|
|
- return ("cairo-gtk3", "cairo-gtk3-wayland")
|
|
|
|
+ return ("cairo-gtk3",)
|
|
|
|
|
|
|
|
|
|
|
|
@depends(toolkit_choices)
|
|
|
|
@@ -338,23 +338,24 @@ def toolkit_gtk(toolkit):
|
|
|
|
|
|
|
|
# Wayland support
|
|
|
|
# ==============================================================
|
|
|
|
-wayland_headers = pkg_check_modules(
|
|
|
|
- "MOZ_WAYLAND",
|
|
|
|
- "gtk+-wayland-3.0 >= 3.14 xkbcommon >= 0.4.1 libdrm >= 2.4",
|
|
|
|
- allow_missing=depends(full_toolkit)(lambda t: t == "cairo-gtk3"),
|
|
|
|
- when=depends(full_toolkit)(lambda t: t in ("cairo-gtk3", "cairo-gtk3-wayland")),
|
|
|
|
+option(
|
|
|
|
+ "--with-wayland",
|
|
|
|
+ help="{Enable wayland support|Disable wayland support}",
|
|
|
|
)
|
|
|
|
|
|
|
|
-
|
|
|
|
-@depends(wayland_headers, toolkit_gtk, artifact_builds)
|
|
|
|
-def wayland_headers(wayland, toolkit_gtk, artifacts):
|
|
|
|
- if toolkit_gtk and artifacts:
|
|
|
|
+@depends("--with-wayland", toolkit_gtk, artifact_builds)
|
|
|
|
+def with_wayland(value, toolkit_gtk, artifacts):
|
|
|
|
+ if value and toolkit_gtk or artifacts:
|
|
|
|
return True
|
|
|
|
- return wayland
|
|
|
|
|
|
|
|
+wayland_headers = pkg_check_modules(
|
|
|
|
+ "MOZ_WAYLAND",
|
|
|
|
+ "gtk+-wayland-3.0 >= 3.14 xkbcommon >= 0.4.1 libdrm >= 2.4",
|
|
|
|
+ when=with_wayland,
|
|
|
|
+)
|
|
|
|
|
|
|
|
-set_config("MOZ_WAYLAND", depends_if(wayland_headers)(lambda _: True))
|
|
|
|
-set_define("MOZ_WAYLAND", depends_if(wayland_headers)(lambda _: True))
|
|
|
|
+set_config("MOZ_WAYLAND", True, when=with_wayland)
|
|
|
|
+set_define("MOZ_WAYLAND", True, when=with_wayland)
|
|
|
|
|
|
|
|
# GL Provider
|
|
|
|
# ==============================================================
|
|
|
|
@@ -376,7 +377,7 @@ def gl_provider_define(provider):
|
|
|
|
set_define("MOZ_GL_PROVIDER", gl_provider_define)
|
|
|
|
|
|
|
|
|
|
|
|
-@depends(gl_provider, wayland_headers, toolkit_gtk)
|
|
|
|
+@depends(gl_provider, with_wayland, toolkit_gtk)
|
|
|
|
def gl_default_provider(value, wayland, toolkit_gtk):
|
|
|
|
if value:
|
|
|
|
return value
|
|
|
|
@@ -1197,11 +1198,20 @@ set_define("MOZ_RAW", depends_if("--enable-raw")(lambda _: True))
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-09-06 20:31:55 +00:00
|
|
|
# X11
|
|
|
|
# ==============================================================
|
2021-07-08 15:32:23 +00:00
|
|
|
-set_config("MOZ_X11", True, when=toolkit_gtk)
|
|
|
|
-set_define("MOZ_X11", True, when=toolkit_gtk)
|
2022-03-06 12:10:08 +00:00
|
|
|
+option(
|
|
|
|
+ "--with-x",
|
|
|
|
+ help="{Enable X11 support|Disable X11 support}",
|
|
|
|
+)
|
|
|
|
+
|
|
|
|
+@depends("--with-x", toolkit_gtk)
|
|
|
|
+def with_x(value, toolkit_gtk):
|
|
|
|
+ if value and toolkit_gtk:
|
|
|
|
+ return True
|
|
|
|
|
|
|
|
+set_config("MOZ_X11", True, when=with_x)
|
|
|
|
+set_define("MOZ_X11", True, when=with_x)
|
|
|
|
|
2021-10-05 08:30:33 +00:00
|
|
|
-@depends(webrtc, when=toolkit_gtk)
|
2022-03-06 12:10:08 +00:00
|
|
|
+@depends(webrtc, when=with_x)
|
|
|
|
def x11_libs(webrtc):
|
|
|
|
libs = [
|
|
|
|
"x11",
|
|
|
|
@@ -1225,8 +1235,8 @@ def x11_libs(webrtc):
|
|
|
|
return libs
|
|
|
|
|
|
|
|
|
2021-10-05 08:30:33 +00:00
|
|
|
-pkg_check_modules("MOZ_X11", x11_libs, when=toolkit_gtk)
|
2022-03-06 12:10:08 +00:00
|
|
|
-pkg_check_modules("MOZ_X11_SM", ["ice", "sm"], cflags_only=True, when=toolkit_gtk)
|
|
|
|
+pkg_check_modules("MOZ_X11", x11_libs, when=with_x)
|
|
|
|
+pkg_check_modules("MOZ_X11_SM", ["ice", "sm"], cflags_only=True, when=with_x)
|
2021-10-05 08:30:33 +00:00
|
|
|
|
|
|
|
|
|
|
|
# ASan Reporter Addon
|
2022-03-06 12:10:08 +00:00
|
|
|
diff --git a/toolkit/xre/moz.build b/toolkit/xre/moz.build
|
|
|
|
index b1e2b58621..576ec91669 100644
|
|
|
|
--- a/toolkit/xre/moz.build
|
|
|
|
+++ b/toolkit/xre/moz.build
|
|
|
|
@@ -156,7 +156,7 @@ SOURCES += [
|
|
|
|
"ProfileReset.cpp",
|
|
|
|
]
|
|
|
|
|
|
|
|
-if CONFIG["MOZ_X11"]:
|
|
|
|
+if CONFIG["MOZ_X11"] or CONFIG["MOZ_WAYLAND"]:
|
|
|
|
UNIFIED_SOURCES += [
|
|
|
|
"glxtest.cpp",
|
|
|
|
]
|
|
|
|
@@ -187,7 +187,7 @@ include("/ipc/chromium/chromium-config.mozbuild")
|
|
|
|
|
|
|
|
FINAL_LIBRARY = "xul"
|
|
|
|
|
|
|
|
-if CONFIG["MOZ_X11"]:
|
|
|
|
+if CONFIG["MOZ_X11"] or CONFIG["MOZ_WAYLAND"]:
|
|
|
|
DEFINES["USE_GLX_TEST"] = True
|
|
|
|
|
|
|
|
for var in (
|
2021-07-08 15:32:23 +00:00
|
|
|
diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp
|
2022-03-11 09:38:26 +00:00
|
|
|
index d997493..a6cef19 100644
|
2021-07-08 15:32:23 +00:00
|
|
|
--- a/toolkit/xre/nsAppRunner.cpp
|
|
|
|
+++ b/toolkit/xre/nsAppRunner.cpp
|
2022-03-11 09:38:26 +00:00
|
|
|
@@ -4493,6 +4493,7 @@ static void PR_CALLBACK ReadAheadDlls_ThreadStart(void* arg) {
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2022-03-06 12:10:08 +00:00
|
|
|
#if defined(MOZ_WAYLAND)
|
|
|
|
bool IsWaylandEnabled() {
|
|
|
|
+# ifdef MOZ_X11
|
|
|
|
const char* waylandDisplay = PR_GetEnv("WAYLAND_DISPLAY");
|
|
|
|
if (!waylandDisplay) {
|
|
|
|
return false;
|
2022-03-11 09:38:26 +00:00
|
|
|
@@ -4513,6 +4514,9 @@ bool IsWaylandEnabled() {
|
|
|
|
return true;
|
|
|
|
}
|
2022-03-06 12:10:08 +00:00
|
|
|
}
|
|
|
|
+# else
|
|
|
|
+ return true;
|
|
|
|
+# endif
|
2022-03-11 09:38:26 +00:00
|
|
|
# ifdef EARLY_BETA_OR_EARLIER
|
|
|
|
// Enable by default when we're running on a recent enough GTK version. We'd
|
|
|
|
// like to check further details like compositor version and so on ideally
|
2021-07-08 15:32:23 +00:00
|
|
|
diff --git a/toolkit/xre/nsGDKErrorHandler.cpp b/toolkit/xre/nsGDKErrorHandler.cpp
|
2022-03-06 12:10:08 +00:00
|
|
|
index 421abdf12f..c7803cf973 100644
|
2021-07-08 15:32:23 +00:00
|
|
|
--- a/toolkit/xre/nsGDKErrorHandler.cpp
|
|
|
|
+++ b/toolkit/xre/nsGDKErrorHandler.cpp
|
2022-03-06 12:10:08 +00:00
|
|
|
@@ -6,14 +6,18 @@
|
2021-07-08 15:32:23 +00:00
|
|
|
#include "nsGDKErrorHandler.h"
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
#include <gtk/gtk.h>
|
2022-03-06 12:10:08 +00:00
|
|
|
-#include <gdk/gdkx.h>
|
2021-07-08 15:32:23 +00:00
|
|
|
+#ifdef MOZ_X11
|
2022-03-06 12:10:08 +00:00
|
|
|
+# include <gdk/gdkx.h>
|
2021-07-08 15:32:23 +00:00
|
|
|
+#endif
|
|
|
|
#include <errno.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
#include "nsDebug.h"
|
|
|
|
#include "nsString.h"
|
2022-03-06 12:10:08 +00:00
|
|
|
-#include "nsX11ErrorHandler.h"
|
2021-07-08 15:32:23 +00:00
|
|
|
+#ifdef MOZ_X11
|
2022-03-06 12:10:08 +00:00
|
|
|
+# include "nsX11ErrorHandler.h"
|
2021-07-08 15:32:23 +00:00
|
|
|
+#endif
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
#include "prenv.h"
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2022-03-06 12:10:08 +00:00
|
|
|
@@ -26,6 +30,7 @@
|
2021-07-08 15:32:23 +00:00
|
|
|
*/
|
|
|
|
static void GdkErrorHandler(const gchar* log_domain, GLogLevelFlags log_level,
|
|
|
|
const gchar* message, gpointer user_data) {
|
|
|
|
+#ifdef MOZ_X11
|
|
|
|
if (strstr(message, "X Window System error")) {
|
|
|
|
XErrorEvent event;
|
|
|
|
nsDependentCString buffer(message);
|
2022-03-06 12:10:08 +00:00
|
|
|
@@ -96,6 +101,10 @@ static void GdkErrorHandler(const gchar* log_domain, GLogLevelFlags log_level,
|
2021-07-13 20:43:56 +00:00
|
|
|
g_log_default_handler(log_domain, log_level, message, user_data);
|
|
|
|
MOZ_CRASH_UNSAFE(message);
|
2021-10-05 08:30:33 +00:00
|
|
|
}
|
2022-03-06 12:10:08 +00:00
|
|
|
+#else
|
|
|
|
+ g_log_default_handler(log_domain, log_level, message, user_data);
|
|
|
|
+ MOZ_CRASH_UNSAFE(message);
|
2021-10-05 08:30:33 +00:00
|
|
|
+#endif
|
2021-07-08 15:32:23 +00:00
|
|
|
}
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
void InstallGdkErrorHandler() {
|
2022-03-06 12:10:08 +00:00
|
|
|
@@ -103,7 +112,9 @@ void InstallGdkErrorHandler() {
|
2021-07-08 15:32:23 +00:00
|
|
|
(GLogLevelFlags)(G_LOG_LEVEL_ERROR | G_LOG_FLAG_FATAL |
|
|
|
|
G_LOG_FLAG_RECURSION),
|
|
|
|
GdkErrorHandler, nullptr);
|
|
|
|
+#ifdef MOZ_X11
|
|
|
|
if (PR_GetEnv("MOZ_X_SYNC")) {
|
|
|
|
XSynchronize(GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), X11True);
|
|
|
|
}
|
|
|
|
+#endif
|
|
|
|
}
|
|
|
|
diff --git a/widget/CompositorWidget.h b/widget/CompositorWidget.h
|
2022-03-06 12:10:08 +00:00
|
|
|
index 4d38bc6220..09e19945a9 100644
|
2021-07-08 15:32:23 +00:00
|
|
|
--- a/widget/CompositorWidget.h
|
|
|
|
+++ b/widget/CompositorWidget.h
|
2021-10-05 08:30:33 +00:00
|
|
|
@@ -62,7 +62,7 @@ class CompositorWidgetDelegate {
|
2021-07-08 15:32:23 +00:00
|
|
|
};
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
// Platforms that support out-of-process widgets.
|
2022-03-06 12:10:08 +00:00
|
|
|
-#if defined(XP_WIN) || defined(MOZ_X11) || defined(MOZ_WIDGET_ANDROID)
|
|
|
|
+#if defined(XP_WIN) || defined(MOZ_WIDGET_GTK) || defined(MOZ_WIDGET_ANDROID)
|
2021-07-08 15:32:23 +00:00
|
|
|
// CompositorWidgetParent should implement CompositorWidget and
|
|
|
|
// PCompositorWidgetParent.
|
|
|
|
class CompositorWidgetParent;
|
2022-03-06 12:10:08 +00:00
|
|
|
diff --git a/widget/gtk/GtkCompositorWidget.cpp b/widget/gtk/GtkCompositorWidget.cpp
|
|
|
|
index 89a8248bc0..2454006d0d 100644
|
|
|
|
--- a/widget/gtk/GtkCompositorWidget.cpp
|
|
|
|
+++ b/widget/gtk/GtkCompositorWidget.cpp
|
|
|
|
@@ -49,9 +49,9 @@ GtkCompositorWidget::GtkCompositorWidget(
|
|
|
|
auto size = mClientSize.Lock();
|
|
|
|
*size = aInitData.InitialClientSize();
|
|
|
|
|
|
|
|
- LOG("GtkCompositorWidget::GtkCompositorWidget() [%p] mXWindow %p "
|
|
|
|
+ LOG("GtkCompositorWidget::GtkCompositorWidget() [%p] aWindow %p "
|
|
|
|
"mIsRenderingSuspended %d\n",
|
|
|
|
- (void*)mWidget.get(), (void*)mXWindow, !!mIsRenderingSuspended);
|
|
|
|
+ (void*)mWidget.get(), (void*)aWindow, !!mIsRenderingSuspended);
|
|
|
|
}
|
|
|
|
|
|
|
|
GtkCompositorWidget::~GtkCompositorWidget() {
|
2021-07-08 15:32:23 +00:00
|
|
|
diff --git a/widget/gtk/MozContainer.cpp b/widget/gtk/MozContainer.cpp
|
2022-03-06 12:10:08 +00:00
|
|
|
index 95832dc03d..0d6585c2d4 100644
|
2021-07-08 15:32:23 +00:00
|
|
|
--- a/widget/gtk/MozContainer.cpp
|
|
|
|
+++ b/widget/gtk/MozContainer.cpp
|
2022-03-06 12:10:08 +00:00
|
|
|
@@ -9,7 +9,6 @@
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
#include <glib.h>
|
|
|
|
#include <gtk/gtk.h>
|
2022-03-06 12:10:08 +00:00
|
|
|
-#include <gdk/gdkx.h>
|
2021-07-08 15:32:23 +00:00
|
|
|
#include <stdio.h>
|
2021-10-05 08:30:33 +00:00
|
|
|
#include "mozilla/WidgetUtilsGtk.h"
|
|
|
|
|
2022-03-06 12:10:08 +00:00
|
|
|
diff --git a/widget/gtk/TaskbarProgress.cpp b/widget/gtk/TaskbarProgress.cpp
|
|
|
|
index 2aad109eab..396f39b5e7 100644
|
|
|
|
--- a/widget/gtk/TaskbarProgress.cpp
|
|
|
|
+++ b/widget/gtk/TaskbarProgress.cpp
|
|
|
|
@@ -33,7 +33,6 @@ TaskbarProgress::~TaskbarProgress() {
|
|
|
|
NS_IMETHODIMP
|
|
|
|
TaskbarProgress::SetProgressState(nsTaskbarProgressState aState,
|
|
|
|
uint64_t aCurrentValue, uint64_t aMaxValue) {
|
|
|
|
-#ifdef MOZ_X11
|
|
|
|
NS_ENSURE_ARG_RANGE(aState, 0, STATE_PAUSED);
|
|
|
|
|
|
|
|
if (aState == STATE_NO_PROGRESS || aState == STATE_INDETERMINATE) {
|
|
|
|
@@ -72,7 +71,6 @@ TaskbarProgress::SetProgressState(nsTaskbarProgressState aState,
|
|
|
|
("GtkTaskbarProgress::SetProgressState progress: %lu", progress));
|
|
|
|
|
|
|
|
mPrimaryWindow->SetProgress(progress);
|
|
|
|
-#endif
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
diff --git a/widget/gtk/WindowSurfaceProvider.cpp b/widget/gtk/WindowSurfaceProvider.cpp
|
|
|
|
index 403af8e445..94ba1be0ff 100644
|
|
|
|
--- a/widget/gtk/WindowSurfaceProvider.cpp
|
|
|
|
+++ b/widget/gtk/WindowSurfaceProvider.cpp
|
|
|
|
@@ -10,6 +10,7 @@
|
|
|
|
#include "mozilla/gfx/Logging.h"
|
|
|
|
#include "mozilla/layers/LayersTypes.h"
|
|
|
|
#include "nsWindow.h"
|
|
|
|
+#include "WidgetUtilsGtk.h"
|
|
|
|
|
|
|
|
#ifdef MOZ_WAYLAND
|
|
|
|
# include "mozilla/StaticPrefs_widget.h"
|
2021-07-08 15:32:23 +00:00
|
|
|
diff --git a/widget/gtk/components.conf b/widget/gtk/components.conf
|
2022-03-06 12:10:08 +00:00
|
|
|
index 38c07bd812..8f2c10894a 100644
|
2021-07-08 15:32:23 +00:00
|
|
|
--- a/widget/gtk/components.conf
|
|
|
|
+++ b/widget/gtk/components.conf
|
2022-03-06 12:10:08 +00:00
|
|
|
@@ -76,53 +76,49 @@ Classes = [
|
|
|
|
'headers': ['/widget/gtk/nsApplicationChooser.h'],
|
|
|
|
'processes': ProcessSelector.MAIN_PROCESS_ONLY,
|
2021-07-08 15:32:23 +00:00
|
|
|
},
|
2022-03-06 12:10:08 +00:00
|
|
|
+ {
|
|
|
|
+ 'name': 'GfxInfo',
|
|
|
|
+ 'cid': '{d755a760-9f27-11df-0800-200c9a664242}',
|
|
|
|
+ 'contract_ids': ['@mozilla.org/gfx/info;1'],
|
|
|
|
+ 'type': 'mozilla::widget::GfxInfo',
|
|
|
|
+ 'headers': ['/widget/gtk/GfxInfo.h'],
|
|
|
|
+ 'init_method': 'Init',
|
|
|
|
+ 'processes': ProcessSelector.ALLOW_IN_GPU_PROCESS,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ 'js_name': 'clipboard',
|
|
|
|
+ 'cid': '{8b5314ba-db01-11d2-96ce-0060b0fb9956}',
|
|
|
|
+ 'contract_ids': ['@mozilla.org/widget/clipboard;1'],
|
|
|
|
+ 'interfaces': ['nsIClipboard'],
|
|
|
|
+ 'type': 'nsIClipboard',
|
|
|
|
+ 'processes': ProcessSelector.MAIN_PROCESS_ONLY,
|
|
|
|
+ 'overridable': True,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ 'cid': '{77221d5a-1dd2-11b2-8c69-c710f15d2ed5}',
|
|
|
|
+ 'contract_ids': ['@mozilla.org/widget/clipboardhelper;1'],
|
|
|
|
+ 'type': 'nsClipboardHelper',
|
|
|
|
+ 'headers': ['/widget/nsClipboardHelper.h'],
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ 'cid': '{8b5314bb-db01-11d2-96ce-0060b0fb9956}',
|
|
|
|
+ 'contract_ids': ['@mozilla.org/widget/dragservice;1'],
|
|
|
|
+ 'singleton': True,
|
|
|
|
+ 'type': 'nsDragService',
|
|
|
|
+ 'headers': ['/widget/gtk/nsDragService.h'],
|
|
|
|
+ 'constructor': 'nsDragService::GetInstance',
|
|
|
|
+ 'processes': ProcessSelector.MAIN_PROCESS_ONLY,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ 'cid': '{6987230e-0098-4e78-bc5f-1493ee7519fa}',
|
|
|
|
+ 'contract_ids': ['@mozilla.org/widget/useridleservice;1'],
|
|
|
|
+ 'singleton': True,
|
|
|
|
+ 'type': 'nsUserIdleService',
|
|
|
|
+ 'headers': ['/widget/gtk/nsUserIdleServiceGTK.h'],
|
|
|
|
+ 'constructor': 'nsUserIdleServiceGTK::GetInstance',
|
|
|
|
+ },
|
2021-07-08 15:32:23 +00:00
|
|
|
]
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
-if defined('MOZ_X11'):
|
2022-03-06 12:10:08 +00:00
|
|
|
- Classes += [
|
|
|
|
- {
|
|
|
|
- 'js_name': 'clipboard',
|
|
|
|
- 'cid': '{8b5314ba-db01-11d2-96ce-0060b0fb9956}',
|
|
|
|
- 'contract_ids': ['@mozilla.org/widget/clipboard;1'],
|
|
|
|
- 'interfaces': ['nsIClipboard'],
|
|
|
|
- 'type': 'nsIClipboard',
|
|
|
|
- 'processes': ProcessSelector.MAIN_PROCESS_ONLY,
|
|
|
|
- 'overridable': True,
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- 'cid': '{77221d5a-1dd2-11b2-8c69-c710f15d2ed5}',
|
|
|
|
- 'contract_ids': ['@mozilla.org/widget/clipboardhelper;1'],
|
|
|
|
- 'type': 'nsClipboardHelper',
|
|
|
|
- 'headers': ['/widget/nsClipboardHelper.h'],
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- 'cid': '{8b5314bb-db01-11d2-96ce-0060b0fb9956}',
|
|
|
|
- 'contract_ids': ['@mozilla.org/widget/dragservice;1'],
|
|
|
|
- 'singleton': True,
|
|
|
|
- 'type': 'nsDragService',
|
|
|
|
- 'headers': ['/widget/gtk/nsDragService.h'],
|
|
|
|
- 'constructor': 'nsDragService::GetInstance',
|
|
|
|
- 'processes': ProcessSelector.MAIN_PROCESS_ONLY,
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- 'name': 'GfxInfo',
|
|
|
|
- 'cid': '{d755a760-9f27-11df-0800-200c9a664242}',
|
|
|
|
- 'contract_ids': ['@mozilla.org/gfx/info;1'],
|
|
|
|
- 'type': 'mozilla::widget::GfxInfo',
|
|
|
|
- 'headers': ['/widget/gtk/GfxInfo.h'],
|
|
|
|
- 'init_method': 'Init',
|
|
|
|
- 'processes': ProcessSelector.ALLOW_IN_GPU_PROCESS,
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- 'cid': '{6987230e-0098-4e78-bc5f-1493ee7519fa}',
|
|
|
|
- 'contract_ids': ['@mozilla.org/widget/useridleservice;1'],
|
|
|
|
- 'singleton': True,
|
|
|
|
- 'type': 'nsUserIdleService',
|
|
|
|
- 'headers': ['/widget/gtk/nsUserIdleServiceGTK.h'],
|
|
|
|
- 'constructor': 'nsUserIdleServiceGTK::GetInstance',
|
|
|
|
- },
|
|
|
|
- ]
|
|
|
|
-
|
|
|
|
if defined('NS_PRINTING'):
|
2021-07-08 15:32:23 +00:00
|
|
|
Classes += [
|
|
|
|
{
|
|
|
|
diff --git a/widget/gtk/moz.build b/widget/gtk/moz.build
|
2022-03-11 09:38:26 +00:00
|
|
|
index 320318b..d83a256 100644
|
2021-07-08 15:32:23 +00:00
|
|
|
--- a/widget/gtk/moz.build
|
|
|
|
+++ b/widget/gtk/moz.build
|
2022-03-11 09:38:26 +00:00
|
|
|
@@ -34,16 +34,24 @@ EXPORTS += [
|
2022-03-06 12:10:08 +00:00
|
|
|
EXPORTS.mozilla += ["WidgetUtilsGtk.h"]
|
|
|
|
|
|
|
|
EXPORTS.mozilla.widget += [
|
|
|
|
+ "CompositorWidgetChild.h",
|
|
|
|
+ "CompositorWidgetParent.h",
|
|
|
|
+ "GtkCompositorWidget.h",
|
|
|
|
+ "InProcessGtkCompositorWidget.h",
|
|
|
|
"WindowSurface.h",
|
|
|
|
"WindowSurfaceProvider.h",
|
|
|
|
]
|
|
|
|
|
|
|
|
UNIFIED_SOURCES += [
|
2022-03-11 09:38:26 +00:00
|
|
|
"AsyncGtkClipboardRequest.cpp",
|
2022-03-06 12:10:08 +00:00
|
|
|
+ "CompositorWidgetChild.cpp",
|
|
|
|
+ "CompositorWidgetParent.cpp",
|
|
|
|
"GfxInfo.cpp",
|
|
|
|
"gtk3drawing.cpp",
|
|
|
|
"GtkCompositorWidget.cpp",
|
|
|
|
"IMContextWrapper.cpp",
|
|
|
|
+ "InProcessGtkCompositorWidget.cpp",
|
|
|
|
+ "keysym2ucs.c",
|
|
|
|
"MozContainer.cpp",
|
|
|
|
"MPRISServiceHandler.cpp",
|
|
|
|
"NativeKeyBindings.cpp",
|
2022-03-11 09:38:26 +00:00
|
|
|
@@ -59,6 +67,7 @@ UNIFIED_SOURCES += [
|
2022-03-06 12:10:08 +00:00
|
|
|
"nsLookAndFeel.cpp",
|
|
|
|
"nsSound.cpp",
|
|
|
|
"nsToolkit.cpp",
|
|
|
|
+ "nsUserIdleServiceGTK.cpp",
|
|
|
|
"nsWidgetFactory.cpp",
|
|
|
|
"ScreenHelperGTK.cpp",
|
|
|
|
"TaskbarProgress.cpp",
|
|
|
|
@@ -101,22 +110,12 @@ if CONFIG["MOZ_WAYLAND"]:
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
if CONFIG["MOZ_X11"]:
|
|
|
|
UNIFIED_SOURCES += [
|
2021-07-13 20:43:56 +00:00
|
|
|
- "CompositorWidgetChild.cpp",
|
|
|
|
- "CompositorWidgetParent.cpp",
|
|
|
|
- "InProcessGtkCompositorWidget.cpp",
|
2021-07-08 15:32:23 +00:00
|
|
|
"nsClipboardX11.cpp",
|
2021-07-13 20:43:56 +00:00
|
|
|
"nsShmImage.cpp",
|
|
|
|
- "nsUserIdleServiceGTK.cpp",
|
2021-07-08 15:32:23 +00:00
|
|
|
"WindowSurfaceX11.cpp",
|
|
|
|
"WindowSurfaceX11Image.cpp",
|
2021-07-13 20:43:56 +00:00
|
|
|
"WindowSurfaceX11SHM.cpp",
|
2021-07-08 15:32:23 +00:00
|
|
|
]
|
2021-07-13 20:43:56 +00:00
|
|
|
- EXPORTS.mozilla.widget += [
|
|
|
|
- "CompositorWidgetChild.h",
|
|
|
|
- "CompositorWidgetParent.h",
|
|
|
|
- "GtkCompositorWidget.h",
|
|
|
|
- "InProcessGtkCompositorWidget.h",
|
|
|
|
- ]
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-13 20:43:56 +00:00
|
|
|
if CONFIG["NS_PRINTING"]:
|
|
|
|
UNIFIED_SOURCES += [
|
2021-07-08 15:32:23 +00:00
|
|
|
diff --git a/widget/gtk/mozgtk/mozgtk.c b/widget/gtk/mozgtk/mozgtk.c
|
2022-03-06 12:10:08 +00:00
|
|
|
index 677f9b3561..e375cab31f 100644
|
2021-07-08 15:32:23 +00:00
|
|
|
--- a/widget/gtk/mozgtk/mozgtk.c
|
|
|
|
+++ b/widget/gtk/mozgtk/mozgtk.c
|
2022-03-06 12:10:08 +00:00
|
|
|
@@ -6,16 +6,4 @@
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-13 20:43:56 +00:00
|
|
|
#include "mozilla/Types.h"
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2022-03-06 12:10:08 +00:00
|
|
|
-#include <X11/Xlib.h>
|
|
|
|
-// Bug 1271100
|
|
|
|
-// We need to trick system Cairo into not using the XShm extension due to
|
|
|
|
-// a race condition in it that results in frequent BadAccess errors. Cairo
|
|
|
|
-// relies upon XShmQueryExtension to initially detect if XShm is available.
|
|
|
|
-// So we define our own stub that always indicates XShm not being present.
|
|
|
|
-// mozgtk loads before libXext/libcairo and so this stub will take priority.
|
|
|
|
-// Our tree usage goes through xcb and remains unaffected by this.
|
|
|
|
-//
|
|
|
|
-// This is also used to force libxul to depend on the mozgtk library. If we
|
|
|
|
-// ever can remove this workaround for system Cairo, we'll need something
|
|
|
|
-// to replace it for that purpose.
|
|
|
|
-MOZ_EXPORT Bool XShmQueryExtension(Display* aDisplay) { return False; }
|
|
|
|
+MOZ_EXPORT void PleaseLinkWithMe() {}
|
|
|
|
diff --git a/widget/gtk/mozwayland/mozwayland.c b/widget/gtk/mozwayland/mozwayland.c
|
|
|
|
index 1a86468b4f..eee67ed3a9 100644
|
|
|
|
--- a/widget/gtk/mozwayland/mozwayland.c
|
|
|
|
+++ b/widget/gtk/mozwayland/mozwayland.c
|
|
|
|
@@ -8,7 +8,6 @@
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include "mozilla/Types.h"
|
|
|
|
#include <gtk/gtk.h>
|
|
|
|
-#include <gtk/gtkx.h>
|
|
|
|
#include <gdk/gdkwayland.h>
|
|
|
|
|
|
|
|
union wl_argument;
|
2021-07-08 15:32:23 +00:00
|
|
|
diff --git a/widget/gtk/nsClipboard.cpp b/widget/gtk/nsClipboard.cpp
|
2022-03-11 09:38:26 +00:00
|
|
|
index 800fde7..f5e9ef7 100644
|
2021-07-08 15:32:23 +00:00
|
|
|
--- a/widget/gtk/nsClipboard.cpp
|
|
|
|
+++ b/widget/gtk/nsClipboard.cpp
|
|
|
|
@@ -9,7 +9,9 @@
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
#include "nsArrayUtils.h"
|
|
|
|
#include "nsClipboard.h"
|
2022-03-06 12:10:08 +00:00
|
|
|
-#include "nsClipboardX11.h"
|
2021-07-08 15:32:23 +00:00
|
|
|
+#if defined(MOZ_X11)
|
2022-03-06 12:10:08 +00:00
|
|
|
+# include "nsClipboardX11.h"
|
2021-07-08 15:32:23 +00:00
|
|
|
+#endif
|
|
|
|
#if defined(MOZ_WAYLAND)
|
|
|
|
# include "nsClipboardWayland.h"
|
2022-03-11 09:38:26 +00:00
|
|
|
#endif
|
|
|
|
@@ -36,7 +38,6 @@
|
2021-07-08 15:32:23 +00:00
|
|
|
#include "imgIContainer.h"
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
#include <gtk/gtk.h>
|
2022-03-06 12:10:08 +00:00
|
|
|
-#include <gtk/gtkx.h>
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
#include "mozilla/Encoding.h"
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2022-03-11 09:38:26 +00:00
|
|
|
@@ -134,13 +135,17 @@ nsClipboard::~nsClipboard() {
|
2021-07-08 15:32:23 +00:00
|
|
|
NS_IMPL_ISUPPORTS(nsClipboard, nsIClipboard, nsIObserver)
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
nsresult nsClipboard::Init(void) {
|
2022-03-06 12:10:08 +00:00
|
|
|
+#if defined(MOZ_X11)
|
|
|
|
if (widget::GdkIsX11Display()) {
|
|
|
|
mContext = new nsRetrievalContextX11();
|
|
|
|
+ }
|
|
|
|
+#endif
|
|
|
|
#if defined(MOZ_WAYLAND)
|
2021-07-13 20:43:56 +00:00
|
|
|
- } else if (widget::GdkIsWaylandDisplay()) {
|
|
|
|
+ if (widget::GdkIsWaylandDisplay()) {
|
2022-03-11 09:38:26 +00:00
|
|
|
mContext = new nsRetrievalContextWayland();
|
2022-03-06 12:10:08 +00:00
|
|
|
+ }
|
|
|
|
#endif
|
|
|
|
- } else {
|
|
|
|
+ if (!mContext) {
|
2021-10-05 08:30:33 +00:00
|
|
|
NS_WARNING("Missing nsRetrievalContext for nsClipboard!");
|
|
|
|
return NS_OK;
|
2021-11-04 06:49:47 +00:00
|
|
|
}
|
2021-07-08 15:32:23 +00:00
|
|
|
diff --git a/widget/gtk/nsDragService.cpp b/widget/gtk/nsDragService.cpp
|
2022-03-06 12:10:08 +00:00
|
|
|
index ea57c4f3c0..5355fbe467 100644
|
2021-07-08 15:32:23 +00:00
|
|
|
--- a/widget/gtk/nsDragService.cpp
|
|
|
|
+++ b/widget/gtk/nsDragService.cpp
|
2022-03-06 12:10:08 +00:00
|
|
|
@@ -23,7 +23,6 @@
|
2021-07-08 15:32:23 +00:00
|
|
|
#include "prthread.h"
|
|
|
|
#include <dlfcn.h>
|
|
|
|
#include <gtk/gtk.h>
|
2022-03-06 12:10:08 +00:00
|
|
|
-#include <gdk/gdkx.h>
|
2021-07-08 15:32:23 +00:00
|
|
|
#include "nsCRT.h"
|
|
|
|
#include "mozilla/BasicEvents.h"
|
|
|
|
#include "mozilla/Services.h"
|
2022-03-06 12:10:08 +00:00
|
|
|
@@ -34,7 +33,6 @@
|
2021-07-13 20:43:56 +00:00
|
|
|
#include "mozilla/WidgetUtilsGtk.h"
|
2021-07-08 15:32:23 +00:00
|
|
|
#include "GRefPtr.h"
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
-#include "gfxXlibSurface.h"
|
|
|
|
#include "gfxContext.h"
|
|
|
|
#include "nsImageToPixbuf.h"
|
|
|
|
#include "nsPresContext.h"
|
|
|
|
diff --git a/widget/gtk/nsGtkKeyUtils.cpp b/widget/gtk/nsGtkKeyUtils.cpp
|
2022-03-06 12:10:08 +00:00
|
|
|
index 5f971b721a..d948ae58bf 100644
|
2021-07-08 15:32:23 +00:00
|
|
|
--- a/widget/gtk/nsGtkKeyUtils.cpp
|
|
|
|
+++ b/widget/gtk/nsGtkKeyUtils.cpp
|
2022-03-06 12:10:08 +00:00
|
|
|
@@ -12,15 +12,16 @@
|
2021-07-08 15:32:23 +00:00
|
|
|
#include <gdk/gdkkeysyms.h>
|
|
|
|
#include <algorithm>
|
|
|
|
#include <gdk/gdk.h>
|
|
|
|
-#include <gdk/gdkx.h>
|
|
|
|
+#ifdef MOZ_X11
|
2022-03-06 12:10:08 +00:00
|
|
|
+# include <gdk/gdkx.h>
|
|
|
|
+# include <X11/XKBlib.h>
|
|
|
|
+# include "X11UndefineNone.h"
|
2021-07-08 15:32:23 +00:00
|
|
|
+#endif
|
2022-03-06 12:10:08 +00:00
|
|
|
#include <dlfcn.h>
|
|
|
|
#include <gdk/gdkkeysyms-compat.h>
|
|
|
|
-#include <X11/XKBlib.h>
|
|
|
|
-#include "X11UndefineNone.h"
|
2021-07-08 15:32:23 +00:00
|
|
|
#include "IMContextWrapper.h"
|
|
|
|
#include "WidgetUtils.h"
|
2022-03-06 12:10:08 +00:00
|
|
|
#include "WidgetUtilsGtk.h"
|
|
|
|
-#include "keysym2ucs.h"
|
|
|
|
#include "nsContentUtils.h"
|
|
|
|
#include "nsGtkUtils.h"
|
|
|
|
#include "nsIBidiKeyboard.h"
|
|
|
|
@@ -28,6 +29,7 @@
|
|
|
|
#include "nsReadableUtils.h"
|
|
|
|
#include "nsServiceManagerUtils.h"
|
|
|
|
#include "nsWindow.h"
|
|
|
|
+#include "keysym2ucs.h"
|
|
|
|
|
|
|
|
#include "mozilla/ArrayUtils.h"
|
|
|
|
#include "mozilla/MouseEvents.h"
|
|
|
|
@@ -55,7 +57,9 @@ namespace widget {
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
KeymapWrapper* KeymapWrapper::sInstance = nullptr;
|
|
|
|
guint KeymapWrapper::sLastRepeatableHardwareKeyCode = 0;
|
2022-03-06 12:10:08 +00:00
|
|
|
+#ifdef MOZ_X11
|
|
|
|
Time KeymapWrapper::sLastRepeatableKeyTime = 0;
|
|
|
|
+#endif
|
2021-07-08 15:32:23 +00:00
|
|
|
KeymapWrapper::RepeatState KeymapWrapper::sRepeatState =
|
|
|
|
KeymapWrapper::NOT_PRESSED;
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2022-03-06 12:10:08 +00:00
|
|
|
@@ -354,9 +358,11 @@ KeymapWrapper::KeymapWrapper()
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
g_object_ref(mGdkKeymap);
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
+#ifdef MOZ_X11
|
2021-07-13 20:43:56 +00:00
|
|
|
if (GdkIsX11Display()) {
|
2021-07-08 15:32:23 +00:00
|
|
|
InitXKBExtension();
|
|
|
|
}
|
|
|
|
+#endif
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
Init();
|
|
|
|
}
|
2022-03-06 12:10:08 +00:00
|
|
|
@@ -373,17 +379,18 @@ void KeymapWrapper::Init() {
|
2021-07-08 15:32:23 +00:00
|
|
|
mModifierKeys.Clear();
|
|
|
|
memset(mModifierMasks, 0, sizeof(mModifierMasks));
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
+#ifdef MOZ_X11
|
2021-07-13 20:43:56 +00:00
|
|
|
if (GdkIsX11Display()) {
|
2021-07-08 15:32:23 +00:00
|
|
|
InitBySystemSettingsX11();
|
2022-03-06 12:10:08 +00:00
|
|
|
}
|
|
|
|
+ gdk_window_add_filter(nullptr, FilterEvents, this);
|
2021-07-08 15:32:23 +00:00
|
|
|
+#endif
|
|
|
|
#ifdef MOZ_WAYLAND
|
|
|
|
- else {
|
2022-03-06 12:10:08 +00:00
|
|
|
+ if (GdkIsWaylandDisplay()) {
|
2021-07-13 20:43:56 +00:00
|
|
|
InitBySystemSettingsWayland();
|
2022-03-06 12:10:08 +00:00
|
|
|
}
|
2021-07-08 15:32:23 +00:00
|
|
|
#endif
|
2021-11-04 06:49:47 +00:00
|
|
|
|
2022-03-06 12:10:08 +00:00
|
|
|
- gdk_window_add_filter(nullptr, FilterEvents, this);
|
|
|
|
-
|
|
|
|
MOZ_LOG(gKeyLog, LogLevel::Info,
|
2021-07-08 15:32:23 +00:00
|
|
|
("%p Init, CapsLock=0x%X, NumLock=0x%X, "
|
2022-03-06 12:10:08 +00:00
|
|
|
"ScrollLock=0x%X, Level3=0x%X, Level5=0x%X, "
|
|
|
|
@@ -395,6 +402,7 @@ void KeymapWrapper::Init() {
|
2021-07-08 15:32:23 +00:00
|
|
|
GetModifierMask(SUPER), GetModifierMask(HYPER)));
|
|
|
|
}
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
+#ifdef MOZ_X11
|
|
|
|
void KeymapWrapper::InitXKBExtension() {
|
|
|
|
PodZero(&mKeyboardState);
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2022-03-06 12:10:08 +00:00
|
|
|
@@ -626,6 +634,7 @@ void KeymapWrapper::InitBySystemSettingsX11() {
|
2021-07-08 15:32:23 +00:00
|
|
|
XFreeModifiermap(xmodmap);
|
|
|
|
XFree(xkeymap);
|
|
|
|
}
|
|
|
|
+#endif
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
#ifdef MOZ_WAYLAND
|
|
|
|
void KeymapWrapper::SetModifierMask(xkb_keymap* aKeymap,
|
2022-03-06 12:10:08 +00:00
|
|
|
@@ -789,7 +798,9 @@ void KeymapWrapper::InitBySystemSettingsWayland() {
|
2021-07-08 15:32:23 +00:00
|
|
|
#endif
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
KeymapWrapper::~KeymapWrapper() {
|
|
|
|
+#ifdef MOZ_X11
|
|
|
|
gdk_window_remove_filter(nullptr, FilterEvents, this);
|
|
|
|
+#endif
|
|
|
|
if (mOnKeysChangedSignalHandle) {
|
|
|
|
g_signal_handler_disconnect(mGdkKeymap, mOnKeysChangedSignalHandle);
|
|
|
|
}
|
2022-03-06 12:10:08 +00:00
|
|
|
@@ -800,6 +811,7 @@ KeymapWrapper::~KeymapWrapper() {
|
|
|
|
MOZ_LOG(gKeyLog, LogLevel::Info, ("%p Destructor", this));
|
2021-07-08 15:32:23 +00:00
|
|
|
}
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
+#ifdef MOZ_X11
|
|
|
|
/* static */
|
|
|
|
GdkFilterReturn KeymapWrapper::FilterEvents(GdkXEvent* aXEvent,
|
|
|
|
GdkEvent* aGdkEvent,
|
2022-03-06 12:10:08 +00:00
|
|
|
@@ -913,6 +925,7 @@ GdkFilterReturn KeymapWrapper::FilterEvents(GdkXEvent* aXEvent,
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
return GDK_FILTER_CONTINUE;
|
|
|
|
}
|
|
|
|
+#endif
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
static void ResetBidiKeyboard() {
|
|
|
|
// Reset the bidi keyboard settings for the new GdkKeymap
|
2022-03-06 12:10:08 +00:00
|
|
|
@@ -1773,6 +1786,7 @@ void KeymapWrapper::InitKeyEvent(WidgetKeyboardEvent& aKeyEvent,
|
2021-07-08 15:32:23 +00:00
|
|
|
// state. It means if there're some pending modifier key press or
|
|
|
|
// key release events, the result isn't what we want.
|
|
|
|
guint modifierState = aGdkKeyEvent->state;
|
|
|
|
+#ifdef MOZ_X11
|
|
|
|
GdkDisplay* gdkDisplay = gdk_display_get_default();
|
|
|
|
if (aGdkKeyEvent->is_modifier && GdkIsX11Display(gdkDisplay)) {
|
|
|
|
Display* display = gdk_x11_display_get_xdisplay(gdkDisplay);
|
2022-03-06 12:10:08 +00:00
|
|
|
@@ -1790,6 +1804,7 @@ void KeymapWrapper::InitKeyEvent(WidgetKeyboardEvent& aKeyEvent,
|
2021-07-08 15:32:23 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
+#endif
|
|
|
|
InitInputEvent(aKeyEvent, modifierState);
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
switch (aGdkKeyEvent->keyval) {
|
2022-03-06 12:10:08 +00:00
|
|
|
@@ -2036,6 +2051,7 @@ bool KeymapWrapper::IsLatinGroup(guint8 aGroup) {
|
2021-07-08 15:32:23 +00:00
|
|
|
return result;
|
|
|
|
}
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
+#ifdef MOZ_X11
|
|
|
|
bool KeymapWrapper::IsAutoRepeatableKey(guint aHardwareKeyCode) {
|
|
|
|
uint8_t indexOfArray = aHardwareKeyCode / 8;
|
|
|
|
MOZ_ASSERT(indexOfArray < ArrayLength(mKeyboardState.auto_repeats),
|
2022-03-06 12:10:08 +00:00
|
|
|
@@ -2043,6 +2059,7 @@ bool KeymapWrapper::IsAutoRepeatableKey(guint aHardwareKeyCode) {
|
2021-07-08 15:32:23 +00:00
|
|
|
char bitMask = 1 << (aHardwareKeyCode % 8);
|
|
|
|
return (mKeyboardState.auto_repeats[indexOfArray] & bitMask) != 0;
|
|
|
|
}
|
|
|
|
+#endif
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
/* static */
|
|
|
|
bool KeymapWrapper::IsBasicLatinLetterOrNumeral(uint32_t aCharCode) {
|
|
|
|
diff --git a/widget/gtk/nsGtkKeyUtils.h b/widget/gtk/nsGtkKeyUtils.h
|
2022-03-06 12:10:08 +00:00
|
|
|
index 18188c9b00..59a61752bb 100644
|
2021-07-08 15:32:23 +00:00
|
|
|
--- a/widget/gtk/nsGtkKeyUtils.h
|
|
|
|
+++ b/widget/gtk/nsGtkKeyUtils.h
|
2022-03-06 12:10:08 +00:00
|
|
|
@@ -12,8 +12,10 @@
|
|
|
|
#include "nsIWidget.h"
|
2021-07-08 15:32:23 +00:00
|
|
|
#include "nsTArray.h"
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2022-03-06 12:10:08 +00:00
|
|
|
-#include <gdk/gdk.h>
|
|
|
|
-#include <X11/XKBlib.h>
|
2021-07-08 15:32:23 +00:00
|
|
|
+#ifdef MOZ_X11
|
2022-03-06 12:10:08 +00:00
|
|
|
+# include <gdk/gdk.h>
|
|
|
|
+# include <X11/XKBlib.h>
|
2021-07-08 15:32:23 +00:00
|
|
|
+#endif
|
|
|
|
#ifdef MOZ_WAYLAND
|
|
|
|
# include <gdk/gdkwayland.h>
|
|
|
|
# include <xkbcommon/xkbcommon.h>
|
2022-03-06 12:10:08 +00:00
|
|
|
@@ -248,8 +250,10 @@ class KeymapWrapper {
|
|
|
|
* Initializing methods.
|
2021-07-08 15:32:23 +00:00
|
|
|
*/
|
2022-03-06 12:10:08 +00:00
|
|
|
void Init();
|
2021-07-13 20:43:56 +00:00
|
|
|
+#ifdef MOZ_X11
|
2022-03-06 12:10:08 +00:00
|
|
|
void InitXKBExtension();
|
|
|
|
void InitBySystemSettingsX11();
|
|
|
|
+#endif
|
|
|
|
#ifdef MOZ_WAYLAND
|
|
|
|
void InitBySystemSettingsWayland();
|
|
|
|
#endif
|
|
|
|
@@ -325,6 +329,7 @@ class KeymapWrapper {
|
|
|
|
*/
|
|
|
|
int mXKBBaseEventCode;
|
|
|
|
|
|
|
|
+#ifdef MOZ_X11
|
|
|
|
/**
|
|
|
|
* Only auto_repeats[] stores valid value. If you need to use other
|
|
|
|
* members, you need to listen notification events for them.
|
|
|
|
@@ -332,6 +337,7 @@ class KeymapWrapper {
|
|
|
|
* InitXKBExtension().
|
|
|
|
*/
|
2021-07-08 15:32:23 +00:00
|
|
|
XKeyboardState mKeyboardState;
|
|
|
|
+#endif
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
/**
|
|
|
|
* Pointer of the singleton instance.
|
2022-03-06 12:10:08 +00:00
|
|
|
@@ -342,15 +348,19 @@ class KeymapWrapper {
|
2021-07-08 15:32:23 +00:00
|
|
|
* Auto key repeat management.
|
|
|
|
*/
|
|
|
|
static guint sLastRepeatableHardwareKeyCode;
|
2022-03-06 12:10:08 +00:00
|
|
|
+#ifdef MOZ_X11
|
|
|
|
static Time sLastRepeatableKeyTime;
|
|
|
|
+#endif
|
2021-07-08 15:32:23 +00:00
|
|
|
enum RepeatState { NOT_PRESSED, FIRST_PRESS, REPEATING };
|
|
|
|
static RepeatState sRepeatState;
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2022-03-06 12:10:08 +00:00
|
|
|
+#ifdef MOZ_X11
|
|
|
|
/**
|
|
|
|
* IsAutoRepeatableKey() returns true if the key supports auto repeat.
|
|
|
|
* Otherwise, false.
|
|
|
|
*/
|
|
|
|
bool IsAutoRepeatableKey(guint aHardwareKeyCode);
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Signal handlers.
|
2021-07-08 15:32:23 +00:00
|
|
|
diff --git a/widget/gtk/nsPrintDialogGTK.cpp b/widget/gtk/nsPrintDialogGTK.cpp
|
2022-03-06 12:10:08 +00:00
|
|
|
index 8fb56543b7..9a562eb124 100644
|
2021-07-08 15:32:23 +00:00
|
|
|
--- a/widget/gtk/nsPrintDialogGTK.cpp
|
|
|
|
+++ b/widget/gtk/nsPrintDialogGTK.cpp
|
2022-03-06 12:10:08 +00:00
|
|
|
@@ -5,6 +5,9 @@
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2022-03-06 12:10:08 +00:00
|
|
|
#include <gtk/gtk.h>
|
|
|
|
#include <gtk/gtkunixprint.h>
|
2021-07-08 15:32:23 +00:00
|
|
|
+#ifdef MOZ_X11
|
2022-03-06 12:10:08 +00:00
|
|
|
+# include <gdk/gdkx.h>
|
2021-07-08 15:32:23 +00:00
|
|
|
+#endif
|
2022-03-06 12:10:08 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
#include "mozilla/ArrayUtils.h"
|
|
|
|
@@ -27,8 +30,6 @@
|
|
|
|
#include "WidgetUtilsGtk.h"
|
|
|
|
#include "nsIObserverService.h"
|
|
|
|
|
|
|
|
-// for gdk_x11_window_get_xid
|
|
|
|
-#include <gdk/gdkx.h>
|
2021-07-08 15:32:23 +00:00
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
#include <fcntl.h>
|
2022-03-06 12:10:08 +00:00
|
|
|
@@ -527,6 +528,7 @@ static void wayland_window_handle_exported(GdkWindow* window,
|
2021-07-08 15:32:23 +00:00
|
|
|
static gboolean window_export_handle(GtkWindow* window,
|
|
|
|
GtkWindowHandleExported callback,
|
|
|
|
gpointer user_data) {
|
|
|
|
+#ifdef MOZ_X11
|
2021-07-13 20:43:56 +00:00
|
|
|
if (GdkIsX11Display()) {
|
2021-07-08 15:32:23 +00:00
|
|
|
GdkWindow* gdk_window = gtk_widget_get_window(GTK_WIDGET(window));
|
|
|
|
char* handle_str;
|
2022-03-06 12:10:08 +00:00
|
|
|
@@ -537,8 +539,9 @@ static gboolean window_export_handle(GtkWindow* window,
|
2021-07-08 15:32:23 +00:00
|
|
|
g_free(handle_str);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
+#endif
|
|
|
|
#ifdef MOZ_WAYLAND
|
2021-07-13 20:43:56 +00:00
|
|
|
- else if (GdkIsWaylandDisplay()) {
|
|
|
|
+ if (GdkIsWaylandDisplay()) {
|
2021-07-08 15:32:23 +00:00
|
|
|
GdkWindow* gdk_window = gtk_widget_get_window(GTK_WIDGET(window));
|
|
|
|
WaylandWindowHandleExportedData* data;
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
diff --git a/widget/gtk/nsUserIdleServiceGTK.cpp b/widget/gtk/nsUserIdleServiceGTK.cpp
|
2022-03-06 12:10:08 +00:00
|
|
|
index 884d52a6ca..4b2b04f09a 100644
|
2021-07-08 15:32:23 +00:00
|
|
|
--- a/widget/gtk/nsUserIdleServiceGTK.cpp
|
|
|
|
+++ b/widget/gtk/nsUserIdleServiceGTK.cpp
|
2022-03-06 12:10:08 +00:00
|
|
|
@@ -17,6 +17,8 @@ using mozilla::LogLevel;
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
static mozilla::LazyLogModule sIdleLog("nsIUserIdleService");
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
+#ifdef MOZ_X11
|
2022-03-06 12:10:08 +00:00
|
|
|
+
|
2021-07-08 15:32:23 +00:00
|
|
|
typedef bool (*_XScreenSaverQueryExtension_fn)(Display* dpy, int* event_base,
|
|
|
|
int* error_base);
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2022-03-06 12:10:08 +00:00
|
|
|
@@ -25,16 +27,20 @@ typedef XScreenSaverInfo* (*_XScreenSaverAllocInfo_fn)(void);
|
2021-07-08 15:32:23 +00:00
|
|
|
typedef void (*_XScreenSaverQueryInfo_fn)(Display* dpy, Drawable drw,
|
|
|
|
XScreenSaverInfo* info);
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
-static bool sInitialized = false;
|
|
|
|
static _XScreenSaverQueryExtension_fn _XSSQueryExtension = nullptr;
|
|
|
|
static _XScreenSaverAllocInfo_fn _XSSAllocInfo = nullptr;
|
|
|
|
static _XScreenSaverQueryInfo_fn _XSSQueryInfo = nullptr;
|
2022-03-06 12:10:08 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
+#endif
|
2022-03-06 12:10:08 +00:00
|
|
|
+
|
2021-07-08 15:32:23 +00:00
|
|
|
+static bool sInitialized = false;
|
2022-03-06 12:10:08 +00:00
|
|
|
+
|
2021-07-08 15:32:23 +00:00
|
|
|
static void Initialize() {
|
|
|
|
if (!mozilla::widget::GdkIsX11Display()) {
|
|
|
|
return;
|
|
|
|
}
|
2022-03-06 12:10:08 +00:00
|
|
|
|
|
|
|
+#ifdef MOZ_X11
|
|
|
|
// This will leak - See comments in ~nsUserIdleServiceGTK().
|
|
|
|
PRLibrary* xsslib = PR_LoadLibrary("libXss.so.1");
|
|
|
|
if (!xsslib) // ouch.
|
|
|
|
@@ -59,14 +65,15 @@ static void Initialize() {
|
2021-07-08 15:32:23 +00:00
|
|
|
MOZ_LOG(sIdleLog, LogLevel::Warning, ("Failed to get XSSQueryInfo!\n"));
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
sInitialized = true;
|
2022-03-06 12:10:08 +00:00
|
|
|
+#endif
|
2021-07-08 15:32:23 +00:00
|
|
|
}
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
-nsUserIdleServiceGTK::nsUserIdleServiceGTK() : mXssInfo(nullptr) {
|
2022-03-06 12:10:08 +00:00
|
|
|
- Initialize();
|
|
|
|
-}
|
|
|
|
+nsUserIdleServiceGTK::nsUserIdleServiceGTK() { Initialize(); }
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
nsUserIdleServiceGTK::~nsUserIdleServiceGTK() {
|
|
|
|
+#ifdef MOZ_X11
|
|
|
|
if (mXssInfo) XFree(mXssInfo);
|
|
|
|
+#endif
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
// It is not safe to unload libXScrnSaver until each display is closed because
|
|
|
|
// the library registers callbacks through XESetCloseDisplay (Bug 397607).
|
2022-03-06 12:10:08 +00:00
|
|
|
@@ -84,6 +91,7 @@ bool nsUserIdleServiceGTK::PollIdleTime(uint32_t* aIdleTime) {
|
|
|
|
// For some reason, we could not find xscreensaver.
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
+#ifdef MOZ_X11
|
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
// Ask xscreensaver about idle time:
|
|
|
|
*aIdleTime = 0;
|
2022-03-06 12:10:08 +00:00
|
|
|
@@ -109,6 +117,7 @@ bool nsUserIdleServiceGTK::PollIdleTime(uint32_t* aIdleTime) {
|
2021-07-08 15:32:23 +00:00
|
|
|
}
|
|
|
|
// If we get here, we couldn't get to XScreenSaver:
|
|
|
|
MOZ_LOG(sIdleLog, LogLevel::Warning, ("XSSQueryExtension returned false!\n"));
|
2022-03-06 12:10:08 +00:00
|
|
|
+#endif
|
2021-07-08 15:32:23 +00:00
|
|
|
return false;
|
2022-03-06 12:10:08 +00:00
|
|
|
}
|
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
diff --git a/widget/gtk/nsUserIdleServiceGTK.h b/widget/gtk/nsUserIdleServiceGTK.h
|
2022-03-06 12:10:08 +00:00
|
|
|
index 9b9ba31846..f089f3b87d 100644
|
2021-07-08 15:32:23 +00:00
|
|
|
--- a/widget/gtk/nsUserIdleServiceGTK.h
|
|
|
|
+++ b/widget/gtk/nsUserIdleServiceGTK.h
|
2022-03-06 12:10:08 +00:00
|
|
|
@@ -9,9 +9,11 @@
|
2021-07-08 15:32:23 +00:00
|
|
|
#define nsUserIdleServiceGTK_h__
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
#include "nsUserIdleService.h"
|
2022-03-06 12:10:08 +00:00
|
|
|
-#include <X11/Xlib.h>
|
|
|
|
-#include <X11/Xutil.h>
|
|
|
|
-#include <gdk/gdkx.h>
|
|
|
|
+
|
2021-07-08 15:32:23 +00:00
|
|
|
+#ifdef MOZ_X11
|
2022-03-06 12:10:08 +00:00
|
|
|
+# include <X11/Xlib.h>
|
|
|
|
+# include <X11/Xutil.h>
|
|
|
|
+# include <gdk/gdkx.h>
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
Window window; // Screen saver window
|
|
|
|
@@ -21,6 +23,7 @@ typedef struct {
|
2021-07-08 15:32:23 +00:00
|
|
|
unsigned long idle; // milliseconds idle
|
|
|
|
unsigned long event_mask; // event stuff
|
|
|
|
} XScreenSaverInfo;
|
|
|
|
+#endif
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
class nsUserIdleServiceGTK : public nsUserIdleService {
|
|
|
|
public:
|
2022-03-06 12:10:08 +00:00
|
|
|
@@ -40,7 +43,9 @@ class nsUserIdleServiceGTK : public nsUserIdleService {
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
private:
|
|
|
|
~nsUserIdleServiceGTK();
|
2022-03-06 12:10:08 +00:00
|
|
|
- XScreenSaverInfo* mXssInfo;
|
2021-07-08 15:32:23 +00:00
|
|
|
+#ifdef MOZ_X11
|
2022-03-06 12:10:08 +00:00
|
|
|
+ XScreenSaverInfo* mXssInfo = nullptr;
|
2021-07-08 15:32:23 +00:00
|
|
|
+#endif
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
protected:
|
|
|
|
nsUserIdleServiceGTK();
|
|
|
|
diff --git a/widget/gtk/nsWidgetFactory.cpp b/widget/gtk/nsWidgetFactory.cpp
|
2021-07-13 20:43:56 +00:00
|
|
|
index d649c7e0bf..70b47d5124 100644
|
2021-07-08 15:32:23 +00:00
|
|
|
--- a/widget/gtk/nsWidgetFactory.cpp
|
|
|
|
+++ b/widget/gtk/nsWidgetFactory.cpp
|
|
|
|
@@ -20,9 +20,7 @@
|
|
|
|
#include "nsHTMLFormatConverter.h"
|
|
|
|
#include "HeadlessClipboard.h"
|
|
|
|
#include "IMContextWrapper.h"
|
|
|
|
-#ifdef MOZ_X11
|
|
|
|
-# include "nsClipboard.h"
|
|
|
|
-#endif
|
|
|
|
+#include "nsClipboard.h"
|
|
|
|
#include "TaskbarProgress.h"
|
|
|
|
#include "nsFilePicker.h"
|
|
|
|
#include "nsSound.h"
|
|
|
|
@@ -36,7 +34,6 @@
|
|
|
|
using namespace mozilla;
|
|
|
|
using namespace mozilla::widget;
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
-#ifdef MOZ_X11
|
|
|
|
NS_IMPL_COMPONENT_FACTORY(nsIClipboard) {
|
|
|
|
nsCOMPtr<nsIClipboard> inst;
|
|
|
|
if (gfxPlatform::IsHeadless()) {
|
|
|
|
@@ -51,7 +48,6 @@ NS_IMPL_COMPONENT_FACTORY(nsIClipboard) {
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
return inst.forget().downcast<nsISupports>();
|
|
|
|
}
|
|
|
|
-#endif
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
nsresult nsWidgetGtk2ModuleCtor() { return nsAppShellInit(); }
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp
|
2022-03-06 12:10:08 +00:00
|
|
|
index 59e01f0fea..12bdda1cd4 100644
|
2021-07-08 15:32:23 +00:00
|
|
|
--- a/widget/gtk/nsWindow.cpp
|
|
|
|
+++ b/widget/gtk/nsWindow.cpp
|
2021-10-05 08:30:33 +00:00
|
|
|
@@ -58,7 +58,6 @@
|
2021-07-08 15:32:23 +00:00
|
|
|
#include "mozilla/UniquePtrExtensions.h"
|
|
|
|
#include "mozilla/WidgetUtils.h"
|
|
|
|
#include "mozilla/WritingModes.h"
|
|
|
|
-#include "mozilla/X11Util.h"
|
|
|
|
#include "mozilla/XREAppData.h"
|
2021-07-13 20:43:56 +00:00
|
|
|
#include "NativeKeyBindings.h"
|
|
|
|
#include "nsAppDirectoryServiceDefs.h"
|
2021-10-05 08:30:33 +00:00
|
|
|
@@ -90,7 +89,6 @@
|
2021-07-13 20:43:56 +00:00
|
|
|
#include "ScreenHelperGTK.h"
|
|
|
|
#include "SystemTimeConverter.h"
|
2021-07-08 15:32:23 +00:00
|
|
|
#include "WidgetUtilsGtk.h"
|
2021-07-13 20:43:56 +00:00
|
|
|
-#include "mozilla/X11Util.h"
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-13 20:43:56 +00:00
|
|
|
#ifdef ACCESSIBILITY
|
|
|
|
# include "mozilla/a11y/LocalAccessible.h"
|
2022-03-06 12:10:08 +00:00
|
|
|
@@ -108,6 +106,9 @@
|
|
|
|
# include "GLContextEGL.h" // for GLContextEGL::FindVisual()
|
2021-07-08 15:32:23 +00:00
|
|
|
# include "WindowSurfaceX11Image.h"
|
|
|
|
# include "WindowSurfaceX11SHM.h"
|
2022-03-06 12:10:08 +00:00
|
|
|
+# include "mozilla/X11Util.h"
|
|
|
|
+using mozilla::gl::GLContextEGL;
|
|
|
|
+using mozilla::gl::GLContextGLX;
|
2021-07-13 20:43:56 +00:00
|
|
|
#endif
|
|
|
|
#ifdef MOZ_WAYLAND
|
|
|
|
# include "nsIClipboard.h"
|
2022-03-06 12:10:08 +00:00
|
|
|
@@ -118,8 +119,6 @@ using namespace mozilla;
|
|
|
|
using namespace mozilla::gfx;
|
2021-07-08 15:32:23 +00:00
|
|
|
using namespace mozilla::layers;
|
2021-07-13 20:43:56 +00:00
|
|
|
using namespace mozilla::widget;
|
2022-03-06 12:10:08 +00:00
|
|
|
-using mozilla::gl::GLContextEGL;
|
|
|
|
-using mozilla::gl::GLContextGLX;
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
// Don't put more than this many rects in the dirty region, just fluff
|
|
|
|
// out to the bounding-box if there are more
|
2022-03-06 12:10:08 +00:00
|
|
|
@@ -267,15 +266,18 @@ static nsresult initialize_prefs(void);
|
|
|
|
static guint32 sLastUserInputTime = GDK_CURRENT_TIME;
|
|
|
|
static guint32 sRetryGrabTime;
|
|
|
|
|
|
|
|
+#ifdef MOZ_X11
|
|
|
|
static SystemTimeConverter<guint32>& TimeConverter() {
|
|
|
|
static SystemTimeConverter<guint32> sTimeConverterSingleton;
|
|
|
|
return sTimeConverterSingleton;
|
|
|
|
}
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
bool nsWindow::sTransparentMainWindow = false;
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
namespace mozilla {
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
+#ifdef MOZ_X11
|
|
|
|
class CurrentX11TimeGetter {
|
|
|
|
public:
|
|
|
|
explicit CurrentX11TimeGetter(GdkWindow* aWindow)
|
2022-03-06 12:10:08 +00:00
|
|
|
@@ -323,6 +325,7 @@ class CurrentX11TimeGetter {
|
2021-07-08 15:32:23 +00:00
|
|
|
GdkWindow* mWindow;
|
|
|
|
TimeStamp mAsyncUpdateStart;
|
|
|
|
};
|
|
|
|
+#endif
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
} // namespace mozilla
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2022-03-06 12:10:08 +00:00
|
|
|
@@ -2510,6 +2513,7 @@ void nsWindow::SetSizeMode(nsSizeMode aMode) {
|
|
|
|
mSizeState = mSizeMode;
|
|
|
|
}
|
|
|
|
|
2021-11-04 06:49:47 +00:00
|
|
|
+#ifdef MOZ_X11
|
2022-03-06 12:10:08 +00:00
|
|
|
static bool GetWindowManagerName(GdkWindow* gdk_window, nsACString& wmName) {
|
|
|
|
if (!GdkIsX11Display()) {
|
2021-11-04 06:49:47 +00:00
|
|
|
return false;
|
2022-03-06 12:10:08 +00:00
|
|
|
@@ -2579,10 +2583,12 @@ static bool GetWindowManagerName(GdkWindow* gdk_window, nsACString& wmName) {
|
|
|
|
wmName = reinterpret_cast<const char*>(prop_return);
|
2021-11-04 06:49:47 +00:00
|
|
|
return true;
|
|
|
|
}
|
2021-10-05 08:30:33 +00:00
|
|
|
+#endif
|
|
|
|
|
2022-03-06 12:10:08 +00:00
|
|
|
#define kDesktopMutterSchema "org.gnome.mutter"
|
|
|
|
#define kDesktopDynamicWorkspacesKey "dynamic-workspaces"
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
+#ifdef MOZ_X11
|
2022-03-06 12:10:08 +00:00
|
|
|
static bool WorkspaceManagementDisabled(GdkWindow* gdk_window) {
|
|
|
|
if (Preferences::GetBool("widget.disable-workspace-management", false)) {
|
|
|
|
return true;
|
|
|
|
@@ -2627,8 +2633,10 @@ static bool WorkspaceManagementDisabled(GdkWindow* gdk_window) {
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2022-03-06 12:10:08 +00:00
|
|
|
return false;
|
2021-07-08 15:32:23 +00:00
|
|
|
}
|
2022-03-06 12:10:08 +00:00
|
|
|
+#endif
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2022-03-06 12:10:08 +00:00
|
|
|
void nsWindow::GetWorkspaceID(nsAString& workspaceID) {
|
2021-07-08 15:32:23 +00:00
|
|
|
+#ifdef MOZ_X11
|
2022-03-06 12:10:08 +00:00
|
|
|
workspaceID.Truncate();
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2022-03-06 12:10:08 +00:00
|
|
|
if (!GdkIsX11Display() || !mShell) {
|
|
|
|
@@ -2669,9 +2677,11 @@ void nsWindow::GetWorkspaceID(nsAString& workspaceID) {
|
|
|
|
LOG(" got workspace ID %d", (int32_t)wm_desktop[0]);
|
2021-07-08 15:32:23 +00:00
|
|
|
workspaceID.AppendInt((int32_t)wm_desktop[0]);
|
|
|
|
g_free(wm_desktop);
|
|
|
|
+#endif
|
|
|
|
}
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
void nsWindow::MoveToWorkspace(const nsAString& workspaceIDStr) {
|
|
|
|
+#ifdef MOZ_X11
|
2021-10-05 08:30:33 +00:00
|
|
|
nsresult rv = NS_OK;
|
|
|
|
int32_t workspaceID = workspaceIDStr.ToInteger(&rv);
|
2022-03-06 12:10:08 +00:00
|
|
|
|
|
|
|
@@ -2716,6 +2726,7 @@ void nsWindow::MoveToWorkspace(const nsAString& workspaceIDStr) {
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
XFlush(xdisplay);
|
2022-03-06 12:10:08 +00:00
|
|
|
LOG(" moved to workspace");
|
2021-07-08 15:32:23 +00:00
|
|
|
+#endif
|
|
|
|
}
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-13 20:43:56 +00:00
|
|
|
using SetUserTimeFunc = void (*)(GdkWindow*, guint32);
|
2022-03-06 12:10:08 +00:00
|
|
|
@@ -2755,10 +2766,7 @@ guint32 nsWindow::GetLastUserInputTime() {
|
|
|
|
// WM_DELETE_WINDOW delete events, but not usually mouse motion nor
|
2021-07-08 15:32:23 +00:00
|
|
|
// button and key releases. Therefore use the most recent of
|
|
|
|
// gdk_x11_display_get_user_time and the last time that we have seen.
|
2022-03-06 12:10:08 +00:00
|
|
|
- GdkDisplay* gdkDisplay = gdk_display_get_default();
|
|
|
|
- guint32 timestamp = GdkIsX11Display(gdkDisplay)
|
|
|
|
- ? gdk_x11_display_get_user_time(gdkDisplay)
|
|
|
|
- : gtk_get_current_event_time();
|
2021-07-08 15:32:23 +00:00
|
|
|
+ guint32 timestamp = gtk_get_current_event_time();
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
if (sLastUserInputTime != GDK_CURRENT_TIME &&
|
|
|
|
TimestampIsNewerThan(sLastUserInputTime, timestamp)) {
|
2022-03-06 12:10:08 +00:00
|
|
|
@@ -3013,6 +3021,7 @@ void nsWindow::UpdateClientOffsetFromFrameExtents() {
|
2021-07-08 15:32:23 +00:00
|
|
|
return;
|
|
|
|
}
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
+#ifdef MOZ_X11
|
|
|
|
GdkAtom cardinal_atom = gdk_x11_xatom_to_atom(XA_CARDINAL);
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
GdkAtom type_returned;
|
2022-03-06 12:10:08 +00:00
|
|
|
@@ -3038,6 +3047,7 @@ void nsWindow::UpdateClientOffsetFromFrameExtents() {
|
2021-10-05 08:30:33 +00:00
|
|
|
|
|
|
|
mClientOffset = nsIntPoint(left, top);
|
|
|
|
}
|
2021-07-08 15:32:23 +00:00
|
|
|
+#endif
|
2021-10-05 08:30:33 +00:00
|
|
|
|
|
|
|
// Send a WindowMoved notification. This ensures that BrowserParent
|
|
|
|
// picks up the new client offset and sends it to the child process
|
2022-03-06 12:10:08 +00:00
|
|
|
@@ -3063,9 +3073,11 @@ gboolean nsWindow::OnPropertyNotifyEvent(GtkWidget* aWidget,
|
|
|
|
if (!mGdkWindow) {
|
2021-07-08 15:32:23 +00:00
|
|
|
return FALSE;
|
2022-03-06 12:10:08 +00:00
|
|
|
}
|
|
|
|
+#ifdef MOZ_X11
|
|
|
|
if (GetCurrentTimeGetter()->PropertyNotifyHandler(aWidget, aEvent)) {
|
2021-07-08 15:32:23 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
+#endif
|
|
|
|
return FALSE;
|
|
|
|
}
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2022-03-06 12:10:08 +00:00
|
|
|
@@ -3203,9 +3215,11 @@ void* nsWindow::GetNativeData(uint32_t aDataType) {
|
2021-07-13 20:43:56 +00:00
|
|
|
return GetToplevelWidget();
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
case NS_NATIVE_WINDOW_WEBRTC_DEVICE_ID:
|
2021-07-13 20:43:56 +00:00
|
|
|
+#ifdef MOZ_X11
|
|
|
|
if (GdkIsX11Display()) {
|
2021-07-08 15:32:23 +00:00
|
|
|
return (void*)GDK_WINDOW_XID(gdk_window_get_toplevel(mGdkWindow));
|
|
|
|
}
|
|
|
|
+#endif
|
|
|
|
NS_WARNING(
|
2021-07-13 20:43:56 +00:00
|
|
|
"nsWindow::GetNativeData(): NS_NATIVE_WINDOW_WEBRTC_DEVICE_ID is not "
|
|
|
|
"handled on Wayland!");
|
2022-03-06 12:10:08 +00:00
|
|
|
@@ -3226,11 +3240,13 @@ void* nsWindow::GetNativeData(uint32_t aDataType) {
|
2021-07-08 15:32:23 +00:00
|
|
|
return nullptr;
|
|
|
|
case NS_NATIVE_EGL_WINDOW: {
|
2022-03-06 12:10:08 +00:00
|
|
|
void* eglWindow = nullptr;
|
2021-07-08 15:32:23 +00:00
|
|
|
+#ifdef MOZ_X11
|
2021-07-13 20:43:56 +00:00
|
|
|
if (GdkIsX11Display()) {
|
2022-03-06 12:10:08 +00:00
|
|
|
eglWindow = mGdkWindow ? (void*)GDK_WINDOW_XID(mGdkWindow) : nullptr;
|
2021-07-08 15:32:23 +00:00
|
|
|
}
|
2021-07-13 20:43:56 +00:00
|
|
|
+#endif
|
2021-07-08 15:32:23 +00:00
|
|
|
#ifdef MOZ_WAYLAND
|
2022-03-06 12:10:08 +00:00
|
|
|
- else {
|
|
|
|
+ if (GdkIsWaylandDisplay()) {
|
|
|
|
eglWindow = moz_container_wayland_get_egl_window(
|
|
|
|
mContainer, FractionalScaleFactor());
|
|
|
|
}
|
|
|
|
@@ -3520,8 +3536,6 @@ gboolean nsWindow::OnExposeEvent(cairo_t* cr) {
|
|
|
|
nsIWidgetListener* listener = GetListener();
|
2021-07-08 15:32:23 +00:00
|
|
|
if (!listener) return FALSE;
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2022-03-06 12:10:08 +00:00
|
|
|
- LOG("received expose event %p 0x%lx (rects follow):\n", mGdkWindow,
|
|
|
|
- GdkIsX11Display() ? gdk_x11_window_get_xid(mGdkWindow) : 0);
|
2021-07-08 15:32:23 +00:00
|
|
|
LayoutDeviceIntRegion exposeRegion;
|
|
|
|
if (!ExtractExposeRegion(exposeRegion, cr)) {
|
|
|
|
return FALSE;
|
2022-03-06 12:10:08 +00:00
|
|
|
@@ -4068,6 +4082,7 @@ void nsWindow::OnMotionNotifyEvent(GdkEventMotion* aEvent) {
|
2021-07-08 15:32:23 +00:00
|
|
|
MOZ_ASSERT(gdk_window, "gdk_window_get_toplevel should not return null");
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
bool canDrag = true;
|
|
|
|
+#ifdef MOZ_X11
|
2021-07-13 20:43:56 +00:00
|
|
|
if (GdkIsX11Display()) {
|
2021-07-08 15:32:23 +00:00
|
|
|
// Workaround for https://bugzilla.gnome.org/show_bug.cgi?id=789054
|
|
|
|
// To avoid crashes disable double-click on WM without _NET_WM_MOVERESIZE.
|
2022-03-06 12:10:08 +00:00
|
|
|
@@ -4078,6 +4093,7 @@ void nsWindow::OnMotionNotifyEvent(GdkEventMotion* aEvent) {
|
2021-07-08 15:32:23 +00:00
|
|
|
canDrag = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
+#endif
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
if (canDrag) {
|
|
|
|
gdk_window_begin_move_drag(gdk_window, 1, aEvent->x_root, aEvent->y_root,
|
2022-03-06 12:10:08 +00:00
|
|
|
@@ -4519,6 +4535,7 @@ TimeStamp nsWindow::GetEventTimeStamp(guint32 aEventTime) {
|
|
|
|
|
|
|
|
TimeStamp eventTimeStamp;
|
|
|
|
|
|
|
|
+#ifdef MOZ_WAYLAND
|
|
|
|
if (GdkIsWaylandDisplay()) {
|
|
|
|
// Wayland compositors use monotonic time to set timestamps.
|
|
|
|
int64_t timestampTime = g_get_monotonic_time() / 1000;
|
|
|
|
@@ -4528,16 +4545,21 @@ TimeStamp nsWindow::GetEventTimeStamp(guint32 aEventTime) {
|
2021-07-08 15:32:23 +00:00
|
|
|
int64_t tick =
|
|
|
|
BaseTimeDurationPlatformUtils::TicksFromMilliseconds(timestampTime);
|
|
|
|
eventTimeStamp = TimeStamp::FromSystemTime(tick);
|
|
|
|
- } else {
|
2022-03-06 12:10:08 +00:00
|
|
|
+ }
|
|
|
|
+#endif
|
2021-07-08 15:32:23 +00:00
|
|
|
+#ifdef MOZ_X11
|
2022-03-06 12:10:08 +00:00
|
|
|
+ if (GdkIsX11Display()) {
|
2021-07-08 15:32:23 +00:00
|
|
|
CurrentX11TimeGetter* getCurrentTime = GetCurrentTimeGetter();
|
|
|
|
MOZ_ASSERT(getCurrentTime,
|
|
|
|
"Null current time getter despite having a window");
|
|
|
|
eventTimeStamp =
|
|
|
|
TimeConverter().GetTimeStampFromSystemTime(aEventTime, *getCurrentTime);
|
|
|
|
}
|
|
|
|
+#endif
|
|
|
|
return eventTimeStamp;
|
|
|
|
}
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
+#ifdef MOZ_X11
|
|
|
|
mozilla::CurrentX11TimeGetter* nsWindow::GetCurrentTimeGetter() {
|
|
|
|
MOZ_ASSERT(mGdkWindow, "Expected mGdkWindow to be set");
|
|
|
|
if (MOZ_UNLIKELY(!mCurrentTimeGetter)) {
|
2022-03-06 12:10:08 +00:00
|
|
|
@@ -4545,6 +4567,7 @@ mozilla::CurrentX11TimeGetter* nsWindow::GetCurrentTimeGetter() {
|
2021-07-08 15:32:23 +00:00
|
|
|
}
|
|
|
|
return mCurrentTimeGetter.get();
|
|
|
|
}
|
|
|
|
+#endif
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
gboolean nsWindow::OnKeyPressEvent(GdkEventKey* aEvent) {
|
2022-03-06 12:10:08 +00:00
|
|
|
LOG("OnKeyPressEvent");
|
|
|
|
@@ -5210,8 +5233,8 @@ void nsWindow::EnableRenderingToWindow() {
|
|
|
|
GetShapedState());
|
|
|
|
}
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2022-03-06 12:10:08 +00:00
|
|
|
- if (GdkIsWaylandDisplay()) {
|
|
|
|
#ifdef MOZ_WAYLAND
|
|
|
|
+ if (GdkIsWaylandDisplay()) {
|
|
|
|
moz_container_wayland_add_initial_draw_callback(
|
|
|
|
mContainer, [self = RefPtr{this}, this]() -> void {
|
|
|
|
LOG("moz_container_wayland initial create "
|
|
|
|
@@ -5219,11 +5242,15 @@ void nsWindow::EnableRenderingToWindow() {
|
|
|
|
self->ResumeCompositorHiddenWindow();
|
|
|
|
self->WaylandStartVsync();
|
|
|
|
});
|
|
|
|
+ }
|
|
|
|
#endif
|
|
|
|
- } else {
|
|
|
|
+
|
2021-07-08 15:32:23 +00:00
|
|
|
+#ifdef MOZ_X11
|
2022-03-06 12:10:08 +00:00
|
|
|
+ if (GdkIsX11Display()) {
|
|
|
|
ResumeCompositorHiddenWindow();
|
|
|
|
WaylandStartVsync();
|
|
|
|
}
|
|
|
|
+#endif
|
|
|
|
}
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2022-03-06 12:10:08 +00:00
|
|
|
void nsWindow::DisableRenderingToWindow() {
|
|
|
|
@@ -5236,9 +5263,12 @@ void nsWindow::DisableRenderingToWindow() {
|
|
|
|
}
|
2021-07-08 15:32:23 +00:00
|
|
|
}
|
2022-03-06 12:10:08 +00:00
|
|
|
|
|
|
|
-Window nsWindow::GetX11Window() {
|
|
|
|
- return GdkIsX11Display() && mGdkWindow ? gdk_x11_window_get_xid(mGdkWindow)
|
|
|
|
- : X11None;
|
|
|
|
+uintptr_t nsWindow::GetX11Window() {
|
|
|
|
+#ifdef MOZ_X11
|
|
|
|
+ return (uintptr_t)(GdkIsX11Display() && mGdkWindow ? gdk_x11_window_get_xid(mGdkWindow) : X11None);
|
|
|
|
+#else
|
|
|
|
+ return (uintptr_t) nullptr;
|
2021-07-08 15:32:23 +00:00
|
|
|
+#endif
|
2022-03-06 12:10:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void nsWindow::EnsureGdkWindow() {
|
|
|
|
@@ -5324,9 +5354,6 @@ void nsWindow::ConfigureGdkWindow() {
|
|
|
|
if (mHasMappedToplevel) {
|
|
|
|
EnsureGrabs();
|
|
|
|
}
|
|
|
|
-
|
|
|
|
- LOG(" finished, new GdkWindow %p XID 0x%lx\n", mGdkWindow,
|
|
|
|
- GdkIsX11Display() ? gdk_x11_window_get_xid(mGdkWindow) : 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
void nsWindow::ReleaseGdkWindow() {
|
|
|
|
@@ -5343,11 +5370,18 @@ void nsWindow::ReleaseGdkWindow() {
|
|
|
|
mSurfaceProvider.CleanupResources();
|
|
|
|
}
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2022-03-06 12:10:08 +00:00
|
|
|
+extern "C" {
|
|
|
|
+// Make sure mozgtk gets linked
|
|
|
|
+MOZ_EXPORT void PleaseLinkWithMe();
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
nsresult nsWindow::Create(nsIWidget* aParent, nsNativeWidget aNativeParent,
|
|
|
|
const LayoutDeviceIntRect& aRect,
|
|
|
|
nsWidgetInitData* aInitData) {
|
|
|
|
LOG("nsWindow::Create\n");
|
|
|
|
|
|
|
|
+ PleaseLinkWithMe();
|
|
|
|
+
|
|
|
|
// only set the base parent if we're going to be a dialog or a
|
|
|
|
// toplevel
|
|
|
|
nsIWidget* baseParent =
|
|
|
|
@@ -5865,10 +5899,6 @@ nsresult nsWindow::Create(nsIWidget* aParent, nsNativeWidget aNativeParent,
|
|
|
|
nullptr);
|
|
|
|
|
|
|
|
LOG(" nsWindow type %d %s\n", mWindowType, mIsPIPWindow ? "PIP window" : "");
|
|
|
|
- LOG(" mShell %p mContainer %p mGdkWindow %p XID 0x%lx\n", mShell, mContainer,
|
|
|
|
- mGdkWindow,
|
|
|
|
- (GdkIsX11Display() && mGdkWindow) ? gdk_x11_window_get_xid(mGdkWindow)
|
|
|
|
- : 0);
|
|
|
|
|
|
|
|
// Set default application name when it's empty.
|
|
|
|
if (mGtkWindowAppName.IsEmpty()) {
|
|
|
|
@@ -6720,6 +6750,7 @@ void nsWindow::UpdateTitlebarTransparencyBitmap() {
|
2021-07-08 15:32:23 +00:00
|
|
|
cairo_surface_destroy(surface);
|
|
|
|
}
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
+#ifdef MOZ_X11
|
|
|
|
if (!mNeedsShow) {
|
|
|
|
Display* xDisplay = GDK_WINDOW_XDISPLAY(mGdkWindow);
|
|
|
|
Window xDrawable = GDK_WINDOW_XID(mGdkWindow);
|
2022-03-06 12:10:08 +00:00
|
|
|
@@ -6740,6 +6771,7 @@ void nsWindow::UpdateTitlebarTransparencyBitmap() {
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
XFreePixmap(xDisplay, maskPixmap);
|
|
|
|
}
|
|
|
|
+#endif
|
|
|
|
}
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
void nsWindow::GrabPointer(guint32 aTime) {
|
2022-03-06 12:10:08 +00:00
|
|
|
@@ -7013,7 +7045,7 @@ static bool IsFullscreenSupported(GtkWidget* aShell) {
|
2021-07-13 20:43:56 +00:00
|
|
|
GdkScreen* screen = gtk_widget_get_screen(aShell);
|
|
|
|
GdkAtom atom = gdk_atom_intern("_NET_WM_STATE_FULLSCREEN", FALSE);
|
|
|
|
return gdk_x11_screen_supports_net_wm_hint(screen, atom);
|
|
|
|
-#elif
|
|
|
|
+#else
|
|
|
|
return true;
|
|
|
|
#endif
|
|
|
|
}
|
2022-03-06 12:10:08 +00:00
|
|
|
@@ -8297,6 +8329,7 @@ bool nsWindow::GetDragInfo(WidgetMouseEvent* aMouseEvent, GdkWindow** aWindow,
|
2021-07-08 15:32:23 +00:00
|
|
|
return false;
|
|
|
|
}
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
+#ifdef MOZ_X11
|
2021-07-13 20:43:56 +00:00
|
|
|
if (GdkIsX11Display()) {
|
2021-07-08 15:32:23 +00:00
|
|
|
// Workaround for https://bugzilla.gnome.org/show_bug.cgi?id=789054
|
|
|
|
// To avoid crashes disable double-click on WM without _NET_WM_MOVERESIZE.
|
2022-03-06 12:10:08 +00:00
|
|
|
@@ -8312,6 +8345,7 @@ bool nsWindow::GetDragInfo(WidgetMouseEvent* aMouseEvent, GdkWindow** aWindow,
|
2021-07-08 15:32:23 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
+#endif
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
// FIXME: It would be nice to have the widget position at the time
|
|
|
|
// of the event, but it's relatively unlikely that the widget has
|
|
|
|
diff --git a/widget/gtk/nsWindow.h b/widget/gtk/nsWindow.h
|
2022-03-06 12:10:08 +00:00
|
|
|
index 9baa034477..cfd4a6c178 100644
|
2021-07-08 15:32:23 +00:00
|
|
|
--- a/widget/gtk/nsWindow.h
|
|
|
|
+++ b/widget/gtk/nsWindow.h
|
2022-03-06 12:10:08 +00:00
|
|
|
@@ -98,7 +98,9 @@ typedef struct _GdkEventTouchpadPinch GdkEventTouchpadPinch;
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
namespace mozilla {
|
|
|
|
class TimeStamp;
|
|
|
|
+#ifdef MOZ_X11
|
|
|
|
class CurrentX11TimeGetter;
|
|
|
|
+#endif
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
} // namespace mozilla
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2022-03-06 12:10:08 +00:00
|
|
|
@@ -278,7 +280,9 @@ class nsWindow final : public nsBaseWidget {
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
WidgetEventTime GetWidgetEventTime(guint32 aEventTime);
|
|
|
|
mozilla::TimeStamp GetEventTimeStamp(guint32 aEventTime);
|
2021-10-05 08:30:33 +00:00
|
|
|
+#ifdef MOZ_X11
|
2021-07-08 15:32:23 +00:00
|
|
|
mozilla::CurrentX11TimeGetter* GetCurrentTimeGetter();
|
|
|
|
+#endif
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2022-03-06 12:10:08 +00:00
|
|
|
void SetInputContext(const InputContext& aContext,
|
|
|
|
const InputContextAction& aAction) override;
|
|
|
|
@@ -473,7 +477,7 @@ class nsWindow final : public nsBaseWidget {
|
|
|
|
void DestroyChildWindows();
|
|
|
|
GtkWidget* GetToplevelWidget();
|
|
|
|
nsWindow* GetContainerWindow();
|
|
|
|
- Window GetX11Window();
|
|
|
|
+ uintptr_t GetX11Window();
|
|
|
|
bool GetShapedState();
|
|
|
|
void EnsureGdkWindow();
|
|
|
|
void SetUrgencyHint(GtkWidget* top_window, bool state);
|
|
|
|
@@ -835,7 +839,9 @@ class nsWindow final : public nsBaseWidget {
|
2021-07-08 15:32:23 +00:00
|
|
|
*/
|
|
|
|
RefPtr<mozilla::widget::IMContextWrapper> mIMContext;
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
+#ifdef MOZ_X11
|
|
|
|
mozilla::UniquePtr<mozilla::CurrentX11TimeGetter> mCurrentTimeGetter;
|
|
|
|
+#endif
|
|
|
|
static GtkWindowDecoration sGtkWindowDecoration;
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-08 15:32:23 +00:00
|
|
|
static bool sTransparentMainWindow;
|
|
|
|
diff --git a/widget/moz.build b/widget/moz.build
|
2022-03-06 12:10:08 +00:00
|
|
|
index 9cef92614b..8ad6c12c26 100644
|
2021-07-08 15:32:23 +00:00
|
|
|
--- a/widget/moz.build
|
|
|
|
+++ b/widget/moz.build
|
2022-03-06 12:10:08 +00:00
|
|
|
@@ -271,9 +271,6 @@ if CONFIG["MOZ_INSTRUMENT_EVENT_LOOP"]:
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-13 20:43:56 +00:00
|
|
|
EXPORTS.ipc = ["nsGUIEventIPC.h"]
|
2021-10-05 08:30:33 +00:00
|
|
|
|
2021-07-13 20:43:56 +00:00
|
|
|
-if CONFIG["MOZ_X11"]:
|
2022-03-06 12:10:08 +00:00
|
|
|
- DIRS += ["x11"]
|
|
|
|
-
|
2021-07-08 15:32:23 +00:00
|
|
|
if toolkit in ("cocoa", "windows"):
|
2022-03-06 12:10:08 +00:00
|
|
|
UNIFIED_SOURCES += [
|
|
|
|
"nsBaseClipboard.cpp",
|
|
|
|
@@ -318,7 +315,7 @@ if toolkit == "windows":
|
2021-07-08 15:32:23 +00:00
|
|
|
"windows/PCompositorWidget.ipdl",
|
|
|
|
"windows/PlatformWidgetTypes.ipdlh",
|
|
|
|
]
|
|
|
|
-elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk" and CONFIG["MOZ_X11"]:
|
|
|
|
+elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
|
|
|
|
IPDL_SOURCES = [
|
|
|
|
"gtk/PCompositorWidget.ipdl",
|
|
|
|
"gtk/PlatformWidgetTypes.ipdlh",
|
2022-03-06 12:10:08 +00:00
|
|
|
diff --git a/widget/x11/moz.build b/widget/x11/moz.build
|
|
|
|
deleted file mode 100644
|
|
|
|
index 81d345c0af..0000000000
|
|
|
|
--- a/widget/x11/moz.build
|
|
|
|
+++ /dev/null
|
|
|
|
@@ -1,16 +0,0 @@
|
|
|
|
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
|
|
|
|
-# vim: set filetype=python:
|
|
|
|
-# This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
-# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
-
|
|
|
|
-with Files("**"):
|
|
|
|
- BUG_COMPONENT = ("Core", "Widget: Gtk")
|
|
|
|
-
|
|
|
|
-SOURCES += [
|
|
|
|
- "keysym2ucs.c",
|
|
|
|
-]
|
|
|
|
-
|
|
|
|
-FINAL_LIBRARY = "xul"
|
|
|
|
-
|
|
|
|
-CFLAGS += CONFIG["MOZ_X11_CFLAGS"]
|