SHA256
1
0
forked from pool/fcitx
fcitx/boo954623.patch

65 lines
2.6 KiB
Diff

Index: fcitx-4.2.9.1/src/module/notificationitem/notificationitem.c
===================================================================
--- fcitx-4.2.9.1.orig/src/module/notificationitem/notificationitem.c
+++ fcitx-4.2.9.1/src/module/notificationitem/notificationitem.c
@@ -565,8 +565,17 @@ void FcitxNotificationItemUpdateIMList(v
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;
Index: fcitx-4.2.9.1/src/ui/classic/TrayWindow.c
===================================================================
--- fcitx-4.2.9.1.orig/src/ui/classic/TrayWindow.c
+++ fcitx-4.2.9.1/src/ui/classic/TrayWindow.c
@@ -226,11 +226,11 @@ boolean TrayEventHandler(void *arg, XEve
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);
+ if (!classicui->notificationItemAvailable && !classicui->isSuspend) {
+ TrayWindowInit(trayWindow);
+ }
return true;
}
break;
Index: fcitx-4.2.9.1/src/ui/classic/classicui.c
===================================================================
--- fcitx-4.2.9.1.orig/src/ui/classic/classicui.c
+++ fcitx-4.2.9.1/src/ui/classic/classicui.c
@@ -168,7 +168,7 @@ void* ClassicUICreate(FcitxInstance* ins
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 @@ void ClassicUIDelayedShowTray(void* arg)
{
FcitxClassicUI* classicui = (FcitxClassicUI*) arg;
classicui->trayTimeout = 0;
- if (!classicui->bUseTrayIcon)
+ if (!classicui->bUseTrayIcon || classicui->isSuspend)
return;
if (!classicui->trayWindow->bTrayMapped) {