How to identify window by clicking in Wayland

7,645

Good news, there IS something like this built into Gnome Shell, and unlike xprop works with Xorg and Wayland. Ultimately this may fall into the realm of other tooling if you're using KDE, i3, or something else.

To begin with, type the keys "ALT+F2" on the keyboard which will bring up a menu like this:

alt ft

After that comes up, issue the command lg (for "looking glass).

This will then bring up the looking glass window, from which we can extract window information. Select "window" from the top right corner of the looking glass:

window section

From there, you'll see a list of windows, from which you can click on the name of the window you want to identify.

list

In this case, I chose gedit for an example:

gedit

In the top line of that output you may notice:

Inspecting object: object instance proxy GType: MetaWindowX11 ...

The "GType" will be one of MetaWindowX11 or MetaWindowWayland.

This info comes as per https://fedoraproject.org/wiki/How_to_debug_Wayland_problems

Share:
7,645

Related videos on Youtube

czerny
Author by

czerny

Updated on September 18, 2022

Comments

  • czerny
    czerny over 1 year

    I'd like to identify which process a window belongs to in Wayland. Is there anything like xprop for X that allows the user to pick a window by clicking and outputs all window details, including PID?

    • mviereck
      mviereck about 6 years
      I doubt that there is or will ever be such a command like xprop. One major goal of Wayland is to restrict access to windows of other processes.
    • Nathaniel M. Beaver
      Nathaniel M. Beaver about 6 years
      @mviereck Surely the superuser could see window information, even in Wayland?
    • mviereck
      mviereck about 6 years
      @bariumbitmap: Only if the compositor provides these informations outside of its own memory, for example in a file or through an API. I am not aware of such a specification (but it may exist, though). Of course, you could fork a compositor like weston and implement that yourself, if you don't need a general solution for all compositors.
    • istepaniuk
      istepaniuk about 5 years
      Why not just xprop? It shows an awful lot of detail over a window via XWayland, including _NET_WM_PID(CARDINAL), which is the originator process PID.
  • czerny
    czerny about 6 years
    So does this allow to find out the PID of process running the listed window?
  • RichieHH
    RichieHH over 3 years
    So how to use this from a shell in order to determine if a gui is running as wmctrl did?