Hrvoje Senjan 2014-10-04 18:42:17 +00:00 committed by Git OBS Bridge
parent 659a127469
commit 361194b8b3
8 changed files with 17 additions and 728 deletions

View File

@ -1,77 +0,0 @@
From b2db22fd2598fb64a89f4b2c6d30f0d5b442a86c Mon Sep 17 00:00:00 2001
From: Volker Krause <vkrause@kde.org>
Date: Sun, 14 Sep 2014 16:48:38 +0200
Subject: [PATCH 01/13] Make constants const, saves a few symbols in the .data
section.
---
src/kwindoweffects_x11.cpp | 2 +-
src/kwindowsystem_x11.cpp | 8 ++++----
src/netwm.cpp | 2 +-
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/kwindoweffects_x11.cpp b/src/kwindoweffects_x11.cpp
index 66aaca3..661a0af 100644
--- a/src/kwindoweffects_x11.cpp
+++ b/src/kwindoweffects_x11.cpp
@@ -29,7 +29,7 @@
#include <QX11Info>
#include <QMatrix4x4>
-static const char *DASHBOARD_WIN_CLASS = "dashboard\0dashboard";
+static const char DASHBOARD_WIN_CLASS[] = "dashboard\0dashboard";
using namespace KWindowEffects;
KWindowEffectsPrivateX11::KWindowEffectsPrivateX11()
diff --git a/src/kwindowsystem_x11.cpp b/src/kwindowsystem_x11.cpp
index 46fbc7d..db77003 100644
--- a/src/kwindowsystem_x11.cpp
+++ b/src/kwindowsystem_x11.cpp
@@ -50,7 +50,7 @@
static Atom net_wm_cm;
static void create_atoms(Display *dpy = QX11Info::display());
-static NET::Properties windowsProperties = NET::ClientList | NET::ClientListStacking |
+static const NET::Properties windowsProperties = NET::ClientList | NET::ClientListStacking |
NET::Supported |
NET::NumberOfDesktops |
NET::DesktopGeometry |
@@ -59,11 +59,11 @@ static NET::Properties windowsProperties = NET::ClientList | NET::ClientListStac
NET::DesktopNames |
NET::ActiveWindow |
NET::WorkArea;
-static NET::Properties2 windowsProperties2 = NET::WM2ShowingDesktop;
+static const NET::Properties2 windowsProperties2 = NET::WM2ShowingDesktop;
// ClientList and ClientListStacking is not per-window information, but a desktop information,
// so track it even with only INFO_BASIC
-static NET::Properties desktopProperties = NET::ClientList | NET::ClientListStacking |
+static const NET::Properties desktopProperties = NET::ClientList | NET::ClientListStacking |
NET::Supported |
NET::NumberOfDesktops |
NET::DesktopGeometry |
@@ -72,7 +72,7 @@ static NET::Properties desktopProperties = NET::ClientList | NET::ClientListStac
NET::DesktopNames |
NET::ActiveWindow |
NET::WorkArea;
-static NET::Properties2 desktopProperties2 = NET::WM2ShowingDesktop;
+static const NET::Properties2 desktopProperties2 = NET::WM2ShowingDesktop;
MainThreadInstantiator::MainThreadInstantiator(KWindowSystemPrivateX11::FilterInfo _what)
: QObject(),
diff --git a/src/netwm.cpp b/src/netwm.cpp
index a0a2fae..07e5254 100644
--- a/src/netwm.cpp
+++ b/src/netwm.cpp
@@ -4771,7 +4771,7 @@ void NETWinInfo::setActivities(const char *activities)
if (activities == (char *) NULL || activities[0] == '\0') {
// on all activities
- static const char *nulluuid = KDE_ALL_ACTIVITIES_UUID;
+ static const char nulluuid[] = KDE_ALL_ACTIVITIES_UUID;
p->activities = nstrdup(nulluuid);
--
2.1.0

View File

@ -1,198 +0,0 @@
From 512b7c17dd3d02d5c49b2b34cbb155f7ad754115 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= <mgraesslin@kde.org>
Date: Fri, 12 Sep 2014 11:39:55 +0200
Subject: [PATCH 02/13] Add support for urgency hint in NETWinInfo
UrgencyHint is part of WM_HINTS property which is already processed
for WM2GroupLeader.
REVIEW: 120158
CHANGELOG: NETWinInfo provides convenient wrapper for urgency hint of WM_HINTS property.
---
autotests/netwininfotestclient.cpp | 42 ++++++++++++++++++++++++++++++++++++++
src/netwm.cpp | 13 ++++++++++--
src/netwm.h | 8 ++++++++
src/netwm_def.h | 2 ++
src/netwm_p.h | 1 +
5 files changed, 64 insertions(+), 2 deletions(-)
diff --git a/autotests/netwininfotestclient.cpp b/autotests/netwininfotestclient.cpp
index 160f759..8a39ba5 100644
--- a/autotests/netwininfotestclient.cpp
+++ b/autotests/netwininfotestclient.cpp
@@ -78,6 +78,8 @@ private Q_SLOTS:
void testWindowClass();
void testClientMachine();
void testGroupLeader();
+ void testUrgency_data();
+ void testUrgency();
void testTransientFor();
private:
@@ -665,6 +667,46 @@ void NetWinInfoTestClient::testGroupLeader()
QCOMPARE(info.groupLeader(), m_rootWindow);
}
+void NetWinInfoTestClient::testUrgency_data()
+{
+ QTest::addColumn<quint32>("flags");
+ QTest::addColumn<bool>("expected");
+
+ QTest::newRow("urgency") << quint32(1 << 8) << true;
+ QTest::newRow("none") << quint32(0) << false;
+ QTest::newRow("group_urgency") << quint32((1 << 6) | (1 << 8)) << true;
+ QTest::newRow("input") << quint32(1) << false;
+}
+
+void NetWinInfoTestClient::testUrgency()
+{
+ QVERIFY(connection());
+ INFO
+
+ QVERIFY(!info.urgency());
+ QFETCH(quint32, flags);
+
+ // group leader needs to be changed through wm hints
+ uint32_t values[] = {
+ flags,
+ 1, /* Input */
+ 1, /* Normal State */
+ XCB_NONE, /* icon pixmap */
+ XCB_NONE, /* icon window */
+ XCB_NONE, /* icon x */
+ XCB_NONE, /* icon y */
+ XCB_NONE, /* icon mask */
+ XCB_NONE /* group leader */
+ };
+ xcb_change_property(connection(), XCB_PROP_MODE_REPLACE, m_testWindow,
+ XCB_ATOM_WM_HINTS, XCB_ATOM_WM_HINTS, 32, 9, values);
+ xcb_flush(connection());
+
+ // only updated after event
+ waitForPropertyChange(&info, XCB_ATOM_WM_HINTS, NET::Property(0), NET::WM2Urgency);
+ QTEST(info.urgency(), "expected");
+}
+
void NetWinInfoTestClient::testTransientFor()
{
QVERIFY(connection());
diff --git a/src/netwm.cpp b/src/netwm.cpp
index 07e5254..0e77a95 100644
--- a/src/netwm.cpp
+++ b/src/netwm.cpp
@@ -2763,6 +2763,7 @@ NETWinInfo::NETWinInfo(xcb_connection_t *connection, xcb_window_t window, xcb_wi
p->icon_sizes = NULL;
p->activities = (char *) 0;
p->blockCompositing = false;
+ p->urgency = false;
// p->strut.left = p->strut.right = p->strut.top = p->strut.bottom = 0;
// p->frame_strut.left = p->frame_strut.right = p->frame_strut.top =
@@ -2822,6 +2823,7 @@ NETWinInfo::NETWinInfo(xcb_connection_t *connection, xcb_window_t window, xcb_wi
p->icon_sizes = NULL;
p->activities = (char *) 0;
p->blockCompositing = false;
+ p->urgency = false;
// p->strut.left = p->strut.right = p->strut.top = p->strut.bottom = 0;
// p->frame_strut.left = p->frame_strut.right = p->frame_strut.top =
@@ -3917,6 +3919,7 @@ void NETWinInfo::event(xcb_generic_event_t *event, NET::Properties *properties,
dirty2 |= WM2UserTime;
} else if (pe->atom == XCB_ATOM_WM_HINTS) {
dirty2 |= WM2GroupLeader;
+ dirty2 |= WM2Urgency;
} else if (pe->atom == XCB_ATOM_WM_TRANSIENT_FOR) {
dirty2 |= WM2TransientFor;
} else if (pe->atom == XCB_ATOM_WM_CLASS) {
@@ -4093,7 +4096,7 @@ void NETWinInfo::update(NET::Properties dirtyProperties, NET::Properties2 dirtyP
cookies[c++] = xcb_get_property(p->conn, false, p->window, XCB_ATOM_WM_TRANSIENT_FOR, XCB_ATOM_WINDOW, 0, 1);
}
- if (dirty2 & WM2GroupLeader) {
+ if (dirty2 & (WM2GroupLeader | WM2Urgency)) {
cookies[c++] = xcb_get_property(p->conn, false, p->window, XCB_ATOM_WM_HINTS, XCB_ATOM_WM_HINTS, 0, 9);
}
@@ -4547,7 +4550,7 @@ void NETWinInfo::update(NET::Properties dirtyProperties, NET::Properties2 dirtyP
p->transient_for = get_value_reply<xcb_window_t>(p->conn, cookies[c++], XCB_ATOM_WINDOW, 0);
}
- if (dirty2 & WM2GroupLeader) {
+ if (dirty2 & (WM2GroupLeader | WM2Urgency)) {
xcb_get_property_reply_t *reply = xcb_get_property_reply(p->conn, cookies[c++], 0);
if (reply && reply->format == 32 && reply->value_len == 9 && reply->type == XCB_ATOM_WM_HINTS) {
@@ -4556,6 +4559,7 @@ void NETWinInfo::update(NET::Properties dirtyProperties, NET::Properties2 dirtyP
if (hints->flags & (1 << 6)/*WindowGroupHint*/) {
p->window_group = hints->window_group;
}
+ p->urgency = (hints->flags & (1 << 8)/*UrgencyHint*/);
}
if (reply) {
@@ -4740,6 +4744,11 @@ xcb_window_t NETWinInfo::groupLeader() const
return p->window_group;
}
+bool NETWinInfo::urgency() const
+{
+ return p->urgency;
+}
+
const char *NETWinInfo::windowClassClass() const
{
return p->class_class;
diff --git a/src/netwm.h b/src/netwm.h
index 0c89dc7..ba97db1 100644
--- a/src/netwm.h
+++ b/src/netwm.h
@@ -1373,6 +1373,14 @@ public:
xcb_window_t groupLeader() const;
/**
+ * Returns whether the UrgencyHint is set in the WM_HINTS.flags.
+ * See ICCCM 4.1.2.4.
+ *
+ * @since 5.3
+ **/
+ bool urgency() const;
+
+ /**
* Returns the class component of the window class for the window
* (i.e. WM_CLASS property).
*/
diff --git a/src/netwm_def.h b/src/netwm_def.h
index 0edadc0..9e14634 100644
--- a/src/netwm_def.h
+++ b/src/netwm_def.h
@@ -675,6 +675,7 @@ public:
@li WM2DesktopLayout _NET_DESKTOP_LAYOUT
@li WM2FullPlacement _NET_WM_FULL_PLACEMENT
@li WM2FullscreenMonitors _NET_WM_FULLSCREEN_MONITORS
+ @li WM2Urgency urgency hint in WM_HINTS (see ICCCM 4.1.2.4)
**/
enum Property2 {
WM2UserTime = 1u << 0,
@@ -698,6 +699,7 @@ public:
WM2Activities = 1u << 18, // NOT STANDARD @since 4.6
WM2BlockCompositing = 1u << 19, // NOT STANDARD @since 4.7
WM2KDEShadow = 1u << 20, // NOT Standard @since 4.7
+ WM2Urgency = 1u << 21, // @since 5.3
WM2AllProperties = ~0u
};
Q_DECLARE_FLAGS(Properties2, Property2)
diff --git a/src/netwm_p.h b/src/netwm_p.h
index 2e4659e..36ffb8d 100644
--- a/src/netwm_p.h
+++ b/src/netwm_p.h
@@ -165,6 +165,7 @@ struct NETWinInfoPrivate {
const char *activities;
bool blockCompositing;
+ bool urgency;
int ref;
};
--
2.1.0

View File

@ -1,209 +0,0 @@
From fc189fa9ccd34ca50ef7999139d55a393054c37a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= <mgraesslin@kde.org>
Date: Fri, 12 Sep 2014 13:24:29 +0200
Subject: [PATCH 03/13] Add support for input hint in NETWinInfo
The Input Hint is part of WM_HINTS property which is already processed
for WM2GroupLeader and WM2Urgency.
The default for input hint is true. ICCCM suggests to assume convenient
values for all fields of WM_HINTS property if a window is mapped wihtout
one. KWin sets this value to true, so the sane convenient value for the
input field seems to be true.
REVIEW: 120165
CHANGELOG: NETWinInfo provides convenient wrapper for input hint of WM_HINTS property.
---
autotests/netwininfotestclient.cpp | 46 ++++++++++++++++++++++++++++++++++++++
src/netwm.cpp | 15 +++++++++++--
src/netwm.h | 10 +++++++++
src/netwm_def.h | 2 ++
src/netwm_p.h | 1 +
5 files changed, 72 insertions(+), 2 deletions(-)
diff --git a/autotests/netwininfotestclient.cpp b/autotests/netwininfotestclient.cpp
index 8a39ba5..e35ab8d 100644
--- a/autotests/netwininfotestclient.cpp
+++ b/autotests/netwininfotestclient.cpp
@@ -80,6 +80,8 @@ private Q_SLOTS:
void testGroupLeader();
void testUrgency_data();
void testUrgency();
+ void testInput_data();
+ void testInput();
void testTransientFor();
private:
@@ -707,6 +709,50 @@ void NetWinInfoTestClient::testUrgency()
QTEST(info.urgency(), "expected");
}
+void NetWinInfoTestClient::testInput_data()
+{
+ QTest::addColumn<quint32>("flags");
+ QTest::addColumn<quint32>("input");
+ QTest::addColumn<bool>("expected");
+
+ QTest::newRow("flag_input") << quint32(1) << quint32(1) << true;
+ QTest::newRow("flag_noinput") << quint32(1) << quint32(0) << false;
+ QTest::newRow("noflag_input") << quint32(0) << quint32(1) << true;
+ QTest::newRow("noflag_noinput") << quint32(0) << quint32(0) << true;
+ QTest::newRow("flag_with_other_input") << quint32(1 | 1 << 8) << quint32(1) << true;
+ QTest::newRow("flag_with_other_noinput") << quint32(1 | 1 << 8) << quint32(0) << false;
+}
+
+void NetWinInfoTestClient::testInput()
+{
+ QVERIFY(connection());
+ INFO
+
+ QVERIFY(info.input());
+ QFETCH(quint32, flags);
+ QFETCH(quint32, input);
+
+ // group leader needs to be changed through wm hints
+ uint32_t values[] = {
+ flags,
+ input, /* Input */
+ 1, /* Normal State */
+ XCB_NONE, /* icon pixmap */
+ XCB_NONE, /* icon window */
+ XCB_NONE, /* icon x */
+ XCB_NONE, /* icon y */
+ XCB_NONE, /* icon mask */
+ XCB_NONE /* group leader */
+ };
+ xcb_change_property(connection(), XCB_PROP_MODE_REPLACE, m_testWindow,
+ XCB_ATOM_WM_HINTS, XCB_ATOM_WM_HINTS, 32, 9, values);
+ xcb_flush(connection());
+
+ // only updated after event
+ waitForPropertyChange(&info, XCB_ATOM_WM_HINTS, NET::Property(0), NET::WM2Urgency);
+ QTEST(info.input(), "expected");
+}
+
void NetWinInfoTestClient::testTransientFor()
{
QVERIFY(connection());
diff --git a/src/netwm.cpp b/src/netwm.cpp
index 0e77a95..1431cf6 100644
--- a/src/netwm.cpp
+++ b/src/netwm.cpp
@@ -2764,6 +2764,7 @@ NETWinInfo::NETWinInfo(xcb_connection_t *connection, xcb_window_t window, xcb_wi
p->activities = (char *) 0;
p->blockCompositing = false;
p->urgency = false;
+ p->input = true;
// p->strut.left = p->strut.right = p->strut.top = p->strut.bottom = 0;
// p->frame_strut.left = p->frame_strut.right = p->frame_strut.top =
@@ -2824,6 +2825,7 @@ NETWinInfo::NETWinInfo(xcb_connection_t *connection, xcb_window_t window, xcb_wi
p->activities = (char *) 0;
p->blockCompositing = false;
p->urgency = false;
+ p->input = true;
// p->strut.left = p->strut.right = p->strut.top = p->strut.bottom = 0;
// p->frame_strut.left = p->frame_strut.right = p->frame_strut.top =
@@ -3920,6 +3922,7 @@ void NETWinInfo::event(xcb_generic_event_t *event, NET::Properties *properties,
} else if (pe->atom == XCB_ATOM_WM_HINTS) {
dirty2 |= WM2GroupLeader;
dirty2 |= WM2Urgency;
+ dirty2 |= WM2Input;
} else if (pe->atom == XCB_ATOM_WM_TRANSIENT_FOR) {
dirty2 |= WM2TransientFor;
} else if (pe->atom == XCB_ATOM_WM_CLASS) {
@@ -4096,7 +4099,7 @@ void NETWinInfo::update(NET::Properties dirtyProperties, NET::Properties2 dirtyP
cookies[c++] = xcb_get_property(p->conn, false, p->window, XCB_ATOM_WM_TRANSIENT_FOR, XCB_ATOM_WINDOW, 0, 1);
}
- if (dirty2 & (WM2GroupLeader | WM2Urgency)) {
+ if (dirty2 & (WM2GroupLeader | WM2Urgency | WM2Input)) {
cookies[c++] = xcb_get_property(p->conn, false, p->window, XCB_ATOM_WM_HINTS, XCB_ATOM_WM_HINTS, 0, 9);
}
@@ -4550,12 +4553,15 @@ void NETWinInfo::update(NET::Properties dirtyProperties, NET::Properties2 dirtyP
p->transient_for = get_value_reply<xcb_window_t>(p->conn, cookies[c++], XCB_ATOM_WINDOW, 0);
}
- if (dirty2 & (WM2GroupLeader | WM2Urgency)) {
+ if (dirty2 & (WM2GroupLeader | WM2Urgency | WM2Input)) {
xcb_get_property_reply_t *reply = xcb_get_property_reply(p->conn, cookies[c++], 0);
if (reply && reply->format == 32 && reply->value_len == 9 && reply->type == XCB_ATOM_WM_HINTS) {
kde_wm_hints *hints = reinterpret_cast<kde_wm_hints *>(xcb_get_property_value(reply));
+ if (hints->flags & (1 << 0)/*Input*/) {
+ p->input = hints->input;
+ }
if (hints->flags & (1 << 6)/*WindowGroupHint*/) {
p->window_group = hints->window_group;
}
@@ -4749,6 +4755,11 @@ bool NETWinInfo::urgency() const
return p->urgency;
}
+bool NETWinInfo::input() const
+{
+ return p->input;
+}
+
const char *NETWinInfo::windowClassClass() const
{
return p->class_class;
diff --git a/src/netwm.h b/src/netwm.h
index ba97db1..436ad2f 100644
--- a/src/netwm.h
+++ b/src/netwm.h
@@ -1381,6 +1381,16 @@ public:
bool urgency() const;
/**
+ * Returns whether the Input flag is set in WM_HINTS.
+ * See ICCCM 4.1.2.4 and 4.1.7.
+ *
+ * The default value is @c true in case the Client is mapped without a WM_HINTS property.
+ *
+ * @since 5.3
+ **/
+ bool input() const;
+
+ /**
* Returns the class component of the window class for the window
* (i.e. WM_CLASS property).
*/
diff --git a/src/netwm_def.h b/src/netwm_def.h
index 9e14634..12abfff 100644
--- a/src/netwm_def.h
+++ b/src/netwm_def.h
@@ -676,6 +676,7 @@ public:
@li WM2FullPlacement _NET_WM_FULL_PLACEMENT
@li WM2FullscreenMonitors _NET_WM_FULLSCREEN_MONITORS
@li WM2Urgency urgency hint in WM_HINTS (see ICCCM 4.1.2.4)
+ @li WM2Input input hint (input in WM_HINTS, see ICCCM 4.1.2.4)
**/
enum Property2 {
WM2UserTime = 1u << 0,
@@ -700,6 +701,7 @@ public:
WM2BlockCompositing = 1u << 19, // NOT STANDARD @since 4.7
WM2KDEShadow = 1u << 20, // NOT Standard @since 4.7
WM2Urgency = 1u << 21, // @since 5.3
+ WM2Input = 1u << 22, // @since 5.3
WM2AllProperties = ~0u
};
Q_DECLARE_FLAGS(Properties2, Property2)
diff --git a/src/netwm_p.h b/src/netwm_p.h
index 36ffb8d..a586450 100644
--- a/src/netwm_p.h
+++ b/src/netwm_p.h
@@ -166,6 +166,7 @@ struct NETWinInfoPrivate {
const char *activities;
bool blockCompositing;
bool urgency;
+ bool input;
int ref;
};
--
2.1.0

View File

@ -1,227 +0,0 @@
From 59cb063b99e6ec13c0bc3cf3fd95a01258184e86 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= <mgraesslin@kde.org>
Date: Fri, 12 Sep 2014 16:04:01 +0200
Subject: [PATCH 07/13] Add support for protocols to NETWinInfo
NETWinInfo is now able to read all known protocols set on WM_PROTOCOLS
property and provides the set protocols as flags.
So far the following protocols are supported:
* WM_TAKE_FOCUS (ICCCM 4.1.2.7)
* WM_DELETE_WINDOW (ICCCM 4.1.2.7)
* _NET_WM_SYNC_REQUEST (EWMH)
* _NET_WM_PING (EWMH)
* _NET_WM_CONTEXT_HELP (KDE specific extension to EWMH)
REVIEW: 120213
CHANGELOG: NETWinInfo provides convenient wrapper for WM_PROTOCOLS.
---
src/netwm.cpp | 46 +++++++++++++-
src/netwm.h | 13 ++++
src/netwm_def.h | 19 ++++++
src/netwm_p.h | 1 +
5 files changed, 201 insertions(+), 1 deletion(-)
diff --git a/src/netwm.cpp b/src/netwm.cpp
index 1431cf6..3107a23 100644
--- a/src/netwm.cpp
+++ b/src/netwm.cpp
@@ -118,7 +118,11 @@ static xcb_atom_t kde_net_wm_shadow = 0;
// application protocols
static xcb_atom_t wm_protocols = 0;
+static xcb_atom_t wm_take_focus = 0;
+static xcb_atom_t wm_delete_window = 0;
static xcb_atom_t net_wm_ping = 0;
+static xcb_atom_t net_wm_sync_request = 0;
+static xcb_atom_t net_wm_context_help = 0;
// application window types
static xcb_atom_t net_wm_window_type_normal = 0;
@@ -382,7 +386,7 @@ static QByteArray get_atom_name(xcb_connection_t *c, xcb_atom_t atom)
}
#endif
-static const int netAtomCount = 88;
+static const int netAtomCount = 91;
static void create_netwm_atoms(xcb_connection_t *c)
{
@@ -481,6 +485,10 @@ static void create_netwm_atoms(xcb_connection_t *c)
{ "WM_STATE", &xa_wm_state },
{ "WM_PROTOCOLS", &wm_protocols },
+ { "WM_TAKE_FOCUS", &wm_take_focus },
+ { "WM_DELETE_WINDOW", &wm_delete_window },
+ { "_NET_WM_SYNC_REQUEST", &net_wm_sync_request },
+ { "_NET_WM_CONTEXT_HELP", &net_wm_context_help },
{ "_NET_WM_FULL_PLACEMENT", &net_wm_full_placement },
{ "_KDE_NET_WM_ACTIVITIES", &kde_net_wm_activities },
@@ -2765,6 +2773,7 @@ NETWinInfo::NETWinInfo(xcb_connection_t *connection, xcb_window_t window, xcb_wi
p->blockCompositing = false;
p->urgency = false;
p->input = true;
+ p->protocols = NET::NoProtocol;
// p->strut.left = p->strut.right = p->strut.top = p->strut.bottom = 0;
// p->frame_strut.left = p->frame_strut.right = p->frame_strut.top =
@@ -2826,6 +2835,7 @@ NETWinInfo::NETWinInfo(xcb_connection_t *connection, xcb_window_t window, xcb_wi
p->blockCompositing = false;
p->urgency = false;
p->input = true;
+ p->protocols = NET::NoProtocol;
// p->strut.left = p->strut.right = p->strut.top = p->strut.bottom = 0;
// p->frame_strut.left = p->frame_strut.right = p->frame_strut.top =
@@ -3937,6 +3947,8 @@ void NETWinInfo::event(xcb_generic_event_t *event, NET::Properties *properties,
dirty2 |= WM2BlockCompositing;
} else if (pe->atom == kde_net_wm_shadow) {
dirty2 |= WM2KDEShadow;
+ } else if (pe->atom == wm_protocols) {
+ dirty2 |= WM2Protocols;
}
do_update = true;
@@ -4115,6 +4127,10 @@ void NETWinInfo::update(NET::Properties dirtyProperties, NET::Properties2 dirtyP
cookies[c++] = xcb_get_property(p->conn, false, p->window, XCB_ATOM_WM_CLIENT_MACHINE, XCB_ATOM_STRING, 0, MAX_PROP_SIZE);
}
+ if (dirty2 & WM2Protocols) {
+ cookies[c++] = xcb_get_property(p->conn, false, p->window, wm_protocols, XCB_ATOM_ATOM, 0, 2048);
+ }
+
c = 0;
if (dirty & XAWMState) {
@@ -4605,6 +4621,24 @@ void NETWinInfo::update(NET::Properties dirtyProperties, NET::Properties2 dirtyP
p->client_machine = nstrndup(value.constData(), value.length());
}
}
+
+ if (dirty2 & WM2Protocols) {
+ const QVector<xcb_atom_t> protocols = get_array_reply<xcb_atom_t>(p->conn, cookies[c++], XCB_ATOM_ATOM);
+ p->protocols = NET::NoProtocol;
+ for (auto it = protocols.begin(); it != protocols.end(); ++it) {
+ if ((*it) == wm_take_focus) {
+ p->protocols |= TakeFocusProtocol;
+ } else if ((*it) == wm_delete_window) {
+ p->protocols |= DeleteWindowProtocol;
+ } else if ((*it) == net_wm_ping) {
+ p->protocols |= PingProtocol;
+ } else if ((*it) == net_wm_sync_request) {
+ p->protocols |= SyncRequestProtocol;
+ } else if ((*it) == net_wm_context_help) {
+ p->protocols |= ContextHelpProtocol;
+ }
+ }
+ }
}
NETRect NETWinInfo::iconGeometry() const
@@ -4845,6 +4879,16 @@ NET::MappingState NETWinInfo::mappingState() const
return p->mapping_state;
}
+NET::Protocols NETWinInfo::protocols() const
+{
+ return p->protocols;
+}
+
+bool NETWinInfo::supportsProtocol(NET::Protocol protocol) const
+{
+ return p->protocols.testFlag(protocol);
+}
+
void NETRootInfo::virtual_hook(int, void *)
{
/*BASE::virtual_hook( id, data );*/
diff --git a/src/netwm.h b/src/netwm.h
index 436ad2f..0535c39 100644
--- a/src/netwm.h
+++ b/src/netwm.h
@@ -1519,6 +1519,19 @@ public:
NET::Properties event(xcb_generic_event_t *event);
/**
+ * @returns The window manager protocols this Client supports.
+ * @since 5.3
+ **/
+ NET::Protocols protocols() const;
+
+ /**
+ * @returns @c true if the Client supports the @p protocol.
+ * @param protocol The window manager protocol to test for
+ * @since 5.3
+ **/
+ bool supportsProtocol(NET::Protocol protocol) const;
+
+ /**
Sentinel value to indicate that the client wishes to be visible on
all desktops.
diff --git a/src/netwm_def.h b/src/netwm_def.h
index 12abfff..c8b1ba0 100644
--- a/src/netwm_def.h
+++ b/src/netwm_def.h
@@ -677,6 +677,7 @@ public:
@li WM2FullscreenMonitors _NET_WM_FULLSCREEN_MONITORS
@li WM2Urgency urgency hint in WM_HINTS (see ICCCM 4.1.2.4)
@li WM2Input input hint (input in WM_HINTS, see ICCCM 4.1.2.4)
+ @li WM2Protocols see NET::Protocol
**/
enum Property2 {
WM2UserTime = 1u << 0,
@@ -702,6 +703,7 @@ public:
WM2KDEShadow = 1u << 20, // NOT Standard @since 4.7
WM2Urgency = 1u << 21, // @since 5.3
WM2Input = 1u << 22, // @since 5.3
+ WM2Protocols = 1u << 23, // @since 5.3
WM2AllProperties = ~0u
};
Q_DECLARE_FLAGS(Properties2, Property2)
@@ -750,6 +752,22 @@ public:
};
/**
+ * Protocols supported by the client.
+ * See ICCCM 4.1.2.7.
+ *
+ * @since 5.3
+ **/
+ enum Protocol {
+ NoProtocol = 0,
+ TakeFocusProtocol = 1 << 0, ///< WM_TAKE_FOCUS
+ DeleteWindowProtocol = 1 << 1, ///< WM_DELETE_WINDOW
+ PingProtocol = 1 << 2, ///< _NET_WM_PING from EWMH
+ SyncRequestProtocol = 1 << 3, ///< _NET_WM_SYNC_REQUEST from EWMH
+ ContextHelpProtocol = 1 << 4 ///< _NET_WM_CONTEXT_HELP, NON STANDARD!
+ };
+ Q_DECLARE_FLAGS(Protocols, Protocol)
+
+ /**
Compares two X timestamps, taking into account wrapping and 64bit architectures.
Return value is like with strcmp(), 0 for equal, -1 for time1 < time2, 1 for time1 > time2.
*/
@@ -767,5 +785,6 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(NET::Properties2)
Q_DECLARE_OPERATORS_FOR_FLAGS(NET::WindowTypes)
Q_DECLARE_OPERATORS_FOR_FLAGS(NET::States)
Q_DECLARE_OPERATORS_FOR_FLAGS(NET::Actions)
+Q_DECLARE_OPERATORS_FOR_FLAGS(NET::Protocols)
#endif // netwm_def_h
diff --git a/src/netwm_p.h b/src/netwm_p.h
index a586450..3bb8213 100644
--- a/src/netwm_p.h
+++ b/src/netwm_p.h
@@ -167,6 +167,7 @@ struct NETWinInfoPrivate {
bool blockCompositing;
bool urgency;
bool input;
+ NET::Protocols protocols;
int ref;
};
--
2.1.0

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3a6bf862574161f36377babd2ca389adf86c897232c07e34424f2f208d798f6a
size 2739036

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c8670f95e87569152631977407b763e33e3d28191ab2d43e2e6072591bde5264
size 157816

View File

@ -1,3 +1,15 @@
-------------------------------------------------------------------
Sat Oct 4 17:59:57 UTC 2014 - hrvoje.senjan@gmail.com
- Update to 5.3.0
* For more details please see:
https://www.kde.org/announcements/kde-frameworks-5.3.0.php
- Drop patches merged upstream:
0001-Make-constants-const-saves-a-few-symbols-in-the-.dat.patch,
0002-Add-support-for-urgency-hint-in-NETWinInfo.patch,
0003-Add-support-for-input-hint-in-NETWinInfo.patch and
0007-Add-support-for-protocols-to-NETWinInfo.patch
------------------------------------------------------------------- -------------------------------------------------------------------
Wed Sep 24 19:25:07 UTC 2014 - hrvoje.senjan@gmail.com Wed Sep 24 19:25:07 UTC 2014 - hrvoje.senjan@gmail.com

View File

@ -18,10 +18,10 @@
%define lname libKF5WindowSystem5 %define lname libKF5WindowSystem5
Name: kwindowsystem Name: kwindowsystem
Version: 5.2.0 Version: 5.3.0
Release: 0 Release: 0
BuildRequires: cmake >= 2.8.12 BuildRequires: cmake >= 2.8.12
BuildRequires: extra-cmake-modules >= 1.2.0 BuildRequires: extra-cmake-modules >= 1.3.0
BuildRequires: fdupes BuildRequires: fdupes
BuildRequires: kf5-filesystem BuildRequires: kf5-filesystem
BuildRequires: libqt5-linguist-devel >= 5.2.0 BuildRequires: libqt5-linguist-devel >= 5.2.0
@ -39,14 +39,6 @@ Group: System/GUI/KDE
Url: http://www.kde.org Url: http://www.kde.org
Source: http://download.kde.org/stable/frameworks/%{version}/%{name}-%{version}.tar.xz Source: http://download.kde.org/stable/frameworks/%{version}/%{name}-%{version}.tar.xz
Source1: baselibs.conf Source1: baselibs.conf
# PATCH-FIX-UPSTREAM 0001-Make-constants-const-saves-a-few-symbols-in-the-.dat.patch
Patch0: 0001-Make-constants-const-saves-a-few-symbols-in-the-.dat.patch
# PATCH-FIX-UPSTREAM 0002-Add-support-for-urgency-hint-in-NETWinInfo.patch
Patch1: 0002-Add-support-for-urgency-hint-in-NETWinInfo.patch
# PATCH-FIX-UPSTREAM 0003-Add-support-for-input-hint-in-NETWinInfo.patch
Patch2: 0003-Add-support-for-input-hint-in-NETWinInfo.patch
# PATCH-FIX-UPSTREAM 0007-Add-support-for-protocols-to-NETWinInfo.patch
Patch3: 0007-Add-support-for-protocols-to-NETWinInfo.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description %description
@ -89,10 +81,6 @@ Development files.
%lang_package -n %lname %lang_package -n %lname
%prep %prep
%setup -q %setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%build %build
%cmake_kf5 -d build -- -Dlconvert_executable=%{_kf5_libdir}/qt5/bin/lconvert %cmake_kf5 -d build -- -Dlconvert_executable=%{_kf5_libdir}/qt5/bin/lconvert