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 2023-08-21 11:44:46 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/fcitx5-gtk (Old) and /work/SRC/openSUSE:Factory/.fcitx5-gtk.new.1766 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "fcitx5-gtk" Mon Aug 21 11:44:46 2023 rev:11 rq:1104887 version:5.1.0 Changes: -------- --- /work/SRC/openSUSE:Factory/fcitx5-gtk/fcitx5-gtk.changes 2023-05-23 14:54:19.686406703 +0200 +++ /work/SRC/openSUSE:Factory/.fcitx5-gtk.new.1766/fcitx5-gtk.changes 2023-08-21 11:44:59.483620993 +0200 @@ -1,0 +2,9 @@ +Sun Aug 20 05:59:02 UTC 2023 - Marguerite Su <[email protected]> + +- update to 5.1.0 + * add im module probing program + * skip gtk im module probing for only plugin option + * implement new PageButtonAlignment for gtk client side ui + * gdk_layout is not happy with width or height 0 rect anymore + +------------------------------------------------------------------- Old: ---- fcitx5-gtk-5.0.23.tar.xz New: ---- fcitx5-gtk-5.1.0.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ fcitx5-gtk.spec ++++++ --- /var/tmp/diff_new_pack.TdBfF3/_old 2023-08-21 11:45:00.187622342 +0200 +++ /var/tmp/diff_new_pack.TdBfF3/_new 2023-08-21 11:45:00.195622357 +0200 @@ -17,7 +17,7 @@ Name: fcitx5-gtk -Version: 5.0.23 +Version: 5.1.0 Release: 0 Summary: Gtk im module for fcitx5 and glib based dbus client library License: LGPL-2.1-or-later @@ -172,13 +172,16 @@ %{_libdir}/libFcitx5GClient.so.%{version} %files -n fcitx5-gtk2 +%{_bindir}/fcitx5-gtk2-immodule-probing %{_libdir}/gtk-2.0/2.10.0/immodules/im-fcitx5.so %files -n fcitx5-gtk3 +%{_bindir}/fcitx5-gtk3-immodule-probing %{_libdir}/gtk-3.0/3.0.0/immodules/im-fcitx5.so %if 0%{?suse_version} >= 1550 %files -n fcitx5-gtk4 +%{_bindir}/fcitx5-gtk4-immodule-probing %dir %{_libdir}/gtk-4.0/4.0.0/immodules %{_libdir}/gtk-4.0/4.0.0/immodules/libim-fcitx5.so %endif ++++++ fcitx5-gtk-5.0.23.tar.xz -> fcitx5-gtk-5.1.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcitx5-gtk-5.0.23/CMakeLists.txt new/fcitx5-gtk-5.1.0/CMakeLists.txt --- old/fcitx5-gtk-5.0.23/CMakeLists.txt 2023-03-17 04:40:02.752954200 +0100 +++ new/fcitx5-gtk-5.1.0/CMakeLists.txt 2023-08-14 19:44:39.366107000 +0200 @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.6) -project(fcitx5-gtk VERSION 5.0.23) +project(fcitx5-gtk VERSION 5.1.0) 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.23/gtk2/CMakeLists.txt new/fcitx5-gtk-5.1.0/gtk2/CMakeLists.txt --- old/fcitx5-gtk-5.0.23/gtk2/CMakeLists.txt 2022-11-12 18:12:58.154401800 +0100 +++ new/fcitx5-gtk-5.1.0/gtk2/CMakeLists.txt 2023-03-26 06:55:10.646055500 +0200 @@ -12,3 +12,10 @@ COMPILE_FLAGS "-fno-exceptions") target_link_libraries(im-fcitx5 Fcitx5::GClient XKBCommon::XKBCommon PkgConfig::Gtk2 PkgConfig::Gdk2 PkgConfig::Gdk2X11 X11Import) install(TARGETS im-fcitx5 DESTINATION "${GTK2_IM_MODULEDIR}") + + +if (NOT BUILD_ONLY_PLUGIN) + add_executable(fcitx5-gtk2-immodule-probing immodule-probing.cpp) + target_link_libraries(fcitx5-gtk2-immodule-probing PkgConfig::Gtk2) + install(TARGETS fcitx5-gtk2-immodule-probing DESTINATION "${CMAKE_INSTALL_BINDIR}") +endif() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcitx5-gtk-5.0.23/gtk2/immodule-probing.cpp new/fcitx5-gtk-5.1.0/gtk2/immodule-probing.cpp --- old/fcitx5-gtk-5.0.23/gtk2/immodule-probing.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/fcitx5-gtk-5.1.0/gtk2/immodule-probing.cpp 2023-03-26 06:54:23.978973900 +0200 @@ -0,0 +1,31 @@ +/* + * SPDX-FileCopyrightText: 2023~2023 CSSlayer <[email protected]> + * + * SPDX-License-Identifier: LGPL-2.1-or-later + * + */ +#include <gtk/gtk.h> +#include <gtk/gtkimmodule.h> +#include <iostream> + +int main(int argc, char *argv[]) { + GtkIMContext *context; + char *preedit_string = NULL; + PangoAttrList *preedit_attrs = NULL; + const char *context_id; + +#if GTK_CHECK_VERSION(4, 0, 0) + (void)argc; + (void)argv; + gtk_init(); +#else + gtk_init(&argc, &argv); +#endif + context = gtk_im_multicontext_new(); + gtk_im_context_get_preedit_string(context, &preedit_string, &preedit_attrs, + 0); + context_id = + gtk_im_multicontext_get_context_id(GTK_IM_MULTICONTEXT(context)); + std::cout << "GTK_IM_MODULE=" << context_id << std::endl; + return 0; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcitx5-gtk-5.0.23/gtk3/CMakeLists.txt new/fcitx5-gtk-5.1.0/gtk3/CMakeLists.txt --- old/fcitx5-gtk-5.0.23/gtk3/CMakeLists.txt 2022-11-12 18:12:58.154401800 +0100 +++ new/fcitx5-gtk-5.1.0/gtk3/CMakeLists.txt 2023-03-26 06:55:15.769431600 +0200 @@ -21,3 +21,10 @@ endif() install(TARGETS im-fcitx5-gtk3 DESTINATION "${GTK3_IM_MODULEDIR}") + + +if (NOT BUILD_ONLY_PLUGIN) + add_executable(fcitx5-gtk3-immodule-probing immodule-probing.cpp) + target_link_libraries(fcitx5-gtk3-immodule-probing PkgConfig::Gtk3) + install(TARGETS fcitx5-gtk3-immodule-probing DESTINATION "${CMAKE_INSTALL_BINDIR}") +endif() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcitx5-gtk-5.0.23/gtk3/fcitxtheme.cpp new/fcitx5-gtk-5.1.0/gtk3/fcitxtheme.cpp --- old/fcitx5-gtk-5.0.23/gtk3/fcitxtheme.cpp 2022-11-12 18:12:58.154401800 +0100 +++ new/fcitx5-gtk-5.1.0/gtk3/fcitxtheme.cpp 2023-04-20 08:52:58.110567800 +0200 @@ -65,6 +65,25 @@ return defaultValue; } +// Read PageButtonAlignment enum value +PageButtonAlignment getValue(GKeyFile *configFile, const char *group, + const char *key, + PageButtonAlignment defaultValue) { + std::string value = getValue(configFile, group, key, ""); + if (value == "Top") { + return PageButtonAlignment::Top; + } else if (value == "First Candidate") { + return PageButtonAlignment::FirstCandidate; + } else if (value == "Center") { + return PageButtonAlignment::Center; + } else if (value == "Last Candidate") { + return PageButtonAlignment::LastCandidate; + } else if (value == "Bottom") { + return PageButtonAlignment::Bottom; + } + return defaultValue; +} + // Read int value int getValue(GKeyFile *configFile, const char *group, const char *key, int defaultValue) { @@ -736,6 +755,8 @@ highlightBackgroundColor = getValue(file, "InputPanel", "HighlightBackgroundColor", makeGdkRGBA(0xa5, 0xa5, 0xa5, 255)); + buttonAlignment = getValue(file, "InputPanel", "PageButtonAlignment", + PageButtonAlignment::Bottom); background.load(file, "InputPanel/Background"); highlight.load(file, "InputPanel/Highlight"); contentMargin.load(file, "InputPanel/ContentMargin"); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcitx5-gtk-5.0.23/gtk3/fcitxtheme.h new/fcitx5-gtk-5.1.0/gtk3/fcitxtheme.h --- old/fcitx5-gtk-5.0.23/gtk3/fcitxtheme.h 2022-11-12 18:12:58.154401800 +0100 +++ new/fcitx5-gtk-5.1.0/gtk3/fcitxtheme.h 2023-04-20 08:52:58.110567800 +0200 @@ -28,6 +28,14 @@ BottomRight }; +enum class PageButtonAlignment { + Top, + FirstCandidate, + Center, + LastCandidate, + Bottom +}; + struct MarginConfig { void load(GKeyFile *file, const char *group); @@ -72,6 +80,7 @@ bool fullWidthHighlight = true; GdkRGBA highlightColor; GdkRGBA highlightBackgroundColor; + PageButtonAlignment buttonAlignment; BackgroundImageConfig background; HighlightBackgroundImageConfig highlight; MarginConfig contentMargin; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcitx5-gtk-5.0.23/gtk3/immodule-probing.cpp new/fcitx5-gtk-5.1.0/gtk3/immodule-probing.cpp --- old/fcitx5-gtk-5.0.23/gtk3/immodule-probing.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/fcitx5-gtk-5.1.0/gtk3/immodule-probing.cpp 2023-08-21 11:45:00.443622832 +0200 @@ -0,0 +1 @@ +symbolic link to ../gtk2/immodule-probing.cpp diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcitx5-gtk-5.0.23/gtk3/inputwindow.cpp new/fcitx5-gtk-5.1.0/gtk3/inputwindow.cpp --- old/fcitx5-gtk-5.0.23/gtk3/inputwindow.cpp 2022-11-12 18:12:58.154401800 +0100 +++ new/fcitx5-gtk-5.1.0/gtk3/inputwindow.cpp 2023-04-20 08:52:58.110567800 +0200 @@ -479,51 +479,8 @@ const auto &textMargin = config_->theme_.textMargin; cairo_set_operator(cr, CAIRO_OPERATOR_OVER); cairo_save(cr); - - prevRegion_ = cairo_rectangle_int_t{0, 0, 0, 0}; - nextRegion_ = cairo_rectangle_int_t{0, 0, 0, 0}; - if (nCandidates_ && (hasPrev_ || hasNext_)) { - const auto &prev = config_->theme_.loadAction(config_->theme_.prev); - const auto &next = config_->theme_.loadAction(config_->theme_.next); - if (prev.valid() && next.valid()) { - cairo_save(cr); - nextRegion_.x = width - margin.marginRight - next.width(); - nextRegion_.y = height - margin.marginBottom - next.height(); - nextRegion_.width = next.width(); - nextRegion_.height = next.height(); - cairo_translate(cr, nextRegion_.x, nextRegion_.y); - shrink(nextRegion_, config_->theme_.next.clickMargin); - double alpha = 1.0; - if (!hasNext_) { - alpha = 0.3; - } else if (nextHovered_) { - alpha = 0.7; - } - config_->theme_.paint(cr, config_->theme_.next, alpha); - cairo_restore(cr); - cairo_save(cr); - prevRegion_.x = - width - margin.marginRight - next.width() - prev.width(); - prevRegion_.y = height - margin.marginBottom - prev.height(); - prevRegion_.width = prev.width(); - prevRegion_.height = prev.height(); - cairo_translate(cr, prevRegion_.x, prevRegion_.y); - shrink(prevRegion_, config_->theme_.prev.clickMargin); - alpha = 1.0; - if (!hasPrev_) { - alpha = 0.3; - } else if (prevHovered_) { - alpha = 0.7; - } - config_->theme_.paint(cr, config_->theme_.prev, alpha); - cairo_restore(cr); - } - } - // Move position to the right place. cairo_translate(cr, margin.marginLeft, margin.marginTop); - - cairo_save(cr); cairoSetSourceColor(cr, config_->theme_.normalColor); // CLASSICUI_DEBUG() << theme.inputPanel->normalColor->toString(); auto *metrics = pango_context_get_metrics( @@ -653,6 +610,82 @@ } } cairo_restore(cr); + + prevRegion_ = cairo_rectangle_int_t{0, 0, 0, 0}; + nextRegion_ = cairo_rectangle_int_t{0, 0, 0, 0}; + if (nCandidates_ && (hasPrev_ || hasNext_)) { + const auto &prev = config_->theme_.loadAction(config_->theme_.prev); + const auto &next = config_->theme_.loadAction(config_->theme_.next); + if (prev.valid() && next.valid()) { + cairo_save(cr); + int prevY = 0, nextY = 0; + switch (config_->theme_.buttonAlignment) { + case PageButtonAlignment::Top: + prevY = margin.marginTop; + nextY = margin.marginTop; + break; + case PageButtonAlignment::FirstCandidate: + prevY = + candidateRegions_.front().y + + (candidateRegions_.front().height - prev.height()) / 2.0; + nextY = + candidateRegions_.front().y + + (candidateRegions_.front().height - prev.height()) / 2.0; + break; + case PageButtonAlignment::Center: + prevY = + margin.marginTop + (height - margin.marginTop - + margin.marginBottom - prev.height()) / + 2.0; + nextY = + margin.marginTop + (height - margin.marginTop - + margin.marginBottom - next.height()) / + 2.0; + break; + case PageButtonAlignment::LastCandidate: + prevY = candidateRegions_.back().y + + (candidateRegions_.back().height - prev.height()) / 2.0; + nextY = candidateRegions_.back().y + + (candidateRegions_.back().height - next.height()) / 2.0; + break; + case PageButtonAlignment::Bottom: + default: + prevY = height - margin.marginBottom - prev.height(); + nextY = height - margin.marginBottom - next.height(); + break; + } + nextRegion_.x = width - margin.marginRight - next.width(); + nextRegion_.y = nextY; + nextRegion_.width = next.width(); + nextRegion_.height = next.height(); + cairo_translate(cr, nextRegion_.x, nextRegion_.y); + shrink(nextRegion_, config_->theme_.next.clickMargin); + double alpha = 1.0; + if (!hasNext_) { + alpha = 0.3; + } else if (nextHovered_) { + alpha = 0.7; + } + config_->theme_.paint(cr, config_->theme_.next, alpha); + cairo_restore(cr); + cairo_save(cr); + prevRegion_.x = + width - margin.marginRight - next.width() - prev.width(); + prevRegion_.y = prevY; + prevRegion_.width = prev.width(); + prevRegion_.height = prev.height(); + cairo_translate(cr, prevRegion_.x, prevRegion_.y); + shrink(prevRegion_, config_->theme_.prev.clickMargin); + alpha = 1.0; + if (!hasPrev_) { + alpha = 0.3; + } else if (prevHovered_) { + alpha = 0.7; + } + config_->theme_.paint(cr, config_->theme_.prev, alpha); + cairo_restore(cr); + } + } } void InputWindow::click(int x, int y) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcitx5-gtk-5.0.23/gtk4/CMakeLists.txt new/fcitx5-gtk-5.1.0/gtk4/CMakeLists.txt --- old/fcitx5-gtk-5.0.23/gtk4/CMakeLists.txt 2022-11-12 18:12:58.154401800 +0100 +++ new/fcitx5-gtk-5.1.0/gtk4/CMakeLists.txt 2023-03-26 06:55:33.639577600 +0200 @@ -20,3 +20,9 @@ target_link_libraries(im-fcitx5-gtk4 PkgConfig::Gtk4X11 X11Import) endif() install(TARGETS im-fcitx5-gtk4 DESTINATION "${GTK4_IM_MODULEDIR}") + +if (NOT BUILD_ONLY_PLUGIN) + add_executable(fcitx5-gtk4-immodule-probing immodule-probing.cpp) + target_link_libraries(fcitx5-gtk4-immodule-probing PkgConfig::Gtk4) + install(TARGETS fcitx5-gtk4-immodule-probing DESTINATION "${CMAKE_INSTALL_BINDIR}") +endif() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcitx5-gtk-5.0.23/gtk4/gtk4inputwindow.cpp new/fcitx5-gtk-5.1.0/gtk4/gtk4inputwindow.cpp --- old/fcitx5-gtk-5.0.23/gtk4/gtk4inputwindow.cpp 2023-03-17 04:35:58.662096700 +0100 +++ new/fcitx5-gtk-5.1.0/gtk4/gtk4inputwindow.cpp 2023-06-09 08:09:37.537008500 +0200 @@ -73,8 +73,8 @@ } 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.width = CLAMP(rect.width, 1, rootWidth - rect.x); + rect.height = CLAMP(rect.height, 1, rootHeight - rect.y); rect_ = rect; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcitx5-gtk-5.0.23/gtk4/immodule-probing.cpp new/fcitx5-gtk-5.1.0/gtk4/immodule-probing.cpp --- old/fcitx5-gtk-5.0.23/gtk4/immodule-probing.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/fcitx5-gtk-5.1.0/gtk4/immodule-probing.cpp 2023-08-21 11:45:00.467622878 +0200 @@ -0,0 +1 @@ +symbolic link to ../gtk2/immodule-probing.cpp
