NetBSD Problem Report #58467
From www@netbsd.org Thu Jul 25 12:24:57 2024
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256
client-signature RSA-PSS (2048 bits) client-digest SHA256)
(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
by mollari.NetBSD.org (Postfix) with ESMTPS id 3BF471A9239
for <gnats-bugs@gnats.NetBSD.org>; Thu, 25 Jul 2024 12:24:57 +0000 (UTC)
Message-Id: <20240725122456.1B7341A923B@mollari.NetBSD.org>
Date: Thu, 25 Jul 2024 12:24:56 +0000 (UTC)
From: s9281723@gmail.com
Reply-To: s9281723@gmail.com
To: gnats-bugs@NetBSD.org
Subject: ctwm does not move the application window to the specified workspace
X-Send-Pr-Version: www-1.0
>Number: 58467
>Category: bin
>Synopsis: ctwm does not move the application window to the specified workspace
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: bin-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Jul 25 12:25:00 +0000 2024
>Last-Modified: Sun Jul 28 22:50:01 +0000 2024
>Originator: Szymon
>Release: ctwm 4.0.3
>Organization:
-
>Environment:
NetBSD 10.0_STABLE NetBSD 10.0_STABLE (GENERIC) #0: Sat Jul 20 16:11:27 UTC 2024 mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/amd64/compile/GENERIC amd64
>Description:
f.occupy does not work
>How-To-Repeat:
1.Run option with f.occupy
2.Popup window does not display correctly, but you can select workspaces
3.When you click ok to confirm your selection, the application window is not transferred
>Fix:
Install NetBSD 9.4
>Audit-Trail:
From: RVP <rvp@SDF.ORG>
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: bin/58467: ctwm does not move the application window to the
specified workspace
Date: Fri, 26 Jul 2024 08:07:30 +0000 (UTC)
Actually, it does move the window if only 1 workspace is selected--ie. all
other workspaces should be de-selected. This is a bit difficult to see
because of the bug you reported.
> 2.Popup window does not display correctly, but you can select workspaces
>
Can you try this patch below (and please upstream it because it's a
quick hack and may not be the correct way to do it.):
--- START ---
diff -urN a/xsrc/external/mit/ctwm/dist/occupation.c b/xsrc/external/mit/ctwm/dist/occupation.c
--- a/xsrc/external/mit/ctwm/dist/occupation.c 2023-07-05 07:36:07.000000000 +0000
+++ b/xsrc/external/mit/ctwm/dist/occupation.c 2024-07-26 07:28:17.638397232 +0000
@@ -1131,6 +1131,8 @@
/* Mark it shown, and stash what window we're showing it for */
occupyWindow->twm_win->mapped = true;
occupyWin = twm_win;
+
+ PaintOccupyWindow();
}
--- END ---
If you want to switch the workspace after moving the window, something
like this in ~/.ctwmrc works:
--- START ---
--- system.ctwmrc 2024-05-31 13:11:41.000000000 +0000
+++ .ctwmrc 2024-07-26 06:59:35.771645403 +0000
@@ -322,6 +322,15 @@
" Quit" f.quit
}
+menu "workspaces"
+{
+ "1" f.function "move-to-wsp-1"
+ "2" f.function "move-to-wsp-2"
+ "3" f.function "move-to-wsp-3"
+ "4" f.function "move-to-wsp-4"
+ "5" f.function "move-to-wsp-5"
+}
+
menu "titleops"
{
"Window" f.title
@@ -330,7 +339,7 @@
" Resize" f.resize
" Move" f.move
"" f.separator
- " Occupy ..." f.occupy
+ " Move-To..." f.menu "workspaces"
" Occupy All" f.occupyall
"" f.separator
" Raise" f.raise
@@ -389,6 +398,12 @@
Function "raise-move" { f.raise f.deltastop f.forcemove }
Function "raise-and-resize" { f.raise f.deltastop f.resize }
+Function "move-to-wsp-1" { f.addtoworkspace "1" f.vanish f.gotoworkspace "1" }
+Function "move-to-wsp-2" { f.addtoworkspace "2" f.vanish f.gotoworkspace "2" }
+Function "move-to-wsp-3" { f.addtoworkspace "3" f.vanish f.gotoworkspace "3" }
+Function "move-to-wsp-4" { f.addtoworkspace "4" f.vanish f.gotoworkspace "4" }
+Function "move-to-wsp-5" { f.addtoworkspace "5" f.vanish f.gotoworkspace "5" }
+
# These are basically essential for basic functionality.
Button1 = : title : f.function "raise-move"
--- END ---
-RVP
PS. Only tested all this on ctwm-4.1.0 in -HEAD.
From: szymon <s9281723@gmail.com>
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: bin/58467: ctwm does not move the application window to the
specified workspace
Date: Fri, 26 Jul 2024 22:48:03 +0200
Ctwm 4.0.3 is installed with NetBSD 10.0 operating system.
Unfortunately I have no possibility to test your patch.
Is this a system or package patch?
Regarding the second part of the answer, I don't quite understand. I
didn't ask about switching workspaces after moving the window.
Szymon
From: RVP <rvp@SDF.ORG>
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: bin/58467: ctwm does not move the application window to the
specified workspace
Date: Sat, 27 Jul 2024 07:41:07 +0000 (UTC)
On Fri, 26 Jul 2024, szymon wrote:
> Ctwm 4.0.3 is installed with NetBSD 10.0 operating system.
> Unfortunately I have no possibility to test your patch.
>
No prob. I think I've got the proximate cause of this issue. Try
this modified ~/.ctwmrc:
```
--- /etc/X11/ctwm/system.ctwmrc 2024-05-31 13:11:41.000000000 +0000
+++ .ctwmrc 2024-07-27 07:10:46.685887738 +0000
@@ -183,8 +183,8 @@
NoShowOccupyAll
ReverseCurrentWorkspace
StartInMapState
-WMgrHorizButtonIndent 0
-WMgrVertButtonIndent 0
+WMgrHorizButtonIndent 1
+WMgrVertButtonIndent 1
WorkSpaces
{
```
Ie. set those variables to 1 instead of 0. A value of 0 doesn't
seem to be handled correctly by the code.
You can also upstream this patch for review--it does the same thing:
```
diff -urN a/xsrc/external/mit/ctwm/dist/parse_be.c b/xsrc/external/mit/ctwm/dist/parse_be.c
--- a/xsrc/external/mit/ctwm/dist/parse_be.c 2023-07-05 07:36:06.000000000 +0000
+++ b/xsrc/external/mit/ctwm/dist/parse_be.c 2024-07-27 07:19:21.895964575 +0000
@@ -1280,8 +1280,8 @@
if(Scr->FirstTime) {
Scr->WMgrVertButtonIndent = num;
}
- if(Scr->WMgrVertButtonIndent < 0) {
- Scr->WMgrVertButtonIndent = 0;
+ if(Scr->WMgrVertButtonIndent < 1) {
+ Scr->WMgrVertButtonIndent = 1;
}
Scr->workSpaceMgr.vspace = Scr->WMgrVertButtonIndent;
Scr->workSpaceMgr.occupyWindow->vspace = Scr->WMgrVertButtonIndent;
@@ -1291,8 +1291,8 @@
if(Scr->FirstTime) {
Scr->WMgrHorizButtonIndent = num;
}
- if(Scr->WMgrHorizButtonIndent < 0) {
- Scr->WMgrHorizButtonIndent = 0;
+ if(Scr->WMgrHorizButtonIndent < 1) {
+ Scr->WMgrHorizButtonIndent = 1;
}
Scr->workSpaceMgr.hspace = Scr->WMgrHorizButtonIndent;
Scr->workSpaceMgr.occupyWindow->hspace = Scr->WMgrHorizButtonIndent;
```
Should be easy to apply by hand to both pkgsrc and the system ctwm-4.1.0.
> Regarding the second part of the answer, I don't quite understand. I
> didn't ask about switching workspaces after moving the window.
>
I know--it was a bonus.
-RVP
From: szymon <s9281723@gmail.com>
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: bin/58467: ctwm does not move the application window to the
specified workspace
Date: Sat, 27 Jul 2024 21:54:14 +0200
I tested update below:
> -WMgrHorizButtonIndent 0
> -WMgrVertButtonIndent 0
> +WMgrHorizButtonIndent 1
> +WMgrVertButtonIndent 1
first in /etc/X11/ctwm/system.ctwmrc
and then in my ~/.ctwmrc
on my computer system NetBSD 10.0 with ctwm 4.0.3.
It works. Problem solved. Popup window now displays correctly when
clicking Occupy... and application window is now transferred to the
selected workspaces.
I can't apply the patch to *.c files because I'm not a system
developer and I don't maintain application packages.
From: RVP <rvp@SDF.ORG>
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: bin/58467: ctwm does not move the application window to the
specified workspace
Date: Sun, 28 Jul 2024 22:46:30 +0000 (UTC)
On Sat, 27 Jul 2024, szymon wrote:
> I can't apply the patch to *.c files because I'm not a system
> developer and I don't maintain application packages.
>
Since this is a ctwm bug, you should file a PR upstream.
-RVP
(Contact us)
$NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2024
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.