How to identify the app behind: "Error: Unable to lock: Lock was blocked by an app"

I get this error quite often and am trying to determine exactly which app is causing the failure to lock:
"Error: Unable to lock: Lock was blocked by an app"

It seems to be a fairly common issue across the various help forums, but none have a solution that identifies (or indicates how to identify) the culprit.

I am running GNOME Shell 46.4 (see details below), but the issue has been present for a while.

It would be helpful to lots of GNOME users if there was a way to identify the source of this error.

Thanks.

$ inxi -Fz                                                                     
System:
  Kernel: 6.1.105-1-MANJARO arch: x86_64 bits: 64
  Desktop: GNOME v: 46.4 Distro: Manjaro Linux
Machine:
  Type: Desktop System: Apple product: iMac12,2 v: 1.0
    serial: <superuser required>
  Mobo: Apple model: Mac-942B59F58194171B v: iMac12,2
    serial: <superuser required> UEFI: Apple v: 85.0.0.0.0 date: 04/16/2019
CPU:
  Info: quad core model: Intel Core i5-2500S bits: 64 type: MCP cache:
    L2: 1024 KiB
  Speed (MHz): avg: 1600 min/max: 1600/3700 cores: 1: 1600 2: 1600 3: 1600
    4: 1600
Graphics:
  Device-1: Intel 2nd Generation Core Processor Family Integrated Graphics
    driver: i915 v: kernel
  Device-2: AMD Whistler [Radeon HD 6730M/6770M/7690M XT] driver: radeon
    v: kernel
  Device-3: Microdia Webcam Vitade AF driver: snd-usb-audio,uvcvideo
    type: USB
  Device-4: Apple FaceTime HD Camera (Built-in) driver: uvcvideo type: USB
  Display: x11 server: X.Org v: 21.1.13 with: Xwayland v: 24.1.2 driver: X:
    loaded: modesetting,radeon unloaded: vesa dri: r600 gpu: radeon
    resolution: 4096x2304~60Hz
  API: Vulkan Message: No Vulkan data available.
  API: OpenGL Message: Unable to show GL data. glxinfo is missing.
Audio:
  Device-1: Intel 6 Series/C200 Series Family High Definition Audio
    driver: snd_hda_intel
  Device-2: AMD Turks HDMI Audio [Radeon HD 6500/6600 / 6700M Series]
    driver: snd_hda_intel
  Device-3: Microdia Webcam Vitade AF driver: snd-usb-audio,uvcvideo
    type: USB
  Device-4: GN Netcom Jabra SPEAK 510 driver: jabra,snd-usb-audio,usbhid
    type: USB
  API: ALSA v: k6.1.105-1-MANJARO status: kernel-api
  Server-1: PulseAudio v: 17.0 status: active
Network:
  Device-1: Broadcom NetXtreme BCM57765 Gigabit Ethernet PCIe driver: tg3
  IF: enp2s0 state: up speed: 1000 Mbps duplex: full mac: <filter>
  Device-2: Qualcomm Atheros AR93xx Wireless Network Adapter driver: ath9k
  IF: wlp3s0 state: down mac: <filter>
  IF-ID-1: docker0 state: down mac: <filter>
  IF-ID-2: nordlynx state: unknown speed: N/A duplex: N/A mac: N/A
Bluetooth:
  Device-1: Apple Built-in Bluetooth 2.0+EDR HCI driver: btusb type: USB
  Report: btmgmt ID: hci0 state: up address: <filter> bt-v: 2.1
Drives:
  Local Storage: total: 3.64 TiB used: 1.43 TiB (39.4%)
  ID-1: /dev/sda vendor: Hitachi model: HUS724040ALE640 size: 3.64 TiB
Partition:
  ID-1: / size: 91.11 GiB used: 64.05 GiB (70.3%) fs: ext4 dev: /dev/dm-0
  ID-2: /boot size: 451.6 MiB used: 333.4 MiB (73.8%) fs: ext4
    dev: /dev/sda12
  ID-3: /boot/efi size: 196.9 MiB used: 41.8 MiB (21.2%) fs: vfat
    dev: /dev/sda1
Swap:
  ID-1: swap-1 type: partition size: 18.63 GiB used: 0 KiB (0.0%)
    dev: /dev/sda14
Sensors:
  System Temperatures: cpu: 45.0 C mobo: N/A
  Fan Speeds (rpm): cpu: 939
Info:
  Memory: total: 32 GiB available: 31.33 GiB used: 6.99 GiB (22.3%)
  Processes: 311 Uptime: 2h 41m Shell: Zsh inxi: 3.3.35

If you are on X11, any application that has a mouse or keyboard grab (e.g. when having a menu open) could cause this.

Thanks @skeller. I am on X11. Is there any way to figure out which app(s) are causing the lock issue? Alternatively, is there a way to find out which apps have the ability to mouse/keyboard grab (even when nothing is moving/touching)?

Thanks. I did that, but the log did not identify anything that helped (at least for me – the lack of timestamps made it hard to triangulate. I also noticed some weird date information).

While it could still be the pointer grabber (and please let me , it would be easiest if there was just some way to identify the application that blocked lock and caused the Error.

Does that exist?

$ cat /var/log/Xorg.0.log                                                                                                                                  ✔ 
[    27.541] (--) Log file renamed from "/var/log/Xorg.pid-999.log" to "/var/log/Xorg.0.log"
[    27.541] 
X.Org X Server 1.21.1.4
X Protocol Version 11, Revision 0
[    27.541] Current Operating System: Linux manjaro-yoga 5.10.141-1-MANJARO x86_64
[    27.541] Kernel command line: root=UUID=xxxx rw quiet acpi_osi=Linux acpi_backlight=native nomodeset i915.modeset=0  mds=full,nosmt cryptdevice=UUID=sss root=/dev/mapper/luks-sss resume=/dev/mapper/luks-sss initrd=\initramfs-5.10-x86_64.img
[    27.541]  
[    27.541] Current version of pixman: 0.40.0
[    27.541] 	Before reporting problems, check http://wiki.x.org
	to make sure that you have the latest version.
[    27.541] Markers: (--) probed, (**) from config file, (==) default setting,
	(++) from command line, (!!) notice, (II) informational,
	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[    27.541] (==) Log file: "/var/log/Xorg.0.log", Time: Sat Oct  1 08:29:56 2022
[    27.542] (==) Using config directory: "/etc/X11/xorg.conf.d"
[    27.542] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[    27.542] (==) No Layout section.  Using the first Screen section.
[    27.542] (==) No screen section available. Using defaults.
[    27.542] (**) |-->Screen "Default Screen Section" (0)
[    27.542] (**) |   |-->Monitor "<default monitor>"
[    27.542] (==) No monitor specified for screen "Default Screen Section".
	Using a default monitor configuration.
[    27.542] (==) Automatically adding devices
[    27.542] (==) Automatically enabling devices
[    27.542] (==) Automatically adding GPU devices
[    27.542] (==) Automatically binding GPU devices
[    27.542] (==) Max clients allowed: 256, resource mask: 0x1fffff
[    27.542] (WW) The directory "/usr/share/fonts/OTF" does not exist.
[    27.542] 	Entry deleted from font path.
[    27.542] (WW) The directory "/usr/share/fonts/Type1" does not exist.
[    27.542] 	Entry deleted from font path.
[    27.542] (==) FontPath set to:
	/usr/share/fonts/misc,
	/usr/share/fonts/TTF,
	/usr/share/fonts/100dpi,
	/usr/share/fonts/75dpi
[    27.542] (==) ModulePath set to "/usr/lib/xorg/modules"
[    27.542] (II) The server relies on udev to provide the list of input devices.
	If no devices become available, reconfigure udev or disable AutoAddDevices.
[    27.542] (II) Module ABI versions:
[    27.542] 	X.Org ANSI C Emulation: 0.4
[    27.542] 	X.Org Video Driver: 25.2
[    27.542] 	X.Org XInput driver : 24.4
[    27.542] 	X.Org Server Extension : 10.0
[    27.542] (++) using VT number 1

[    27.543] (II) systemd-logind: took control of session /org/freedesktop/login1/session/_38
[    27.545] (--) PCI:*(0@0:2:0) 8086:5916:17aa:3801 rev 2, Mem @ 0xa0000000/16777216, 0x90000000/268435456, I/O @ 0x00003000/64, BIOS @ 0x????????/131072
[    27.545] (WW) Open ACPI failed (/var/run/acpid.socket) (No such file or directory)
[    27.545] (II) LoadModule: "glx"
[    27.545] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
[    27.546] (II) Module glx: vendor="X.Org Foundation"
[    27.546] 	compiled for 1.21.1.4, module version = 1.0.0
[    27.546] 	ABI class: X.Org Server Extension, version 10.0
[    27.546] (==) Matched modesetting as autoconfigured driver 0
[    27.546] (==) Matched fbdev as autoconfigured driver 1
[    27.546] (==) Matched vesa as autoconfigured driver 2
[    27.546] (==) Assigned the driver to the xf86ConfigLayout
[    27.546] (II) LoadModule: "modesetting"
[    27.546] (II) Loading /usr/lib/xorg/modules/drivers/modesetting_drv.so
[    27.546] (II) Module modesetting: vendor="X.Org Foundation"
[    27.546] 	compiled for 1.21.1.4, module version = 1.21.1
[    27.546] 	Module class: X.Org Video Driver
[    27.546] 	ABI class: X.Org Video Driver, version 25.2
[    27.546] (II) LoadModule: "fbdev"
[    27.547] (WW) Warning, couldn't open module fbdev
[    27.547] (EE) Failed to load module "fbdev" (module does not exist, 0)
[    27.547] (II) LoadModule: "vesa"
[    27.547] (II) Loading /usr/lib/xorg/modules/drivers/vesa_drv.so
[    27.547] (II) Module vesa: vendor="X.Org Foundation"
[    27.547] 	compiled for 1.21.1.3, module version = 2.5.0
[    27.547] 	Module class: X.Org Video Driver
[    27.547] 	ABI class: X.Org Video Driver, version 25.2
[    27.547] (II) modesetting: Driver for Modesetting Kernel Drivers: kms
[    27.547] (II) VESA: driver for VESA chipsets: vesa
[    27.547] (EE) open /dev/dri/card0: No such file or directory
[    27.547] (WW) Falling back to old probe method for modesetting
[    27.547] (EE) open /dev/dri/card0: No such file or directory
[    27.547] vesa: Refusing to run, Framebuffer or dri device present
[    27.547] (EE) Screen 0 deleted because of no matching config section.
[    27.547] (II) UnloadModule: "modesetting"
[    27.547] (EE) Device(s) detected, but none match those in the config file.
[    27.547] (EE) 
Fatal server error:
[    27.547] (EE) no screens found(EE) 
[    27.547] (EE) 
Please consult the The X.Org Foundation support 
	 at http://wiki.x.org
 for help. 
[    27.547] (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
[    27.547] (EE) 
[    27.550] (EE) Server terminated with error (1). Closing log file.

As far as I know there is no other way to identify which X11 application is holding a grab. If you want to avoid this issue you could try using Wayland where the compositor is in control of grabs unlike X11 where it is the X11 server.

Thanks for that response. I’ll consider Wayland.