Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package fcitx5-gtk for openSUSE:Factory 
checked in at 2022-12-02 13:12:58
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/fcitx5-gtk (Old)
 and      /work/SRC/openSUSE:Factory/.fcitx5-gtk.new.1835 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "fcitx5-gtk"

Fri Dec  2 13:12:58 2022 rev:8 rq:1039339 version:5.0.21

Changes:
--------
--- /work/SRC/openSUSE:Factory/fcitx5-gtk/fcitx5-gtk.changes    2022-11-15 
13:21:24.968797870 +0100
+++ /work/SRC/openSUSE:Factory/.fcitx5-gtk.new.1835/fcitx5-gtk.changes  
2022-12-02 13:13:12.909877575 +0100
@@ -1,0 +2,15 @@
+Thu Nov 24 14:18:26 UTC 2022 - Fusion Future <qydwhotm...@gmail.com>
+
+- Update to 5.0.21
+  * Workaround a mutter bug that client side input panel may freeze
+    nautilus if typing in rename dialog.
+  * Workaround a gtk4 bug that breaks the cursor position calculation
+    when typing in the gtk popover window.
+
+-------------------------------------------------------------------
+Sun Nov 20 09:03:34 UTC 2022 - Tranter Madi <tr...@yandex.com>
+
+- update version 5.0.20
+  * remove backport-c772576.diff
+
+-------------------------------------------------------------------

Old:
----
  backport-c772576.diff
  fcitx5-gtk-5.0.19.tar.xz

New:
----
  fcitx5-gtk-5.0.21.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ fcitx5-gtk.spec ++++++
--- /var/tmp/diff_new_pack.V071ut/_old  2022-12-02 13:13:13.457880588 +0100
+++ /var/tmp/diff_new_pack.V071ut/_new  2022-12-02 13:13:13.465880632 +0100
@@ -17,14 +17,13 @@
 
 
 Name:           fcitx5-gtk
-Version:        5.0.19
+Version:        5.0.21
 Release:        0
 Summary:        Gtk im module for fcitx5 and glib based dbus client library
 License:        LGPL-2.1-or-later
 Group:          System/I18n/Chinese
 URL:            https://github.com/fcitx/fcitx5-gtk
 Source:         
https://download.fcitx-im.org/fcitx5/%{name}/%{name}-%{version}.tar.xz
-Patch:          backport-c772576.diff
 BuildRequires:  cmake
 BuildRequires:  extra-cmake-modules
 BuildRequires:  fcitx5-devel
@@ -102,7 +101,6 @@
 
 %prep
 %setup -q
-%patch -p1
 
 %build
 %if 0%{?suse_version} < 1550

++++++ fcitx5-gtk-5.0.19.tar.xz -> fcitx5-gtk-5.0.21.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fcitx5-gtk-5.0.19/CMakeLists.txt 
new/fcitx5-gtk-5.0.21/CMakeLists.txt
--- old/fcitx5-gtk-5.0.19/CMakeLists.txt        2022-09-26 20:08:53.114789200 
+0200
+++ new/fcitx5-gtk-5.0.21/CMakeLists.txt        2022-11-24 12:33:33.205390200 
+0100
@@ -1,5 +1,5 @@
 cmake_minimum_required(VERSION 3.6)
-project(fcitx5-gtk VERSION 5.0.19)
+project(fcitx5-gtk VERSION 5.0.21)
 
 find_package(ECM REQUIRED 1.0.0)
 set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake" 
${CMAKE_MODULE_PATH})
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fcitx5-gtk-5.0.19/fcitx-gclient/fcitxgclient.c 
new/fcitx5-gtk-5.0.21/fcitx-gclient/fcitxgclient.c
--- old/fcitx5-gtk-5.0.19/fcitx-gclient/fcitxgclient.c  2022-08-30 
04:17:34.668460400 +0200
+++ new/fcitx5-gtk-5.0.21/fcitx-gclient/fcitxgclient.c  2022-11-12 
18:57:28.047163500 +0100
@@ -53,6 +53,7 @@
     guint watch_id;
 
     guint32 version;
+    gboolean batch;
 };
 
 static const gchar introspection_xml[] =
@@ -369,6 +370,7 @@
     self->priv->program = NULL;
     self->priv->watch_id = 0;
     self->priv->version = 0;
+    self->priv->batch = TRUE;
 }
 
 static void fcitx_g_client_constructed(GObject *object) {
@@ -573,7 +575,7 @@
                                                          GVariant *result) {
 
     gboolean ret = FALSE;
-    if (self->priv->version > 0) {
+    if (self->priv->version > 0 && self->priv->batch) {
         g_autoptr(GVariantIter) iter = NULL;
         g_variant_get(result, "(a(uv)b)", &iter, &ret);
         GVariant *event;
@@ -663,8 +665,9 @@
     pk->self = g_object_ref(self);
     pk->callback = callback;
     pk->user_data = user_data;
-    const char *method =
-        (self->priv->version > 0) ? "ProcessKeyEventBatch" : "ProcessKeyEvent";
+    const char *method = (self->priv->version > 0 && self->priv->batch)
+                             ? "ProcessKeyEventBatch"
+                             : "ProcessKeyEvent";
     g_dbus_proxy_call(
         self->priv->icproxy, method,
         g_variant_new("(uuubu)", keyval, keycode, state, isRelease, t),
@@ -691,8 +694,9 @@
     g_return_val_if_fail(fcitx_g_client_is_valid(self), FALSE);
     gboolean ret = FALSE;
 
-    const char *method =
-        (self->priv->version > 0) ? "ProcessKeyEventBatch" : "ProcessKeyEvent";
+    const char *method = (self->priv->version > 0 && self->priv->batch)
+                             ? "ProcessKeyEventBatch"
+                             : "ProcessKeyEvent";
     g_autoptr(GVariant) result = g_dbus_proxy_call_sync(
         self->priv->icproxy, method,
         g_variant_new("(uuubu)", keyval, keycode, state, isRelease, t),
@@ -1057,8 +1061,8 @@
 }
 
 /**
- * fcitx_g_client_new_with_connection:
- * @connection: the #FcitxConnection to be used with this client
+ * fcitx_g_client_new_with_watcher:
+ * @connection: the FcitxGWatcher to be used with this client
  *
  * New a #FcitxGClient
  *
@@ -1069,18 +1073,43 @@
         g_object_new(FCITX_G_TYPE_CLIENT, "watcher", watcher, NULL);
     return FCITX_G_CLIENT(self);
 }
-
+/**
+ * fcitx_g_client_set_display:
+ * @self: A #FcitxGClient
+ * @display: display name
+ *
+ * Set the display name
+ **/
 void fcitx_g_client_set_display(FcitxGClient *self, const gchar *display) {
     g_free(self->priv->display);
     self->priv->display = g_strdup(display);
 }
 
+/**
+ * fcitx_g_client_set_display:
+ * @self: A #FcitxGClient
+ * @program: program name
+ *
+ * Set the program name
+ **/
 void fcitx_g_client_set_program(FcitxGClient *self, const gchar *program) {
     g_free(self->priv->program);
     self->priv->program = g_strdup(program);
 }
 
 /**
+ * fcitx_g_client_set_use_batch_process_key_event:
+ * @self: A #FcitxGClient
+ * @batch: whether use ProcessKeyEventBatch
+ *
+ * Set whether use ProcessKeyEventBatch if supports, default is true.
+ **/
+void fcitx_g_client_set_use_batch_process_key_event(FcitxGClient *self,
+                                                    gboolean batch) {
+    self->priv->batch = batch;
+}
+
+/**
  * fcitx_g_client_is_valid:
  * @self: A #FcitxGClient
  *
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fcitx5-gtk-5.0.19/fcitx-gclient/fcitxgclient.h 
new/fcitx5-gtk-5.0.21/fcitx-gclient/fcitxgclient.h
--- old/fcitx5-gtk-5.0.19/fcitx-gclient/fcitxgclient.h  2021-01-25 
17:47:42.458343000 +0100
+++ new/fcitx5-gtk-5.0.21/fcitx-gclient/fcitxgclient.h  2022-11-12 
18:39:20.411929800 +0100
@@ -54,6 +54,8 @@
 void fcitx_g_client_focus_out(FcitxGClient *self);
 void fcitx_g_client_set_display(FcitxGClient *self, const gchar *display);
 void fcitx_g_client_set_program(FcitxGClient *self, const gchar *program);
+void fcitx_g_client_set_use_batch_process_key_event(FcitxGClient *self,
+                                                    gboolean batch);
 void fcitx_g_client_set_cursor_rect(FcitxGClient *self, gint x, gint y, gint w,
                                     gint h);
 void fcitx_g_client_set_cursor_rect_with_scale_factor(FcitxGClient *self,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fcitx5-gtk-5.0.19/gtk2/fcitximcontext.cpp 
new/fcitx5-gtk-5.0.21/gtk2/fcitximcontext.cpp
--- old/fcitx5-gtk-5.0.19/gtk2/fcitximcontext.cpp       2022-06-30 
06:09:22.981732600 +0200
+++ new/fcitx5-gtk-5.0.21/gtk2/fcitximcontext.cpp       2022-11-12 
19:02:35.280998700 +0100
@@ -389,6 +389,7 @@
     context->client = fcitx_g_client_new_with_watcher(_watcher);
     fcitx_g_client_set_program(context->client, g_get_prgname());
     fcitx_g_client_set_display(context->client, "x11:");
+    fcitx_g_client_set_use_batch_process_key_event(context->client, FALSE);
     g_signal_connect(context->client, "connected",
                      G_CALLBACK(_fcitx_im_context_connect_cb), context);
     g_signal_connect(context->client, "forward-key",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fcitx5-gtk-5.0.19/gtk3/fcitximcontext.cpp 
new/fcitx5-gtk-5.0.21/gtk3/fcitximcontext.cpp
--- old/fcitx5-gtk-5.0.19/gtk3/fcitximcontext.cpp       2022-06-30 
06:09:22.981732600 +0200
+++ new/fcitx5-gtk-5.0.21/gtk3/fcitximcontext.cpp       2022-11-12 
18:39:05.962027800 +0100
@@ -443,6 +443,7 @@
 
     context->client = fcitx_g_client_new_with_watcher(_watcher);
     fcitx_g_client_set_program(context->client, g_get_prgname());
+    fcitx_g_client_set_use_batch_process_key_event(context->client, FALSE);
     if (context->is_wayland) {
         fcitx_g_client_set_display(context->client, "wayland:");
     } else {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fcitx5-gtk-5.0.19/gtk4/fcitximcontext.cpp 
new/fcitx5-gtk-5.0.21/gtk4/fcitximcontext.cpp
--- old/fcitx5-gtk-5.0.19/gtk4/fcitximcontext.cpp       2022-09-22 
19:25:28.002977800 +0200
+++ new/fcitx5-gtk-5.0.21/gtk4/fcitximcontext.cpp       2022-11-24 
08:28:11.710383200 +0100
@@ -841,34 +841,49 @@
         !fcitx_g_client_is_valid(fcitxcontext->client)) {
         return FALSE;
     }
+    int scale = gtk_widget_get_scale_factor(fcitxcontext->client_widget);
+    GdkDisplay *display = gtk_widget_get_display(fcitxcontext->client_widget);
+
+    auto *native = gtk_widget_get_native(fcitxcontext->client_widget);
 
-    auto *root = gtk_widget_get_root(fcitxcontext->client_widget);
-    if (!root) {
+    if (!native) {
         return FALSE;
     }
-
     area = fcitxcontext->area;
-
-    int scale = gtk_widget_get_scale_factor(fcitxcontext->client_widget);
-    GdkDisplay *display = gtk_widget_get_display(fcitxcontext->client_widget);
+    auto surface = gtk_native_get_surface(native);
+    if (!surface) {
+        return FALSE;
+    }
+    // Get coordinate against the current window.
     double px, py;
     gtk_widget_translate_coordinates(fcitxcontext->client_widget,
-                                     GTK_WIDGET(root), area.x, area.y, &px,
+                                     GTK_WIDGET(native), area.x, area.y, &px,
                                      &py);
+    area.x = px;
+    area.y = py;
     // Add frame.
     double offsetX = 0, offsetY = 0;
-    if (auto native = gtk_widget_get_native(GTK_WIDGET(root))) {
-        gtk_native_get_surface_transform(native, &offsetX, &offsetY);
+    gtk_native_get_surface_transform(native, &offsetX, &offsetY);
+    area.x += offsetX;
+    area.y += offsetY;
+
+    // gtk_widget_translate_coordinates does not give meaningful value across
+    // difference surface, do our own calculation.
+    while (surface && GDK_IS_POPUP(surface)) {
+        auto *popup = GDK_POPUP(surface);
+        area.x += gdk_popup_get_position_x(popup);
+        area.y += gdk_popup_get_position_y(popup);
+        surface = gdk_popup_get_parent(popup);
     }
-    area.x = px + offsetX;
-    area.y = py + offsetY;
+
 #ifdef GDK_WINDOWING_X11
     if (GDK_IS_X11_DISPLAY(display)) {
-        if (auto *native = gtk_widget_get_native(GTK_WIDGET(root))) {
-            if (auto *surface = gtk_native_get_surface(native);
+        if (auto *native = gtk_widget_get_root(fcitxcontext->client_widget)) {
+            if (auto *surface = gtk_native_get_surface(GTK_NATIVE(native));
                 surface && GDK_IS_X11_SURFACE(surface)) {
-                if (area.x == -1 && area.y == -1 && area.width == 0 &&
-                    area.height == 0) {
+                if (fcitxcontext->area.x == -1 && fcitxcontext->area.y == -1 &&
+                    fcitxcontext->area.width == 0 &&
+                    fcitxcontext->area.height == 0) {
                     area.x = 0;
                     area.y += gdk_surface_get_height(surface);
                 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fcitx5-gtk-5.0.19/gtk4/gtk4inputwindow.cpp 
new/fcitx5-gtk-5.0.21/gtk4/gtk4inputwindow.cpp
--- old/fcitx5-gtk-5.0.19/gtk4/gtk4inputwindow.cpp      2022-06-30 
06:09:22.981732600 +0200
+++ new/fcitx5-gtk-5.0.21/gtk4/gtk4inputwindow.cpp      2022-11-24 
06:56:50.266487000 +0100
@@ -46,7 +46,7 @@
     if (!parent_) {
         return;
     }
-    auto *root = gtk_widget_get_root(parent_);
+    auto *root = gtk_widget_get_native(parent_);
     if (!root) {
         return;
     }
@@ -61,7 +61,22 @@
     }
     rect.x = px + offsetX;
     rect.y = py + offsetX;
+
+    // Sanitize the rect value to workaround a mutter bug:
+    // https://gitlab.gnome.org/GNOME/mutter/-/issues/2525
+    // The procedure make sure the rect is with in the parent window region.
+    const int rootWidth = gtk_widget_get_width(GTK_WIDGET(root));
+    const int rootHeight = gtk_widget_get_height(GTK_WIDGET(root));
+    if (rootWidth <= 0 || rootHeight <= 0) {
+        return;
+    }
+    rect.x = CLAMP(rect.x, 0, rootWidth - 1);
+    rect.y = CLAMP(rect.y, 0, rootHeight - 1);
+    rect.width = CLAMP(rect.width, 0, rootWidth - rect.x);
+    rect.height = CLAMP(rect.height, 0, rootHeight - rect.y);
+
     rect_ = rect;
+
     if (window_) {
         reposition();
     }

Reply via email to