The original implementation of ::touch-mode tested for keyboard presence to know whether the OSK and other touch-only features were enabled. However that didn't pan out, every webcam, card reader and kitchen sink like to live a second life as EV_KEY devices. This made the detection of actual external keyboards a much harder task than it sounds, and was thus removed in commit f8e2234ce59fbb. Try a different approach here, and test for pointer devices, it doesn't matter if internal or external devices, the rationales: - It is significantly easier to get this right, there's virtually no devices with abs/rel axes that don't try to be a real input device of some sorts. - It's not as good as testing for keyboard presence, but it's the next best thing. These usually come in pairs, except in weird setups. - It is better than not having anything for a number of situations: - Non-convertible laptops with a touchscreen will get touch-mode disabled due to touchpad presence (plus keyboard). There's been complains about OSK triggering with those. - Same for desktop machines with USB touchscreens, the mouse (and presumably keyboard) attached would make touch-mode get in the middle. - Convertible laptops with a broken tablet-mode switch get a chance to work on tablet modes that do disable input devices (e.g. detachable keyboards, or via firmware) - Kiosk machines, tablets, and other devices that have a touchscreen but will not regularly have a mouse/keyboard will get the touch-mode enabled. All in all, this seems to cover more situations the way we expect it, there's only one situation that the OSK would show where it might not be desirable, and one that might not show when it better should: - Tablets and kiosk machines that get one keyboard plugged, but not a mouse, will still show the OSK, despite being able to type right away. - Convertible laptops with broken/unreliable tablet-mode switch (e.g. ignored by the kernel) rely entirely on the device/firmware characteristics to work. If after folding into tablet mode the touchpad remains active, touch-mode will not turn on. Fixing the tablet-mode switch on these devices should be preferred, as that'll also make libinput magically disable the touchpad. The latter can be worked around with the a11y toggle. The former is merely inconvenient, and nothing prevents the user from plugging a mouse in addition. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1710>
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 af 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 look at the documentation available at the Wiki.
Coding style and conventions
The coding style used is primarily the GNU flavor of the GNOME coding style with some additions:
-
Use regular C types and
stdint.h
types instead of GLib fundamental types, except forgboolean
, andguint
/gulong
for GSource ids and signal handler ids. That means e.g.uint64_t
instead ofguint64
,int
instead ofgint
,unsigned int
instead ofguint
if unsignedness is of importance,uint8_t
instead ofguchar
, and so on. -
Try to to limit line length to 80 characters, although it's not a strict limit.
-
Usage of g_autofree and g_autoptr are encouraged. The style used is
g_autofree char *text = NULL;
g_autoptr (MetaSomeThing) thing = NULL;
text = g_strdup_printf ("The text: %d", a_number);
thing = g_object_new (META_TYPE_SOME_THING,
"text", text,
NULL);
thinger_use_thing (rocket, thing);
-
Declare variables at the top of the block they are used, but avoid non-trivial logic among variable declarations. Non-trivial logic can be getting a pointer that may be
NULL
, any kind of math, or anything that may have side effects. -
Instead of boolean arguments in functions, prefer enums or flags when they're more expressive.
-
Use
g_new0()
etc instead ofg_slice_new0()
. -
Initialize and assign floating point variables (i.e.
float
ordouble
) using the formfloating_point = 3.14159
orratio = 2.0
.
Git messages
Commit messages should follow the GNOME commit message
guidelines. We require an URL
to either an issue or a merge request in each commit. Try to always prefix
commit subjects with a relevant topic, such as compositor:
or
clutter/actor:
, and it's always better to write too much in the commit
message body than too little.
License
Mutter is distributed under the terms of the GNU General Public License, version 2 or later. See the COPYING file for detalis.