From unknown Thu Mar 28 22:54:16 2024 X-Loop: owner@bugs.x2go.org Subject: Bug#872: [X2Go-Dev] Bug#872: Turn xinerama.conf file related code inside X2Go Client into legacy code (for NX agents << 3.6) Reply-To: uli42@gmx.de, 872@bugs.x2go.org Resent-From: Ulrich Sibiller Resent-To: x2go-dev@lists.x2go.org Resent-CC: X2Go Developers X-Loop: owner@bugs.x2go.org Resent-Date: Mon, 18 May 2015 11:30:01 +0000 Resent-Message-ID: Resent-Sender: owner@bugs.x2go.org X-X2Go-PR-Message: followup 872 X-X2Go-PR-Package: x2goclient X-X2Go-PR-Keywords: Received: via spool by 872-submit@bugs.x2go.org id=B872.14319485515858 (code B ref 872); Mon, 18 May 2015 11:30:01 +0000 Received: (at 872) by bugs.x2go.org; 18 May 2015 11:29:11 +0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on ymir.das-netzwerkteam.de X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, FREEMAIL_REPLYTO,FREEMAIL_REPLYTO_END_DIGIT,T_DKIM_INVALID,URIBL_BLOCKED autolearn=no version=3.3.2 Received: from mail-la0-f42.google.com (mail-la0-f42.google.com [209.85.215.42]) by ymir.das-netzwerkteam.de (Postfix) with ESMTPS id B92C55DA83 for <872@bugs.x2go.org>; Mon, 18 May 2015 13:29:10 +0200 (CEST) Received: by laat2 with SMTP id t2so214334174laa.1 for <872@bugs.x2go.org>; Mon, 18 May 2015 04:29:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:in-reply-to:references:from:date:message-id :subject:to:content-type; bh=kXu+heEda8Sa6JL7O7s0IXGmYQGrR+vNRZeJCSMt/wI=; b=taK5PHmhIo+Dny29Gf4j6MRoGVmSptcPp7zVi5Uj7uYwq45Vhmvyjl73xZENWU7sc7 BND+7tarNxoCu2C8hWaM1H9RsSp6PatjXm7MdXoMwIDq1+KbB70AA36Hdhpkw1U0k3mh qKs0dokw2qCPojnyTUWjLXFpQTrOVZq2vLsdnUcFXV3Ds2LAGP9hH+y6neLxLmFPY7Oz 5PSceL1wJwCmfxxTTFy7gnCUCaqMxm3wkf5/GykQmPwj7Kqmk95XsPKOEA3qhqudi+4w 6wxOBF1PYxLGVPXHSxnJnhwptCpLM3E41B0ZFqCMs/d5ASkniSchQzZ2xoVpsEyqMDqK eKHA== X-Received: by 10.152.184.101 with SMTP id et5mr11511781lac.43.1431948550134; Mon, 18 May 2015 04:29:10 -0700 (PDT) MIME-Version: 1.0 Received: by 10.112.11.201 with HTTP; Mon, 18 May 2015 04:28:49 -0700 (PDT) In-Reply-To: <5559AF7A.9070803@phoca-gmbh.de> References: <20150515115912.Horde.GtfqM24QvRXo7Sd2CZWsHw1@mail.das-netzwerkteam.de> <55583925.1040206@phoca-gmbh.de> <20150518084055.Horde.mlraxHD7gXZTq0IPaU98Eg1@mail.das-netzwerkteam.de> <5559AF7A.9070803@phoca-gmbh.de> From: Ulrich Sibiller Date: Mon, 18 May 2015 13:28:49 +0200 Message-ID: To: Oleksandr Shneyder , 872@bugs.x2go.org Content-Type: text/plain; charset=UTF-8 On Mon, May 18, 2015 at 11:23 AM, Oleksandr Shneyder wrote: > ok, let's wait till this feature is available in nxagent and I'll put > support for it in x2go client. Ok. But can you please explain the reason for that off-by-one window size code I found (see below)? >>>> On Do 14 Mai 2015 23:32:03 CEST, Ulrich Sibiller wrote: >>>> >>>>> while testing my xinerama re-implementation I noticed that x2goclient >>>>> reports a wrong width sometimes when simply moving the window without >>>>> changing the size. The reported size differs by one pixel (too much >>>>> or too little). When running x2goclient --debug you can see this: >>>>> >>>>> x2go-DEBUG-../src/onmainwindow.cpp:10160> "New proxy geometry: (x: >>>>> 329, y: 214, w: 1440, h: 900" >>>>> x2go-DEBUG-../src/onmainwindow.cpp:10160> "New proxy geometry: (x: >>>>> 365, y: 213, w: 1440, h: 900" >>>>> x2go-DEBUG-../src/onmainwindow.cpp:10160> "New proxy geometry: (x: >>>>> 825, y: 190, w: 1440, h: 900" >>>>> x2go-DEBUG-../src/sshprocess.cpp:189> executing remote command via >>>>> SshProcess object (24): "export DISPLAY=:50;printf '\''1095 0 345 >>>>> 900\n0 0 1095 900'\'' > >>>>> $HOME/.x2go/C-uli-50-1431636769_stDKDE_dp24/xinerama.conf" >>>>> >>>>> -> here the 345 should have been a 344. >>>>> >>>>> Interestingly my patched x2goagent (that completely ignores >>>>> xinerama.conf) sees that value. So I conclude that x2goclient is >>>>> manipulating the nxproxy window size by one pixel itself. Disabling >>>>> xinerama in the session's configuration fixes the problem. >>>>> >>>>> That off-by-one behaviour is caused by this code in onmainwindow.cpp: >>>>> >>>>> void ONMainWindow::slotXineramaConfigured() >>>>> { >>>>> if (resumingSession.fullscreen) >>>>> return; >>>>> if (xinSizeInc == -1) >>>>> xinSizeInc=1; >>>>> else >>>>> xinSizeInc=-1; >>>>> #ifdef Q_OS_LINUX >>>>> >>>>> lastDisplayGeometry.setWidth(lastDisplayGeometry.width()+xinSizeInc); >>>>> XSync(QX11Info::display(),false); >>>>> XResizeWindow(QX11Info::display(), proxyWinId, >>>>> >>>>> lastDisplayGeometry.width(),lastDisplayGeometry.height()); >>>>> XSync(QX11Info::display(),false); >>>>> #endif >>>>> #ifdef Q_OS_WIN >>>>> QRect geom; >>>>> wapiWindowRect ( (HWND) proxyWinId, geom ); >>>>> wapiMoveWindow( (HWND) proxyWinId, geom.x(), geom.y(), >>>>> geom.width()+xinSizeInc, geom.height(),true); >>>>> lastDisplayGeometry=proxyWinGeometry(); >>>>> #endif >>>>> xineramaTimer->start(500); >>>>> } >>>>> >>>>> If I set xinSizeInc to zero in all cases the off-by-one behaviour is >>>>> completely gone. Why does xinSizeInc exist at all? Uli