everted IM patch
This commit is contained in:
parent
43f91b3884
commit
364db1a553
@ -178,7 +178,7 @@ ExcludeArch: i686
|
||||
Summary: Mozilla Firefox Web browser
|
||||
Name: firefox
|
||||
Version: 124.0.1
|
||||
Release: 1%{?pre_tag}%{?dist}
|
||||
Release: 2%{?pre_tag}%{?dist}
|
||||
URL: https://www.mozilla.org/firefox/
|
||||
License: MPLv1.1 or GPLv2+ or LGPLv2+
|
||||
Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz
|
||||
@ -254,6 +254,7 @@ Patch230: firefox-enable-vaapi.patch
|
||||
Patch231: fedora-customization.patch
|
||||
Patch241: 0025-Add-KDE-integration-to-Firefox-toolkit-parts.patch
|
||||
Patch242: 0026-Add-KDE-integration-to-Firefox.patch
|
||||
Patch243: im-patch.patch
|
||||
|
||||
# Upstream patches
|
||||
Patch402: mozilla-1196777.patch
|
||||
@ -555,9 +556,9 @@ This package contains results of tests executed during build.
|
||||
%patch229 -p1 -b .firefox-nss-addon-hack
|
||||
%patch230 -p1 -b .firefox-enable-vaapi
|
||||
%patch231 -p1 -b .fedora-customization
|
||||
|
||||
#%patch241 -p1 -b .kde-integration-toolkit
|
||||
#%patch242 -p1 -b .kde-integration
|
||||
%patch243 -p1 -b .im-patch
|
||||
|
||||
%patch402 -p1 -b .1196777
|
||||
%patch407 -p1 -b .1667096
|
||||
@ -1183,6 +1184,9 @@ fi
|
||||
#---------------------------------------------------------------------
|
||||
|
||||
%changelog
|
||||
* Mon Mar 25 2024 Martin Stransky <stransky@redhat.com>- 124.0-2
|
||||
- Reverted IM patch
|
||||
|
||||
* Wed Mar 13 2024 Martin Stransky <stransky@redhat.com>- 124.0-1
|
||||
- Updated to 124.0
|
||||
|
||||
|
122
im-patch.patch
Normal file
122
im-patch.patch
Normal file
@ -0,0 +1,122 @@
|
||||
diff -up firefox-124.0.1/widget/gtk/IMContextWrapper.cpp.im-patch firefox-124.0.1/widget/gtk/IMContextWrapper.cpp
|
||||
--- firefox-124.0.1/widget/gtk/IMContextWrapper.cpp.im-patch 2024-03-22 05:00:19.000000000 +0100
|
||||
+++ firefox-124.0.1/widget/gtk/IMContextWrapper.cpp 2024-03-25 21:39:58.961947576 +0100
|
||||
@@ -232,11 +232,18 @@ class SelectionStyleProvider final {
|
||||
sHasShutDown = true;
|
||||
}
|
||||
|
||||
- // mContainer associated with an IM context.
|
||||
- void AttachTo(MozContainer* aContainer) {
|
||||
- gtk_style_context_add_provider(
|
||||
- gtk_widget_get_style_context(GTK_WIDGET(aContainer)),
|
||||
- GTK_STYLE_PROVIDER(mProvider), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
|
||||
+ // aGDKWindow is a GTK window which will be associated with an IM context.
|
||||
+ void AttachTo(GdkWindow* aGDKWindow) {
|
||||
+ GtkWidget* widget = nullptr;
|
||||
+ // gdk_window_get_user_data() typically returns pointer to widget that
|
||||
+ // window belongs to. If it's widget, fcitx retrieves selection colors
|
||||
+ // of them. So, we need to overwrite its style.
|
||||
+ gdk_window_get_user_data(aGDKWindow, (gpointer*)&widget);
|
||||
+ if (GTK_IS_WIDGET(widget)) {
|
||||
+ gtk_style_context_add_provider(gtk_widget_get_style_context(widget),
|
||||
+ GTK_STYLE_PROVIDER(mProvider),
|
||||
+ GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
|
||||
+ }
|
||||
}
|
||||
|
||||
void OnThemeChanged() {
|
||||
@@ -410,17 +417,21 @@ nsDependentCSubstring IMContextWrapper::
|
||||
}
|
||||
|
||||
void IMContextWrapper::Init() {
|
||||
+ MozContainer* container = mOwnerWindow->GetMozContainer();
|
||||
+ MOZ_ASSERT(container, "container is null");
|
||||
+ GdkWindow* gdkWindow = gtk_widget_get_window(GTK_WIDGET(container));
|
||||
+
|
||||
// Overwrite selection colors of the window before associating the window
|
||||
// with IM context since IME may look up selection colors via IM context
|
||||
// to support any colored widgets.
|
||||
- SelectionStyleProvider::GetInstance()->AttachTo(
|
||||
- mOwnerWindow->GetMozContainer());
|
||||
+ SelectionStyleProvider::GetInstance()->AttachTo(gdkWindow);
|
||||
|
||||
// NOTE: gtk_im_*_new() abort (kill) the whole process when it fails.
|
||||
// So, we don't need to check the result.
|
||||
|
||||
// Normal context.
|
||||
mContext = gtk_im_multicontext_new();
|
||||
+ gtk_im_context_set_client_window(mContext, gdkWindow);
|
||||
g_signal_connect(mContext, "preedit_changed",
|
||||
G_CALLBACK(IMContextWrapper::OnChangeCompositionCallback),
|
||||
this);
|
||||
@@ -492,6 +503,7 @@ void IMContextWrapper::Init() {
|
||||
// Simple context
|
||||
if (sUseSimpleContext) {
|
||||
mSimpleContext = gtk_im_context_simple_new();
|
||||
+ gtk_im_context_set_client_window(mSimpleContext, gdkWindow);
|
||||
g_signal_connect(mSimpleContext, "preedit_changed",
|
||||
G_CALLBACK(&IMContextWrapper::OnChangeCompositionCallback),
|
||||
this);
|
||||
@@ -514,6 +526,7 @@ void IMContextWrapper::Init() {
|
||||
|
||||
// Dummy context
|
||||
mDummyContext = gtk_im_multicontext_new();
|
||||
+ gtk_im_context_set_client_window(mDummyContext, gdkWindow);
|
||||
|
||||
MOZ_LOG(gIMELog, LogLevel::Info,
|
||||
("0x%p Init(), mOwnerWindow=%p, mContext=%p (im=\"%s\"), "
|
||||
@@ -540,17 +553,6 @@ IMContextWrapper::~IMContextWrapper() {
|
||||
MOZ_LOG(gIMELog, LogLevel::Info, ("0x%p ~IMContextWrapper()", this));
|
||||
}
|
||||
|
||||
-void IMContextWrapper::SetGdkWindow(GdkWindow* aGdkWindow) {
|
||||
- MOZ_LOG(gIMELog, LogLevel::Info,
|
||||
- ("0x%p GdkWindowChanged(%p)", this, aGdkWindow));
|
||||
- MOZ_ASSERT(!aGdkWindow || mOwnerWindow->GetGdkWindow() == aGdkWindow);
|
||||
- gtk_im_context_set_client_window(mContext, aGdkWindow);
|
||||
- if (mSimpleContext) {
|
||||
- gtk_im_context_set_client_window(mSimpleContext, aGdkWindow);
|
||||
- }
|
||||
- gtk_im_context_set_client_window(mDummyContext, aGdkWindow);
|
||||
-}
|
||||
-
|
||||
NS_IMETHODIMP
|
||||
IMContextWrapper::NotifyIME(TextEventDispatcher* aTextEventDispatcher,
|
||||
const IMENotification& aNotification) {
|
||||
diff -up firefox-124.0.1/widget/gtk/IMContextWrapper.h.im-patch firefox-124.0.1/widget/gtk/IMContextWrapper.h
|
||||
--- firefox-124.0.1/widget/gtk/IMContextWrapper.h.im-patch 2024-03-22 05:00:19.000000000 +0100
|
||||
+++ firefox-124.0.1/widget/gtk/IMContextWrapper.h 2024-03-25 21:39:58.961947576 +0100
|
||||
@@ -117,10 +117,6 @@ class IMContextWrapper final : public Te
|
||||
void OnUpdateComposition();
|
||||
void OnLayoutChange();
|
||||
|
||||
- // Set GdkWindow associated with IM context.
|
||||
- // It can be null which disables context operations.
|
||||
- void SetGdkWindow(GdkWindow* aGdkWindow);
|
||||
-
|
||||
TextEventDispatcher* GetTextEventDispatcher();
|
||||
|
||||
// TODO: Typically, new IM comes every several years. And now, our code
|
||||
diff -up firefox-124.0.1/widget/gtk/nsWindow.cpp.im-patch firefox-124.0.1/widget/gtk/nsWindow.cpp
|
||||
--- firefox-124.0.1/widget/gtk/nsWindow.cpp.im-patch 2024-03-25 21:39:58.959947505 +0100
|
||||
+++ firefox-124.0.1/widget/gtk/nsWindow.cpp 2024-03-25 21:41:09.178439036 +0100
|
||||
@@ -5822,9 +5822,6 @@ void nsWindow::EnsureGdkWindow() {
|
||||
if (!mGdkWindow) {
|
||||
mGdkWindow = gtk_widget_get_window(GTK_WIDGET(mContainer));
|
||||
g_object_set_data(G_OBJECT(mGdkWindow), "nsWindow", this);
|
||||
- if (mIMContext) {
|
||||
- mIMContext->SetGdkWindow(mGdkWindow);
|
||||
- }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9933,9 +9930,6 @@ void nsWindow::DisableRendering() {
|
||||
LOG("nsWindow::DisableRendering()");
|
||||
|
||||
if (mGdkWindow) {
|
||||
- if (mIMContext) {
|
||||
- mIMContext->SetGdkWindow(nullptr);
|
||||
- }
|
||||
g_object_set_data(G_OBJECT(mGdkWindow), "nsWindow", nullptr);
|
||||
mGdkWindow = nullptr;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user