[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#990649: marked as done (nxagent: Tricky minimize/maximize/restore issue in rootless mode)



Your message dated Sat, 03 Jul 2021 20:20:02 +0000
with message-id <E1lzm7O-0003Q8-8e@fasolo.debian.org>
and subject line Bug#990649: fixed in nx-libs 2:3.5.99.26-2
has caused the Debian Bug report #990649,
regarding nxagent: Tricky minimize/maximize/restore issue in rootless mode
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
990649: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=990649
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: nxagent
Version: 3.5.99.26-1
Serverity: important
Tags: patch

When running nxagent in rootless mode (e.g. for published server-side applications), X clients that don't use a window manager but prefer client side rendered window management controls in some case can't be closed, maximized, restored, etc.

The reason for this is a wrong translation of XIDs in nxagent for rootless session windows.

The full story is here:
https://github.com/ArcticaProject/nx-libs/issues/1015

Patch to fix this is attached.

Mike
--

DAS-NETZWERKTEAM
c\o Technik- und Ökologiezentrum Eckernförde
Mike Gabriel, Marienthaler Str. 17, 24340 Eckernförde
mobile: +49 (1520) 1976 148
landline: +49 (4351) 850 8940

GnuPG Fingerprint: 9BFB AEE8 6C0A A5FF BF22  0782 9AF4 6B30 2577 1B31
mail: mike.gabriel@das-netzwerkteam.de, http://das-netzwerkteam.de

>From 36f804e549121fb56aa71979b7da5d75f2cc7cbe Mon Sep 17 00:00:00 2001
From: Ulrich Sibiller <uli42@gmx.de>
Date: Sun, 2 May 2021 18:42:44 +0200
Subject: [PATCH] Forward ClientMessages to nxproxy side

This should help with clients requesting window manager actions like
maximizing or minimizing. This is a first version as it only handles
messages of type WM_STATE_CHANGE and _NET_WM_STATE. But ICCCM and EWMH
know some more.

The other direction, setting of properties by the WM, is already
implemented in Rootless.c.

Fixes ArcticaProject/nx-libs#1015

Signed-off-by: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
---
 nx-X11/programs/Xserver/hw/nxagent/Events.c   | 64 +++++++++++++++++++
 nx-X11/programs/Xserver/hw/nxagent/Events.h   |  2 +
 nx-X11/programs/Xserver/hw/nxagent/NXevents.c |  6 ++
 3 files changed, 72 insertions(+)

diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c
index a342cdee1..2a3654731 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Events.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c
@@ -4505,6 +4505,70 @@ int nxagentWaitEvents(Display *dpy, useconds_t msec)
   return 1;
 }
 
+void ForwardClientMessage(ClientPtr client, xSendEventReq *stuff)
+{
+    Atom netwmstate = MakeAtom("_NET_WM_STATE", strlen("_NET_WM_STATE"), False);
+    Atom wmchangestate = MakeAtom("WM_CHANGE_STATE", strlen("WM_CHANGE_STATE"), False);
+    WindowPtr pWin = (WindowPtr)SecurityLookupWindow(stuff->destination, client,
+                                                     DixReadAccess);
+
+    if (stuff->event.u.clientMessage.u.l.type == netwmstate || stuff->event.u.clientMessage.u.l.type == wmchangestate)
+    {
+        if (pWin->drawable.id == pWin->drawable.pScreen->root->drawable.id)
+        {
+            #ifdef DEBUG
+            fprintf(stderr, "%s: dest [0x%x] window [0x%x] clmsg.type [%d]->[%d]\n", __func__, stuff->destination, stuff->event.u.clientMessage.window, stuff->event.u.clientMessage.u.l.type, nxagentLocalToRemoteAtom(stuff->event.u.clientMessage.u.l.type));
+            #endif
+
+            XEvent X = {0};
+            X.xany.type = ClientMessage;
+
+            WindowPtr pWin2 = (WindowPtr)SecurityLookupWindow(stuff->event.u.clientMessage.window, client,
+                                                              DixReadAccess);
+            X.xclient.window = nxagentWindowPriv(pWin2)->window;
+            X.xclient.format = stuff->event.u.u.detail;
+            X.xclient.send_event = True;
+            X.xclient.serial = 0;
+
+            if (X.xclient.format == 32)
+            {
+                X.xclient.message_type = nxagentLocalToRemoteAtom(stuff->event.u.clientMessage.u.l.type);
+                X.xclient.data.l[0] = stuff->event.u.clientMessage.u.l.longs0;
+                X.xclient.data.l[1] = nxagentLocalToRemoteAtom(stuff->event.u.clientMessage.u.l.longs1);
+                X.xclient.data.l[2] = nxagentLocalToRemoteAtom(stuff->event.u.clientMessage.u.l.longs2);
+                X.xclient.data.l[3] = nxagentLocalToRemoteAtom(stuff->event.u.clientMessage.u.l.longs3);
+                X.xclient.data.l[4] = nxagentLocalToRemoteAtom(stuff->event.u.clientMessage.u.l.longs4);
+                //X.xclient.data.l[3] = stuff->event.u.clientMessage.u.l.longs3;
+                //X.xclient.data.l[4] = stuff->event.u.clientMessage.u.l.longs4;
+                #ifdef DEBUG
+                for (int i = 0; i < 5; i++)
+                {
+                    fprintf(stderr, "%s: data[%d] [%ld]\n", __func__, i, X.xclient.data.l[i]);
+                }
+                #endif
+            }
+            else
+                return; // ERROR!
+
+            #ifdef DEBUG
+            fprintf(stderr, "%s: window [0x%lx]\n", __func__, X.xclient.window);
+            fprintf(stderr, "%s: message_type [%ld]\n", __func__, X.xclient.message_type);
+            fprintf(stderr, "%s: format [%d]\n", __func__, X.xclient.format);
+            #endif
+
+            XlibWindow dest;
+            dest = DefaultRootWindow(nxagentDisplay);
+
+            Status stat = XSendEvent(nxagentDisplay, dest, stuff->propagate, stuff->eventMask, &X);
+            XFlush(nxagentDisplay);
+            #ifdef DEBUG
+            fprintf(stderr, "%s: send to window [0x%lx]\n", __func__, dest);
+            fprintf(stderr, "%s: return Status [%d]\n", __func__, stat);
+            #endif
+        }
+    }
+}
+
 #ifdef NX_DEBUG_INPUT
 
 void nxagentGuessDumpInputInfo(ClientPtr client, Atom property, char *data)
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.h b/nx-X11/programs/Xserver/hw/nxagent/Events.h
index 42784a8f3..a334897ec 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Events.h
+++ b/nx-X11/programs/Xserver/hw/nxagent/Events.h
@@ -222,4 +222,6 @@ int nxagentPendingEvents(Display *dpy);
 
 int nxagentWaitEvents(Display *, useconds_t msec);
 
+void ForwardClientMessage(ClientPtr client, xSendEventReq *stuff);
+
 #endif /* __Events_H__ */
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXevents.c b/nx-X11/programs/Xserver/hw/nxagent/NXevents.c
index 84414c11f..fccc718b0 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/NXevents.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/NXevents.c
@@ -425,6 +425,12 @@ ProcSendEvent(ClientPtr client)
 
     REQUEST_SIZE_MATCH(xSendEventReq);
 
+    if (nxagentOption(Rootless) && stuff->event.u.u.type == ClientMessage)
+    {
+        ForwardClientMessage(client, stuff);
+        return Success;
+    }
+
     if (stuff -> event.u.u.type == SelectionNotify)
     {
 	if (nxagentSendNotify(&stuff->event) == 1)
-- 
2.30.2

Attachment: pgped_dEgPv8b.pgp
Description: Digitale PGP-Signatur


--- End Message ---
--- Begin Message ---
Source: nx-libs
Source-Version: 2:3.5.99.26-2
Done: Mike Gabriel <sunweaver@debian.org>

We believe that the bug you reported is fixed in the latest version of
nx-libs, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 990649@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Mike Gabriel <sunweaver@debian.org> (supplier of updated nx-libs package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Sat, 03 Jul 2021 20:42:32 +0200
Source: nx-libs
Architecture: source
Version: 2:3.5.99.26-2
Distribution: unstable
Urgency: medium
Maintainer: Debian Remote Maintainers <debian-remote@lists.debian.org>
Changed-By: Mike Gabriel <sunweaver@debian.org>
Closes: 990647 990649 990650
Changes:
 nx-libs (2:3.5.99.26-2) unstable; urgency=medium
 .
   * debian/patches:
     + Add 0001_Compext.c-fix-comparisons-of-16bit-sequence-numbers.patch.
       Compext.c: fix comparisons of 16bit sequence numbers. (Closes:
       #990647).
     + Add 0002_Forward-ClientMessages-to-nxproxy-side.patch.
       Forward ClientMessages to nxproxy side. (Closes: #990649).
     + Add 0003_randr-Do-not-update-ConnectionInfo-if-NULL.patch.
       randr: Do not update ConnectionInfo if NULL (and avoid the nxagent
       Xserver from crashing). (Closes: #990650).
     + Add 0004_document-additional-options-only-nxagent-knows-about.patch.
       Update man page and --help documentation of nxproxy/nxagent.
     + Adjust 0004_document-additional-options-only-nxagent-knows-about.patch.
       Version 3.5.99.26 does not yet have the textclipboard=<bool> session
       parameter.
Checksums-Sha1:
 927a53cc9b3fcf37eac92e2713ffdb48f79b1303 3958 nx-libs_3.5.99.26-2.dsc
 7701795d92cf265cfa6771bef5f7be329ccde778 55736 nx-libs_3.5.99.26-2.debian.tar.xz
 b37db445507f9b3cc6ca948a8ce95801729e0d42 8071 nx-libs_3.5.99.26-2_source.buildinfo
Checksums-Sha256:
 2707d4785544de4238b5f5598223b5adfcd73a88aa2f546481435da0e3ff8088 3958 nx-libs_3.5.99.26-2.dsc
 e2faab033a134e81f49e4d075ee63aa701462654e4568611bbbea652d6647607 55736 nx-libs_3.5.99.26-2.debian.tar.xz
 c406ebae243d0c50d6c1bc6b10835b0dcb6c090786fade1dcb10ce361d4f0ba0 8071 nx-libs_3.5.99.26-2_source.buildinfo
Files:
 61802b1b6188d583f02997e41c558c94 3958 x11 optional nx-libs_3.5.99.26-2.dsc
 56303f7587e6708b55798f8914a42615 55736 x11 optional nx-libs_3.5.99.26-2.debian.tar.xz
 8d3c22aae27f9406abd5a05b161fc1b4 8071 x11 optional nx-libs_3.5.99.26-2_source.buildinfo

-----BEGIN PGP SIGNATURE-----

iQJJBAEBCAAzFiEEm/uu6GwKpf+/IgeCmvRrMCV3GzEFAmDgwxgVHHN1bndlYXZl
ckBkZWJpYW4ub3JnAAoJEJr0azAldxsxWY4QAICQYSV93PjF1GwXKW3bTNfrPNav
kTsa/GeB6QA5zgPSc+gt3Hp/Wdn7D+qOZR5M/kldgFnAVbo1QqDSAF+PI4FTkUjS
7RK/F4/2vgVe9N2oAq8Q7vW1ns+438sibBji1j8f5Fwuim51YHy69kFpVIe8qOi5
mA0PDlDDV4s4CGr2xk6pBk+x/GwoGbcm7rAiOM/hvAU2/av3z5ZSpGHBC4SMpBhc
y9SPtqPes1VeuFFd+jLZqz4595mfUsEZTKZGtOKdZkIRSTfZz2kn4G/ELUOYTZL8
+0kh5Db5OcaDOP/eiphcsAsV9MSFmHue4pmvE99vOe0fOWXE0H8JFdEXbJFGDPcR
4nY/5loc6Js10Gmvl854au7X6Gbuj1PMlGtS8scfmJegaExgBCQ3POrsapgq2RdP
0WbYo90psNkn227+klIykeEJdPYfwWEPaOmqUZib+zXGCdTKaANvV7+0WB/nFgXo
xZAP2WJtzblP6kgbSoHKJOyt/Veh3NtTu+jqRujnJd31WUQpy3x+mpG5kl9sVpvI
tUp0RBnfvXw0N7RO5sKBi83T3MUeO6VUX9rPyyz5VjinMs0VOEYsFtE1xrVaEVyu
bhFryKt5hJeLJyAStIJXZ+TacnPcfWssX+8U8N0cp83wQxbmBjdGH6Z1+jJlw2E1
R9L9mkOxw8UAscHp
=ipHS
-----END PGP SIGNATURE-----

--- End Message ---

Reply to: