app-i18n/fcitx: Version bump (4.2.9.1).

This commit is contained in:
Arfrever Frehtes Taifersar Arahesis
2016-03-24 10:42:46 -04:00
committed by Mike Gilbert
parent ac5980bba0
commit b842ab8562
5 changed files with 398 additions and 9 deletions
+1
View File
@@ -1,4 +1,5 @@
DIST fcitx-4.2.7_dict.tar.xz 8546416 SHA256 0c902617581f04eb0d337634b0bf2b39956abbcc949512cc79d4ee24cfc9dbb5 SHA512 e5d8eb55f644250197e69315ad02b9f6bc84e697b23c20c01a731f98ce8b1a16d764a58b1e1047d45b8decb6be33144707c2a52fc427e6338d8b8186cd4da074 WHIRLPOOL e344bc92a84940d3c885d1ae87a2fc83c95d6cb0f0e95eed76078e996c4a00df82a0c09c4540771f628928db1716f90d50d04469f2c0f2d5c17b5048fbf2d482
DIST fcitx-4.2.8.5_dict.tar.xz 8696468 SHA256 fe3d6f57805fc61130f8254f19a86fe3baa0f405406414ca2e94bcf86d3d1b72 SHA512 ee6612a34087135065537fa14f09078bad9f029f69b636fb2221193f23d86c5431a9d8a848b264bdcb259680f6bda41d08d58dcf67d19e5a200cb11fa4a26ffe WHIRLPOOL 0a394d5aaa53819bbab66b32e7ae5896187bc45fad146c7eef4ab75640e5c6670cf811bec87e482bb3516b30e1ce28f2cefa91c10838092f9329b1101b5c70db
DIST fcitx-4.2.8.6_dict.tar.xz 8694328 SHA256 91034e9ef976bbe2649a96b67adf0c133d64e2c0d53be440cc40a4370569d597 SHA512 822e448932e735fe3087384eaf91c6b029b06d3461aa3798501bfbf8f79b8ebc5ea3ac57f01ec32674cc3cb74fcb34b6e285ef265bb49be54543f34dcaf624e4 WHIRLPOOL df24b3b6bbe18a8498732b27817caef6c28278bddd6acfbe49edd9a63d8f33b09ba93ff0bd144e1c1d3b9b9c8079a35a8a047ebf9b361b4f173ec9b23138042e
DIST fcitx-4.2.9.1_dict.tar.xz 8684772 SHA256 5337c8226417a1d4e6f88b3b1048aa73695d281ed483568a7b6a9ee849ad6c77 SHA512 5d3b669ed97423f976116385571d07f832e9e18007e6a3c2aef12957219739a81fbf2343825fea4a1b01a83a6bf9e40e9ffa88466c651876602517c6da1fb25d WHIRLPOOL 02b2ff1b0c33b1f2c0461988bc3323ca27ba565a0d8a1f49b96aaceac857c07365aaaee0048d470dea82e60857bedf59ef8c60d3cdfa14a2ff074216d5cdc16d
DIST fcitx-4.2.9_dict.tar.xz 8675292 SHA256 3a935b7098fe573b126f8e393d93bccc6d4e4e9988830430fa9b1c87876bfc6c SHA512 4bad2efc283858bf9af7f7f283f7beefb210aa361ff034464ff97ea0e536f084c99d876f3595a5375114b68cd51714bd0b5c622a53efc57154a4e629fd416093 WHIRLPOOL 520a6f41a68fd5dbd4b00eb5de5ed2aea0801adc9dd64449e36c442311c9c85bdd28f1d5f79917e99b7fff2f8372bed9bb780fdda7d6d16cf528e5c1a6a0914f
+147
View File
@@ -0,0 +1,147 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI="5"
inherit cmake-utils gnome2-utils multilib xdg
if [[ "${PV}" == "9999" ]]; then
inherit git-r3
EGIT_REPO_URI="https://github.com/fcitx/fcitx"
fi
DESCRIPTION="Fcitx (Flexible Context-aware Input Tool with eXtension) input method framework"
HOMEPAGE="https://fcitx-im.org/ https://github.com/fcitx/fcitx"
if [[ "${PV}" == "9999" ]]; then
SRC_URI=""
else
SRC_URI="https://download.fcitx-im.org/${PN}/${P}_dict.tar.xz"
fi
LICENSE="GPL-2+ LGPL-2+"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="+X +autostart +cairo +dbus debug +enchant gtk2 gtk3 +introspection lua nls opencc +pango qt4 static-libs +table test +xml"
REQUIRED_USE="autostart? ( dbus ) cairo? ( X ) gtk2? ( dbus ) gtk3? ( dbus ) introspection? ( dbus ) pango? ( cairo ) qt4? ( X dbus )"
RDEPEND="virtual/libiconv
virtual/libintl
x11-libs/libxkbcommon
X? (
x11-libs/libX11
x11-libs/libXfixes
x11-libs/libXinerama
x11-libs/libXrender
xml? ( x11-libs/libxkbfile )
)
cairo? (
dev-libs/glib:2
x11-libs/cairo[X]
x11-libs/libXext
pango? ( x11-libs/pango )
!pango? ( media-libs/fontconfig )
)
dbus? ( sys-apps/dbus )
enchant? ( app-text/enchant )
gtk2? (
dev-libs/glib:2
x11-libs/gtk+:2
)
gtk3? (
dev-libs/glib:2
x11-libs/gtk+:3
)
introspection? (
dev-libs/glib:2
dev-libs/gobject-introspection
)
lua? ( dev-lang/lua:= )
nls? ( sys-devel/gettext )
opencc? ( app-i18n/opencc )
qt4? (
dev-qt/qtcore:4
dev-qt/qtdbus:4
dev-qt/qtgui:4
)
xml? (
app-text/iso-codes
dev-libs/libxml2
)"
DEPEND="${RDEPEND}
kde-frameworks/extra-cmake-modules:5
virtual/pkgconfig"
DOCS=(AUTHORS ChangeLog THANKS)
PATCHES=(
"${FILESDIR}/${P}-tray_icon.patch"
"${FILESDIR}/${P}-qt-4_ucs4.patch"
)
src_prepare() {
# https://github.com/fcitx/fcitx/issues/250
sed \
-e "/find_package(XkbFile REQUIRED)/i\\ if(ENABLE_X11)" \
-e "/find_package(XkbFile REQUIRED)/s/^/ /" \
-e "/find_package(XkbFile REQUIRED)/a\\ endif(ENABLE_X11)" \
-i CMakeLists.txt
cmake-utils_src_prepare
}
src_configure() {
local mycmakeargs=(
-DLIB_INSTALL_DIR="${EPREFIX}/usr/$(get_libdir)"
-DSYSCONFDIR="${EPREFIX}/etc"
-DENABLE_CAIRO=$(usex cairo)
-DENABLE_DBUS=$(usex dbus)
-DENABLE_DEBUG=$(usex debug)
-DENABLE_ENCHANT=$(usex enchant)
-DENABLE_GETTEXT=$(usex nls)
-DENABLE_GIR=$(usex introspection)
-DENABLE_GLIB2=$(if use cairo || use gtk2 || use gtk3 || use introspection; then echo yes; else echo no; fi)
-DENABLE_GTK2_IM_MODULE=$(usex gtk2)
-DENABLE_GTK3_IM_MODULE=$(usex gtk3)
-DENABLE_LIBXML2=$(usex xml)
-DENABLE_LUA=$(usex lua)
-DENABLE_OPENCC=$(usex opencc)
-DENABLE_PANGO=$(usex pango)
-DENABLE_QT=$(usex qt4)
-DENABLE_QT_GUI=$(usex qt4)
-DENABLE_QT_IM_MODULE=$(usex qt4)
-DENABLE_SNOOPER=$(if use gtk2 || use gtk3; then echo yes; else echo no; fi)
-DENABLE_STATIC=$(usex static-libs)
-DENABLE_TABLE=$(usex table)
-DENABLE_TEST=$(usex test)
-DENABLE_X11=$(usex X)
-DENABLE_XDGAUTOSTART=$(usex autostart)
)
cmake-utils_src_configure
}
src_install() {
cmake-utils_src_install
rm -r "${ED}usr/share/doc/${PN}"
}
pkg_preinst() {
gnome2_icon_savelist
xdg_pkg_preinst
}
pkg_postinst() {
gnome2_icon_cache_update
xdg_pkg_postinst
use gtk2 && gnome2_query_immodules_gtk2
use gtk3 && gnome2_query_immodules_gtk3
}
pkg_postrm() {
gnome2_icon_cache_update
xdg_pkg_postrm
use gtk2 && gnome2_query_immodules_gtk2
use gtk3 && gnome2_query_immodules_gtk3
}
@@ -0,0 +1,95 @@
https://github.com/fcitx/fcitx/commit/14faccfbb0d87e06c25d182ae842808d18be3dc7
https://github.com/fcitx/fcitx/commit/216a09e3ec056f272eebfbe82809b803d86012cb
--- src/frontend/qt/qfcitxinputcontext.cpp
+++ src/frontend/qt/qfcitxinputcontext.cpp
@@ -232,6 +232,20 @@
anchor = var2.toInt();
else
anchor = cursor;
+
+ // adjust it to real character size
+ // QTBUG-25536;
+ QVector<uint> tempUCS4 = text.leftRef(cursor).toUcs4();
+ while (!tempUCS4.empty() && tempUCS4.last() == 0) {
+ tempUCS4.pop_back();
+ }
+ cursor = tempUCS4.size();
+ tempUCS4 = text.leftRef(anchor).toUcs4();
+ while (!tempUCS4.empty() && tempUCS4.last() == 0) {
+ tempUCS4.pop_back();
+ }
+ anchor = tempUCS4.size();
+
if (data->surroundingText != text) {
data->surroundingText = text;
proxy->SetSurroundingText(text, cursor, anchor);
@@ -581,6 +595,7 @@
delete data->proxy;
}
data->proxy = new FcitxQtInputContextProxy(m_connection->serviceName(), path, *m_connection->connection(), this);
+ data->proxy->setProperty("icData", qVariantFromValue(static_cast<void*>(data)));
connect(data->proxy, SIGNAL(CommitString(QString)), this, SLOT(commitString(QString)));
connect(data->proxy, SIGNAL(ForwardKey(uint, uint, int)), this, SLOT(forwardKey(uint, uint, int)));
connect(data->proxy, SIGNAL(UpdateFormattedPreedit(FcitxQtFormattedPreeditList,int)), this, SLOT(updateFormattedPreedit(FcitxQtFormattedPreeditList,int)));
@@ -680,11 +695,57 @@
sendEvent(event);
}
-void QFcitxInputContext::deleteSurroundingText(int offset, uint nchar)
+void QFcitxInputContext::deleteSurroundingText(int offset, uint _nchar)
{
QInputMethodEvent event;
- event.setCommitString("", offset, nchar);
- sendEvent(event);
+
+ FcitxQtInputContextProxy *proxy = qobject_cast<FcitxQtInputContextProxy*>(sender());
+ if (!proxy) {
+ return;
+ }
+
+ FcitxQtICData *data = static_cast<FcitxQtICData*>(proxy->property("icData").value<void *>());
+ QVector<uint> ucsText = data->surroundingText.toUcs4();
+
+ // QTBUG-25536
+ while (!ucsText.empty() && ucsText.last() == 0) {
+ ucsText.pop_back();
+ }
+
+ int cursor = data->surroundingCursor;
+ // make nchar signed so we are safer
+ int nchar = _nchar;
+ // Qt's reconvert semantics is different from gtk's. It doesn't count the current
+ // selection. Discard selection from nchar.
+ if (data->surroundingAnchor < data->surroundingCursor) {
+ nchar -= data->surroundingCursor - data->surroundingAnchor;
+ offset += data->surroundingCursor - data->surroundingAnchor;
+ cursor = data->surroundingAnchor;
+ } else if (data->surroundingAnchor > data->surroundingCursor) {
+ nchar -= data->surroundingAnchor - data->surroundingCursor;
+ cursor = data->surroundingCursor;
+ }
+
+ // validates
+ if (nchar >= 0 && cursor + offset >= 0 && cursor + offset + nchar < ucsText.size()) {
+ // order matters
+ QVector<uint> replacedChars = ucsText.mid(cursor + offset, nchar);
+ nchar = QString::fromUcs4(replacedChars.data(), replacedChars.size()).size();
+
+ int start, len;
+ if (offset >= 0) {
+ start = cursor;
+ len = offset;
+ } else {
+ start = cursor;
+ len = -offset;
+ }
+
+ QVector<uint> prefixedChars = ucsText.mid(start, len);
+ offset = QString::fromUcs4(prefixedChars.data(), prefixedChars.size()).size() * (offset >= 0 ? 1 : -1);
+ event.setCommitString("", offset, nchar);
+ sendEvent(event);
+ }
}
void QFcitxInputContext::forwardKey(uint keyval, uint state, int type)
@@ -0,0 +1,145 @@
https://github.com/fcitx/fcitx/issues/241
https://github.com/fcitx/fcitx/commit/c737618fffa84bfe5a6caf55cee9b9288a791bbf
https://github.com/fcitx/fcitx/commit/353683e29be4ef26409b9a05e0cb647a5180fa8c
https://github.com/fcitx/fcitx/commit/fe2732db27a1c2e183400ceeb3283559e10a4ca8
https://github.com/fcitx/fcitx/commit/440c431d29876a8e4871159d289bc9a573f9a41b
--- src/module/notificationitem/notificationitem.c
+++ src/module/notificationitem/notificationitem.c
@@ -565,8 +565,17 @@
boolean FcitxNotificationItemEnable(FcitxNotificationItem* notificationitem, FcitxNotificationItemAvailableCallback callback, void* data)
{
- if (!callback || notificationitem->callback)
+ if (!callback)
return false;
+
+ if (notificationitem->callback == callback) {
+ return true;
+ }
+
+ if (notificationitem->callback) {
+ return false;
+ }
+
if (notificationitem->serviceName) {
FcitxLog(ERROR, "This should not happen, please report bug.");
return false;
--- src/ui/classic/TrayWindow.c
+++ src/ui/classic/TrayWindow.c
@@ -48,7 +48,7 @@
Display *dpy = classicui->dpy;
int iScreen = classicui->iScreen;
char strWindowName[] = "Fcitx Tray Window";
- if (!classicui->bUseTrayIcon || classicui->isSuspend)
+ if (!classicui->bUseTrayIcon || classicui->isSuspend || classicui->notificationItemAvailable)
return;
if (trayWindow->window == None && trayWindow->dockWindow != None) {
@@ -61,12 +61,12 @@
wsa.colormap = colormap;
wsa.background_pixel = 0;
wsa.border_pixel = 0;
- trayWindow->window = XCreateWindow(dpy, p, -1, -1, 1, 1,
+ trayWindow->window = XCreateWindow(dpy, p, -1, -1, 22, 22,
0, vi->depth, InputOutput, vi->visual,
CWBackPixmap | CWBackPixel | CWBorderPixel | CWColormap, &wsa);
} else {
trayWindow->window = XCreateSimpleWindow(dpy, DefaultRootWindow(dpy),
- -1, -1, 1, 1, 0,
+ -1, -1, 22, 22, 0,
BlackPixel(dpy, DefaultScreen(dpy)),
WhitePixel(dpy, DefaultScreen(dpy)));
XSetWindowBackgroundPixmap(dpy, trayWindow->window, ParentRelative);
@@ -74,6 +74,7 @@
if (trayWindow->window == (Window) NULL)
return;
+ trayWindow->size = 22;
XSizeHints size_hints;
size_hints.flags = PWinGravity | PBaseSize;
size_hints.base_width = trayWindow->size;
@@ -161,7 +162,7 @@
png_surface = image->image;
c = cairo_create(trayWindow->cs);
- cairo_set_source_rgba(c, 0, 0, 0, 0);
+ cairo_set_source_rgba(c, 1, 1, 1, 0);
cairo_set_operator(c, CAIRO_OPERATOR_SOURCE);
cairo_paint(c);
@@ -226,8 +227,6 @@
if (event->xclient.message_type == trayWindow->atoms[ATOM_MANAGER]
&& event->xclient.data.l[1] == trayWindow->atoms[ATOM_SELECTION]
&& trayWindow->dockWindow == None) {
- if (classicui->notificationItemAvailable)
- return true;
trayWindow->dockWindow = event->xclient.data.l[2];
TrayWindowRelease(trayWindow);
TrayWindowInit(trayWindow);
@@ -245,6 +244,7 @@
int size = event->xconfigure.height;
if (size != trayWindow->size) {
trayWindow->size = size;
+ XResizeWindow(dpy, trayWindow->window, size, size);
XSizeHints size_hints;
size_hints.flags = PWinGravity | PBaseSize;
size_hints.base_width = trayWindow->size;
@@ -286,6 +286,14 @@
return true;
}
break;
+ case PropertyNotify:
+ if (event->xproperty.atom == trayWindow->atoms[ATOM_VISUAL] &&
+ event->xproperty.window == trayWindow->dockWindow) {
+ TrayWindowRelease(trayWindow);
+ TrayWindowInit(trayWindow);
+ return true;
+ }
+ break;
}
return false;
}
--- src/ui/classic/classicui.c
+++ src/ui/classic/classicui.c
@@ -168,7 +168,7 @@
void ClassicUIDelayedInitTray(void* arg) {
FcitxClassicUI* classicui = (FcitxClassicUI*) arg;
// FcitxLog(INFO, "yeah we delayed!");
- if (!classicui->bUseTrayIcon)
+ if (!classicui->bUseTrayIcon || classicui->isSuspend)
return;
/*
* if this return false, something wrong happened and callback
@@ -187,7 +187,7 @@
{
FcitxClassicUI* classicui = (FcitxClassicUI*) arg;
classicui->trayTimeout = 0;
- if (!classicui->bUseTrayIcon)
+ if (!classicui->bUseTrayIcon || classicui->isSuspend)
return;
if (!classicui->trayWindow->bTrayMapped) {
--- src/ui/classic/tray.c
+++ src/ui/classic/tray.c
@@ -106,8 +106,9 @@
XWindowAttributes attr;
XGetWindowAttributes(dpy, DefaultRootWindow(dpy), &attr);
- if ((attr.your_event_mask & StructureNotifyMask) != StructureNotifyMask) {
- XSelectInput(dpy, DefaultRootWindow(dpy), attr.your_event_mask | StructureNotifyMask); // for MANAGER selection
+ int neededMask = StructureNotifyMask;
+ if ((attr.your_event_mask & neededMask) != neededMask) {
+ XSelectInput(dpy, DefaultRootWindow(dpy), attr.your_event_mask | neededMask); // for MANAGER selection
}
return True;
}
@@ -123,7 +124,7 @@
Display* dpy = tray->owner->dpy;
if (tray->dockWindow != None) {
- XSelectInput(dpy, tray->dockWindow, StructureNotifyMask);
+ XSelectInput(dpy, tray->dockWindow, PropertyChangeMask | StructureNotifyMask);
TraySendOpcode(tray, SYSTEM_TRAY_REQUEST_DOCK, tray->window, 0, 0);
tray->bTrayMapped = True;
return 1;
+10 -9
View File
@@ -10,15 +10,16 @@
<name>Cjk</name>
</maintainer>
<use>
<flag name="autostart">Enable xdg-compatible autostart of fcitx</flag>
<flag name="enchant">Use <pkg>app-text/enchant</pkg> for text prediction</flag>
<flag name="introspection">Enable GObject Introspection</flag>
<flag name="gtk">Install GTK2 IM module</flag>
<flag name="gtk3">Install GTK3 IM module</flag>
<flag name="opencc">Enable OpenCC for Chinese Transform</flag>
<flag name="autostart">Enable XDG-compatible autostart of Fcitx</flag>
<flag name="enchant">Enable Enchant backend (using <pkg>app-text/enchant</pkg>) for spelling hinting</flag>
<flag name="introspection">Enable support for GObject Introspection</flag>
<flag name="gtk">Install input method module for GTK+ 2</flag>
<flag name="gtk2">Install input method module for GTK+ 2</flag>
<flag name="gtk3">Install input method module for GTK+ 3</flag>
<flag name="opencc">Enable OpenCC engine (using <pkg>app-i18n/opencc</pkg>) for converter between Simplified Chinese and Traditional Chinese</flag>
<flag name="pango">Enable support for <pkg>x11-libs/pango</pkg></flag>
<flag name="qt4">Install Qt4 IM module</flag>
<flag name="snooper">Enable Key Snooper for GTK app</flag>
<flag name="table">Enable Table IM</flag>
<flag name="qt4">Install input method module for Qt 4</flag>
<flag name="snooper">Enable key snooper for GTK+ applications</flag>
<flag name="table">Install table input methods for Simplified Chinese</flag>
</use>
</pkgmetadata>