Bug 354901 - kwin scripting: problem implementing client::tabBefore() function
Summary: kwin scripting: problem implementing client::tabBefore() function
Status: RESOLVED UNMAINTAINED
Alias: None
Product: kwin
Classification: Plasma
Component: scripting (other bugs)
Version First Reported In: unspecified
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-05 15:08 UTC by garethic
Modified: 2024-06-06 15:43 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.