1

Looking Glass debugger of Gnome Shell provides Windows tab that lists all opened windows. Instance of such windows can be referenced from Evaluator tab after clicking, for example: [object instance proxy GType:MetaWindowX11 ...]

How can be process id of process of the selected window obtained in Evaluator tab?

There is get_client_pid() method defined in Mutter project, however it can't be called directly.

czerny
  • 15,090
  • 14
  • 68
  • 96

2 Answers2

0

I'm just from asking something very similar on the Gnome Shell IRC, this is what I found out from the very helpful folks there:

I you open Looking Glass and click the Insert button in the upper right corner (eg. after selecting a window from the Window list), you'll get something like r(x) = ... in the evaluator (with x being a sequential number). You can then call any method on the object like so: r(1).get_window_type()

Hope this helps!

Kind regards,

4levels
  • 3,134
  • 1
  • 23
  • 22
0

In Looking Glass:

  • Click on tab "Windows".
  • Select the desired window.
  • Scroll down, looking for "get_pid()".
  • Scroll to tab, click on "Insert" button.
  • Click on tab "Evaluator".
  • In bottom text field enter last output "r(x)" followed by ".get_pid(), for example "r(0).get_pid()", press Enter/Return.
  • Note the output, which is the process ID.
frog.ca
  • 684
  • 4
  • 8