Michel Dänzer 313860e2fa kms: Wait for 2 seconds before handling udev hotplug events
More precisely, wait until no further udev hotplug events have arrived
in 2 seconds.

Keep a list of unique UpdateStatesData structs which have received
hotplug events, and call handle_hotplug_event for all of them once the
timeout expires.

This avoids problems due to some monitors generating hotplug events
when power saving is enabled on locking the session, and then
temporarily appearing disconnected.

v2:
* Make meta_test_disconnect_connect wait and run main context dispatch
  before checking the number of logical monitors.
v3:
* Call g_source_unref immediately after g_source_attach, simplifies
  source cleanup. (Sebastian Wick)
* Free hotplug devices list in meta_kms_finalize. (Sebastian Wick)
* Add KMS debug logging in on_udev_hotplug & hotplug_timeout.
* Bump timeout to 2 seconds. With my affected monitor, the second udev
  hotplug event normally arrives almost a second after the first one,
  occasionally more than 1.5 seconds though.
* Use UpdateStatesData with custom compare function for hotplug_devices
  list data, since the GUdevDevice / device path string pointer values
  are always different.
* Don't wait for timeout if meta_is_udev_test_device returns TRUE, to
  hopefully fix VKMS CI tests. Drop meta_test_disconnect_connect changes
  again.
v4:
* Use hash table instead of list for hotplug_events set. (Sebastian Wick)
* Add comment describing the keys & values in the hash table. (Sebastian Wick)
* Add KMS debug logging in handle_hotplug_event as well.
* Dropped Closes:, this might not suffice to fully address
  https://gitlab.gnome.org/GNOME/mutter/-/issues/3831 after all.
v5:
* Simplify hash table annotation comment. (Sebastian Wick)
v6:
* Rename hotplug_timeout local string pointer to hotplug_event.
* Drop g_clear_pointer in favour of g_autofree in on_udev_hotplug.
  (Sebastian Wick)

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4209>
2025-02-19 16:53:58 +00:00
2025-02-17 12:21:52 +00:00
2024-09-14 13:47:21 +00:00
2024-05-21 09:09:11 +00:00
2024-09-25 13:49:29 +02:00
2024-01-09 13:38:54 +00:00
2025-02-05 12:02:35 +01:00
2025-02-05 12:02:35 +01:00

Mutter

Mutter is a Wayland display server and X11 window manager and compositor library.

When used as a Wayland display server, it runs on top of KMS and libinput. It implements the compositor side of the Wayland core protocol as well as various protocol extensions. It also has functionality related to running X11 applications using Xwayland.

When used on top of Xorg it acts as a X11 window manager and compositing manager.

It contains functionality related to, among other things, window management, window compositing, focus tracking, workspace management, keybindings and monitor configuration.

Internally it uses a fork of Cogl, a hardware acceleration abstraction library used to simplify usage of OpenGL pipelines, as well as a fork of Clutter, a scene graph and user interface toolkit.

Mutter is used by, for example, GNOME Shell, the GNOME core user interface, and by Gala, elementary OS's window manager. It can also be run standalone, using the command "mutter", but just running plain mutter is only intended for debugging purposes.

Contributing

To contribute, open merge requests at https://gitlab.gnome.org/GNOME/mutter.

It can be useful to first look at the GNOME Handbook and the documentation and API references below first.

Documentation

API Reference

Meetings

There are recurring meetings to discuss development of GNOME Shell, mutter and related components.

License

Mutter is distributed under the terms of the GNU General Public License, version 2 or later. See the COPYING file for detalis.

Description
Languages
C 98.9%
Meson 0.7%
Python 0.3%