Bug 354901

Summary: kwin scripting: problem implementing client::tabBefore() function
Product: [Plasma] kwin Reporter: garethic
Component: scriptingAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED UNMAINTAINED    
Severity: normal CC: xaver.hugl
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description garethic 2015-11-05 15:08:18 UTC
Hi, Wow. That's a lot of bugs in the list above, so I'm not expecting anything immediate.
This is probably just my ignorance, but what I'm trying to do is script some windows to tab together in the Desktop Shell Scripting Console. The code is below. 

I get this error: TypeError: cannot call tabBefore(): argument 1 has unknown type `Client*' (register the type with qScriptRegisterMetaType())

I've tried casting as 'Client & 'Client*', but the interpreter (I assume) is not interested. As far as I can tell, I can't register the type in the console, it has to be done when kwin is built. To that extent, I guess it's a bug. If this isn't the right place to ask this question, I'd appreciate some pointers to the right place.

Code:
var clients = workspace.clientList(); 
//tabBefore(Client*,bool)
for (var i=0; i<clients.length; i++) 	{
  if( clients[i].caption == "Positions (1)"){
	print ("client1"); var client1 = clients[i]; 		
    //print ( typeof clients[i]); print ( typeof client1)
  }
   if( clients[i].caption == "Journal.odt - LibreOffice Writer"){
	print ("client2"); var client2 = clients[i]; 		}
  }//end for
 
 client1.tabBefore(client2, true);

Reproducible: Always

Steps to Reproduce:
Run the above in Desktop Shell Scripting Console
Comment 1 Thomas Lübking 2015-11-05 16:51:35 UTC
kwin 5?
tabbing has been skipped in porting and is presently not available in even kwin core - don't expect it to work (there's some kwin/kdecoration bug to fix that)

ECMA doesn't use pointers, so the script looks fine except that the function doesn't exist resp. is noop.
Comment 2 Justin Zobel 2021-03-10 00:32:45 UTC
Thank you for the bug report.

As this report hasn't seen any changes in 5 years or more, we ask if you can please confirm that the issue still persists.

If this bug is no longer persisting or relevant please change the status to resolved.