new package: xfce4-docklike-plugin

Co-authored-by: T-Dynamos <anshdadwal298@gmail.com>
This commit is contained in:
Tee KOBAYASHI 2022-11-16 01:09:33 +09:00 committed by xtkoba
parent fb6736ce4c
commit e7dfc97515
2 changed files with 64 additions and 0 deletions

View File

@ -0,0 +1,16 @@
TERMUX_PKG_HOMEPAGE=https://docs.xfce.org/panel-plugins/xfce4-docklike-plugin/start
TERMUX_PKG_DESCRIPTION="A modern, docklike, minimalist taskbar for XFCE"
TERMUX_PKG_LICENSE="GPL-3.0"
TERMUX_PKG_MAINTAINER="@termux"
_MAJOR_VERSION=0.4
TERMUX_PKG_VERSION=${_MAJOR_VERSION}.0
TERMUX_PKG_SRCURL=https://archive.xfce.org/src/panel-plugins/xfce4-docklike-plugin/${_MAJOR_VERSION}/xfce4-docklike-plugin-${TERMUX_PKG_VERSION}.tar.bz2
TERMUX_PKG_SHA256=b4136a70897895f0599e8e7237223dde17221f099a2fc816917d5894bbd4f372
# exo is for bin/exo-desktop-item-edit.
TERMUX_PKG_DEPENDS="atk, exo, gdk-pixbuf, glib, gtk3, harfbuzz, libc++, libcairo, libwnck, libx11, libxfce4ui, libxfce4util, pango, xfce4-panel"
TERMUX_PKG_BUILD_IN_SRC=true
TERMUX_PKG_RM_AFTER_INSTALL="lib/locale"
termux_step_pre_configure () {
LDFLAGS+=" $($CC -print-libgcc-file-name)"
}

View File

@ -0,0 +1,48 @@
--- a/src/Hotkeys.cpp
+++ b/src/Hotkeys.cpp
@@ -9,6 +9,15 @@
#define ModifierChange 85 //? this event type isn't listed in libX11
+#ifdef __ANDROID__
+#include <signal.h>
+#include <string.h>
+static void threadSignalHandler(int signum)
+{
+ pthread_exit(0);
+}
+#endif
+
namespace Hotkeys
{
int mGrabbedKeys;
@@ -113,8 +122,17 @@
void* threadedXIKeyListenner(void* data)
{
+#ifndef __ANDROID__
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
+#else
+ struct sigaction actions;
+ memset(&actions, 0, sizeof(actions));
+ sigemptyset(&actions.sa_mask);
+ actions.sa_flags = 0;
+ actions.sa_handler = threadSignalHandler;
+ sigaction(SIGUSR2, &actions, NULL);
+#endif
Display* display = XOpenDisplay(NULL);
@@ -159,7 +177,11 @@
pthread_create(&mThread, NULL, threadedXIKeyListenner, NULL);
else if (mThread)
{
+#ifndef __ANDROID__
pthread_cancel(mThread); //also close the XDisplay in the thread
+#else
+ pthread_kill(mThread, SIGUSR2);
+#endif
void* ret = NULL;
pthread_join(mThread, &ret);
mThread = 0;