!21 update to upstream version 3.0.2-1
From: @hua_yadong Reviewed-by: @pei-jiankang Signed-off-by: @pei-jiankang
This commit is contained in:
commit
a4187ae4be
@ -1,124 +0,0 @@
|
|||||||
From 11d4ec4827447c058ab3a00f4d37864ed95e1e44 Mon Sep 17 00:00:00 2001
|
|
||||||
From: tanyulong <tanyulong@kylinos.cn>
|
|
||||||
Date: Thu, 29 Jul 2021 15:37:53 +0800
|
|
||||||
Subject: [PATCH] fix template with C linkage error
|
|
||||||
|
|
||||||
---
|
|
||||||
src/ukws_helper.h | 2 --
|
|
||||||
src/ukws_indicator.cpp | 2 --
|
|
||||||
src/ukws_manager.cpp | 2 --
|
|
||||||
src/ukws_window_box.h | 2 --
|
|
||||||
src/ukws_window_info.h | 2 --
|
|
||||||
src/ukws_wnck_operator.h | 2 --
|
|
||||||
src/ukws_workspace_box.h | 2 --
|
|
||||||
7 files changed, 14 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/ukws_helper.h b/src/ukws_helper.h
|
|
||||||
index 610e91c..59806de 100755
|
|
||||||
--- a/src/ukws_helper.h
|
|
||||||
+++ b/src/ukws_helper.h
|
|
||||||
@@ -20,10 +20,8 @@
|
|
||||||
#ifndef UKWS_HELPER_H
|
|
||||||
#define UKWS_HELPER_H
|
|
||||||
|
|
||||||
-extern "C" {
|
|
||||||
#include <glib.h>
|
|
||||||
#include <gdk-pixbuf/gdk-pixbuf.h>
|
|
||||||
-}
|
|
||||||
|
|
||||||
#include <QImage>
|
|
||||||
#include <QPixmap>
|
|
||||||
diff --git a/src/ukws_indicator.cpp b/src/ukws_indicator.cpp
|
|
||||||
index 65805df..f10f857 100755
|
|
||||||
--- a/src/ukws_indicator.cpp
|
|
||||||
+++ b/src/ukws_indicator.cpp
|
|
||||||
@@ -34,11 +34,9 @@
|
|
||||||
#include <QTime>
|
|
||||||
#include <QCursor>
|
|
||||||
|
|
||||||
-extern "C" {
|
|
||||||
#include <X11/X.h>
|
|
||||||
#include <X11/Xlib.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
-}
|
|
||||||
|
|
||||||
UkwsIndicator::UkwsIndicator(QWidget *parent) : QWidget(parent)
|
|
||||||
{
|
|
||||||
diff --git a/src/ukws_manager.cpp b/src/ukws_manager.cpp
|
|
||||||
index d367af0..e9cffe3 100755
|
|
||||||
--- a/src/ukws_manager.cpp
|
|
||||||
+++ b/src/ukws_manager.cpp
|
|
||||||
@@ -26,9 +26,7 @@
|
|
||||||
#include <QX11Info>
|
|
||||||
#include <QTime>
|
|
||||||
|
|
||||||
-extern "C" {
|
|
||||||
#include <X11/Xlib.h>
|
|
||||||
-}
|
|
||||||
|
|
||||||
//#define NOT_REG_WINDOW_SWITCH_HOTKEY
|
|
||||||
//#define NOT_REG_WORKSPACE_VIEW_HOTKEY
|
|
||||||
diff --git a/src/ukws_window_box.h b/src/ukws_window_box.h
|
|
||||||
index feb6a4b..d16da93 100755
|
|
||||||
--- a/src/ukws_window_box.h
|
|
||||||
+++ b/src/ukws_window_box.h
|
|
||||||
@@ -20,10 +20,8 @@
|
|
||||||
#ifndef UKWS_WINDOWBOX_H
|
|
||||||
#define UKWS_WINDOWBOX_H
|
|
||||||
|
|
||||||
-extern "C" {
|
|
||||||
#define WNCK_I_KNOW_THIS_IS_UNSTABLE
|
|
||||||
#include <libwnck/libwnck.h>
|
|
||||||
-}
|
|
||||||
|
|
||||||
#include "ukws_window_extra_label.h"
|
|
||||||
|
|
||||||
diff --git a/src/ukws_window_info.h b/src/ukws_window_info.h
|
|
||||||
index 2c6d4e6..ef590e8 100755
|
|
||||||
--- a/src/ukws_window_info.h
|
|
||||||
+++ b/src/ukws_window_info.h
|
|
||||||
@@ -20,10 +20,8 @@
|
|
||||||
#ifndef UKWS_WINDOW_INFO_H
|
|
||||||
#define UKWS_WINDOW_INFO_H
|
|
||||||
|
|
||||||
-extern "C" {
|
|
||||||
#define WNCK_I_KNOW_THIS_IS_UNSTABLE
|
|
||||||
#include <libwnck/libwnck.h>
|
|
||||||
-}
|
|
||||||
|
|
||||||
#include <QObject>
|
|
||||||
#include <QLabel>
|
|
||||||
diff --git a/src/ukws_wnck_operator.h b/src/ukws_wnck_operator.h
|
|
||||||
index 6391ad1..d75409e 100755
|
|
||||||
--- a/src/ukws_wnck_operator.h
|
|
||||||
+++ b/src/ukws_wnck_operator.h
|
|
||||||
@@ -20,10 +20,8 @@
|
|
||||||
#ifndef UKWS_WNCK_OPERATOR_H
|
|
||||||
#define UKWS_WNCK_OPERATOR_H
|
|
||||||
|
|
||||||
-extern "C" {
|
|
||||||
#define WNCK_I_KNOW_THIS_IS_UNSTABLE
|
|
||||||
#include <libwnck/libwnck.h>
|
|
||||||
-}
|
|
||||||
|
|
||||||
#include <QList>
|
|
||||||
|
|
||||||
diff --git a/src/ukws_workspace_box.h b/src/ukws_workspace_box.h
|
|
||||||
index 1023ca7..a039e06 100755
|
|
||||||
--- a/src/ukws_workspace_box.h
|
|
||||||
+++ b/src/ukws_workspace_box.h
|
|
||||||
@@ -20,11 +20,9 @@
|
|
||||||
#ifndef UKWSWORKSPACEBOX_H
|
|
||||||
#define UKWSWORKSPACEBOX_H
|
|
||||||
|
|
||||||
-extern "C" {
|
|
||||||
#define WNCK_I_KNOW_THIS_IS_UNSTABLE
|
|
||||||
#include <libwnck/libwnck.h>
|
|
||||||
#include <xcb/xcb.h>
|
|
||||||
-}
|
|
||||||
|
|
||||||
#include "ukws_window_extra_label.h"
|
|
||||||
#include "ukws_wnck_operator.h"
|
|
||||||
--
|
|
||||||
2.27.0
|
|
||||||
|
|
||||||
@ -1,149 +0,0 @@
|
|||||||
From 4b61607094dc9a9f95e4c83f72ba9a67d99519c4 Mon Sep 17 00:00:00 2001
|
|
||||||
From: tanyulong <tanyulong@kylinos.cn>
|
|
||||||
Date: Sat, 31 Jul 2021 09:56:25 +0800
|
|
||||||
Subject: [PATCH] Fix multi process contention for the DBusName in VNC
|
|
||||||
environment
|
|
||||||
|
|
||||||
---
|
|
||||||
src/main.cpp | 59 ++++++++++++++++++++++++++++++++++++++------
|
|
||||||
src/ukws_common.h | 4 +++
|
|
||||||
src/ukws_manager.cpp | 20 +++++++++------
|
|
||||||
3 files changed, 69 insertions(+), 14 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/main.cpp b/src/main.cpp
|
|
||||||
index ae0442f..4f02dc0 100755
|
|
||||||
--- a/src/main.cpp
|
|
||||||
+++ b/src/main.cpp
|
|
||||||
@@ -37,6 +37,7 @@
|
|
||||||
#include <QCommandLineOption>
|
|
||||||
#include <QCommandLineParser>
|
|
||||||
#include <QStyleFactory>
|
|
||||||
+#include <QProcess>
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <sys/file.h>
|
|
||||||
@@ -161,18 +162,62 @@ void msgHandler(QtMsgType type, const QMessageLogContext& context, const QString
|
|
||||||
abort();
|
|
||||||
}
|
|
||||||
|
|
||||||
+bool startUkws(QString serviceName) {
|
|
||||||
+ bool dbusIsReady = false;
|
|
||||||
+
|
|
||||||
+ QProcess *newUkws = new QProcess();
|
|
||||||
+ newUkws->setProgram("/usr/bin/ukui-window-switch");
|
|
||||||
+ newUkws->setStandardOutputFile("/dev/null");
|
|
||||||
+ newUkws->setStandardErrorFile("/dev/null");
|
|
||||||
+ newUkws->startDetached();
|
|
||||||
+
|
|
||||||
+ QTime curTime = QTime::currentTime();
|
|
||||||
+ curTime.start();
|
|
||||||
+
|
|
||||||
+ while (curTime.elapsed() < 1100) {
|
|
||||||
+ QDBusInterface interface(serviceName, UKWS_DBUS_PATH, UKWS_DBUS_INTERFACE,
|
|
||||||
+ QDBusConnection::sessionBus());
|
|
||||||
+ if (!interface.isValid()) {
|
|
||||||
+ usleep(250 * 1000);
|
|
||||||
+ } else {
|
|
||||||
+ dbusIsReady = true;
|
|
||||||
+ break;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if (dbusIsReady) {
|
|
||||||
+ qInfo() << "ukui-window-switch is started";
|
|
||||||
+ return true;
|
|
||||||
+ } else {
|
|
||||||
+ qInfo() << "ukui-window-switch start failed";
|
|
||||||
+ return false;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ return false;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
void handleWorkspaceView()
|
|
||||||
{
|
|
||||||
- QString object = QString(getenv("DISPLAY"));
|
|
||||||
- object = object.trimmed().replace(":", "_").replace(".", "_").replace("-", "_");
|
|
||||||
- object = "/org/ukui/WindowSwitch/display/" + object;
|
|
||||||
- QDBusInterface interface("org.ukui.WindowSwitch", object,
|
|
||||||
- "org.ukui.WindowSwitch",
|
|
||||||
+ // 根据当前的DISPLAY环境变量构造单独的DBus Name
|
|
||||||
+ QString serviceName = QString(getenv("DISPLAY"));
|
|
||||||
+ serviceName = serviceName.trimmed().replace(":", "_").replace(".", "_").replace("-", "_");
|
|
||||||
+ if (!serviceName.isEmpty())
|
|
||||||
+ serviceName = QString(UKWS_DBUS_NAME_PREFIX) + "." + serviceName;
|
|
||||||
+ else
|
|
||||||
+ serviceName = UKWS_DBUS_NAME_PREFIX;
|
|
||||||
+ qDebug() << "Access DBus:" << serviceName;
|
|
||||||
+
|
|
||||||
+ QDBusInterface interface(serviceName, UKWS_DBUS_PATH, UKWS_DBUS_INTERFACE,
|
|
||||||
QDBusConnection::sessionBus());
|
|
||||||
if (!interface.isValid()) {
|
|
||||||
- qCritical() << QDBusConnection::sessionBus().lastError().message();
|
|
||||||
- exit(1);
|
|
||||||
+ qDebug() << QDBusConnection::sessionBus().lastError().message();
|
|
||||||
+ qInfo() << "Try to start ukui-window-switch";
|
|
||||||
+ if (!startUkws(serviceName)) {
|
|
||||||
+ qCritical() << "Start ukui-window-switch failed";
|
|
||||||
+ exit(1);
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
+
|
|
||||||
//调用远程的value方法
|
|
||||||
QDBusReply<bool> reply = interface.call("handleWorkspace");
|
|
||||||
if (reply.isValid()) {
|
|
||||||
diff --git a/src/ukws_common.h b/src/ukws_common.h
|
|
||||||
index f3631ef..39c660d 100755
|
|
||||||
--- a/src/ukws_common.h
|
|
||||||
+++ b/src/ukws_common.h
|
|
||||||
@@ -34,6 +34,10 @@
|
|
||||||
#define UKWS_OBJ_NEW_WS_TITLE "new-workspace-title"
|
|
||||||
#define UKWS_OBJ_NEW_WS_LABEL "new-workspace-label"
|
|
||||||
|
|
||||||
+#define UKWS_DBUS_NAME_PREFIX "org.ukui.WindowSwitch.Display"
|
|
||||||
+#define UKWS_DBUS_PATH "/org/ukui/WindowSwitch"
|
|
||||||
+#define UKWS_DBUS_INTERFACE "org.ukui.WindowSwitch"
|
|
||||||
+
|
|
||||||
enum UkwsWidgetShowStatus {
|
|
||||||
Hidden = 0,
|
|
||||||
Shown,
|
|
||||||
diff --git a/src/ukws_manager.cpp b/src/ukws_manager.cpp
|
|
||||||
index e9cffe3..ecd4f1e 100755
|
|
||||||
--- a/src/ukws_manager.cpp
|
|
||||||
+++ b/src/ukws_manager.cpp
|
|
||||||
@@ -92,19 +92,25 @@ UkwsManager::UkwsManager(QWidget *parent) : QWidget(parent)
|
|
||||||
connect(ws, &UkwsWorkspaceManager::isHidden, this, &UkwsManager::hideWorkspace);
|
|
||||||
// connect(altChecker, &UkwsAltChecker::altReleased, this, &UkwsManager::hideIndicator);
|
|
||||||
|
|
||||||
+ // 根据当前的DISPLAY环境变量构造单独的DBus Name
|
|
||||||
+ QString serviceName = QString(getenv("DISPLAY"));
|
|
||||||
+ serviceName = serviceName.trimmed().replace(":", "_").replace(".", "_").replace("-", "_");
|
|
||||||
+ if (!serviceName.isEmpty())
|
|
||||||
+ serviceName = QString(UKWS_DBUS_NAME_PREFIX) + "." + serviceName;
|
|
||||||
+ else
|
|
||||||
+ serviceName = UKWS_DBUS_NAME_PREFIX;
|
|
||||||
+ qDebug() << "Register DBus Name:" << serviceName;
|
|
||||||
+
|
|
||||||
+
|
|
||||||
// 连接session总线
|
|
||||||
QDBusConnection connection = QDBusConnection::sessionBus();
|
|
||||||
|
|
||||||
// 在session总线上为UKWS注册服务
|
|
||||||
- if(!connection.registerService("org.ukui.WindowSwitch")) {
|
|
||||||
+ if(!connection.registerService(serviceName)) {
|
|
||||||
qCritical() << "Register DBus Service Error:" << connection.lastError().message();
|
|
||||||
}
|
|
||||||
- // 注册org.ukui.WindowSwitch服务的object,把UkwsManager类的所有公共槽函数导出为object的method
|
|
||||||
- QString object = QString(getenv("DISPLAY"));
|
|
||||||
- object = object.trimmed().replace(":", "_").replace(".", "_").replace("-", "_");
|
|
||||||
- object = "/org/ukui/WindowSwitch/display/" + object;
|
|
||||||
- qDebug() << "Register DBus:" << object;
|
|
||||||
- connection.registerObject(object, this, QDBusConnection::ExportAllSlots);
|
|
||||||
+ connection.registerObject(UKWS_DBUS_PATH, UKWS_DBUS_INTERFACE,
|
|
||||||
+ this, QDBusConnection::ExportAllSlots);
|
|
||||||
}
|
|
||||||
|
|
||||||
void UkwsManager::setConfig(UkwsConfig *config)
|
|
||||||
--
|
|
||||||
2.23.0
|
|
||||||
|
|
||||||
Binary file not shown.
BIN
ukui-window-switch-3.0.2.tar.gz
Normal file
BIN
ukui-window-switch-3.0.2.tar.gz
Normal file
Binary file not shown.
@ -1,13 +1,11 @@
|
|||||||
%define debug_package %{nil}
|
%define debug_package %{nil}
|
||||||
Name: ukui-window-switch
|
Name: ukui-window-switch
|
||||||
Version: 3.0.1
|
Version: 3.0.2
|
||||||
Release: 3
|
Release: 1
|
||||||
Summary: Front of the window switch
|
Summary: Front of the window switch
|
||||||
License: GPL-2+ BSD-2-clause BSD-3-clause and GPL-2+
|
License: GPL-2+ BSD-2-clause BSD-3-clause and GPL-2+
|
||||||
URL: http://www.ukui.org
|
URL: http://www.ukui.org
|
||||||
Source0: %{name}-%{version}.tar.gz
|
Source0: %{name}-%{version}.tar.gz
|
||||||
patch0: 0001-fix-template-with-C-linkage-error.patch
|
|
||||||
patch1: 0002-Fix-multi-process-contention-for-the-DBusName-in-VNC.patch
|
|
||||||
|
|
||||||
BuildRequires: qt5-qtbase-devel
|
BuildRequires: qt5-qtbase-devel
|
||||||
BuildRequires: libblkid-devel
|
BuildRequires: libblkid-devel
|
||||||
@ -27,8 +25,6 @@ Requires: ukwm >= 1.1.0
|
|||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q
|
%setup -q
|
||||||
%patch0 -p1
|
|
||||||
%patch1 -p1
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
qmake-qt5
|
qmake-qt5
|
||||||
@ -48,6 +44,9 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
%{_datadir}/ukui-window-switch/
|
%{_datadir}/ukui-window-switch/
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Jan 27 2022 huayadong <huayadong@kylinos.cn> - 3.0.2-1
|
||||||
|
- update to upstream version 3.0.2-1
|
||||||
|
|
||||||
* Sat Jul 31 2021 tanyulong <tanyulong@kylinos.cn> - 3.0.1-3
|
* Sat Jul 31 2021 tanyulong <tanyulong@kylinos.cn> - 3.0.1-3
|
||||||
- Fix multi process contention for the DBusName in VNC environment
|
- Fix multi process contention for the DBusName in VNC environment
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user