1
0
Fork 0
Commit graph

6643 commits

Author SHA1 Message Date
Hans de Goede
7917b083cb monitor-manager: Take drm-connector panel-orientation property into account
Some x86 clamshell design devices use portrait tablet LCD panels while
they should use a landscape panel, resoluting in a 90 degree rotated
picture.

Newer kernels detect this and rotate the fb console in software to
compensate. These kernels also export their knowledge of the LCD panel
orientation vs the casing in a "panel orientation" drm_connector property.

This commit adds support to mutter for reading the "panel orientation"
and transparently (from a mutter consumer's pov) fixing this by applying
a (hidden) rotation transform to compensate for the panel orientation.

Related: https://bugs.freedesktop.org/show_bug.cgi?id=94894

https://bugzilla.gnome.org/show_bug.cgi?id=782294
2017-12-25 17:01:45 +08:00
Hans de Goede
2b3040d04f monitor: s/meta_monitor_derived_derive_layout/meta_monitor_tiled_derive_layout/
Fix meta_monitor_derived_derive_layout typo.

https://bugzilla.gnome.org/show_bug.cgi?id=782294
2017-12-25 17:01:45 +08:00
Ting-Wei Lan
6cc48d8cbb build: Fix non-wayland builds
meta_dnd_wayland_handle_end_modal is not available on non-wayland build.

https://bugzilla.gnome.org/show_bug.cgi?id=791916
2017-12-24 17:55:14 +08:00
Carlos Garnacho
798026498d wayland: Only send full sequences of touch events to clients
If input happens to be grabbed somewhere along the shell, and ungrabbed
while a touch operation is ongoing, the wayland bits will happily start
sending wl_touch.update events from an undeterminate point, without
clients having ever received wl_touch.down for that id.

Consider those touches grabbed for the entirety of their lifetime, if
wl_touch.down wasn't received by the client, no other events will.

https://bugzilla.gnome.org/show_bug.cgi?id=776220
2017-12-21 12:37:20 +01:00
Olivier Fourdan
49f029571c keybindings: Super should be inhibitable
When a Wayland client issues a shortcut inhibit request which is granted
by the user, the Super key should be passed to the surface instead of
being handled by the compositor.

https://bugzilla.gnome.org/show_bug.cgi?id=790627
2017-12-21 09:08:41 +01:00
Olivier Fourdan
7f5f5eb847 wayland/keyboard: preserve layout index
On VT switch, the xkb state layout index is lost and reset to the first
group, so if the first layout is not the last one being used, the xkb
state used in both meta-wayland-keyboard.c and clutter/evdev will be
desynchronized with the keyboard source indicator in the gnome-shell UI.

Save the effective layout chosen along with the seat so it can be
restored when reclaiming devices.

Use the saved layout index from the clutter/evdev's seat to restore the
layout in meta-wayland-keyboard, so that switching VT doesn't reset the
layout and causes further discrepancies with the layout indicator in the
gnome-shell UI.

https://bugzilla.gnome.org/show_bug.cgi?id=791383
2017-12-20 09:56:34 +01:00
Jonas Ådahl
44269e6a1d keybindings: Only add multiple keycodes from the same level
The reason why multiple keycodes could be mapped to a single keysym was
to support having both KEY_FAVORITES and KEY_BOOKMARK map to
XF86Favorites. However, iterating through all layout levels adding all
key codes has severe consequences on layouts with levels that map
things like numbers and arrow. The result is that keybindings that
should only have been added for keycodes from the first level, are
replaced by some unexpected keycode where the same keysym was found on
another level.

An example of this is the up-arrow key and l symbol. Normally you'd find
both the up-arrow symbol and the l symbol on the first level and be done
with it. However, on the German Neo-2 layout, layout level 4 maps the
KEY_E to the l symbol, while layout level 4 maps KEY_E to up-arrow.
Which ever gets to take priority is arbitrary, but for this particular
case KEY_E incorrectly mapped to up-arrow instead of the l symbol,
causing the keyboard shortcut Super+l, which would normally lock the
screen, to trigger the workspace-up (Super+up-arrow) key binding.

https://bugzilla.gnome.org/show_bug.cgi?id=789300
2017-12-20 15:02:39 +08:00
Olivier Fourdan
072afa5fa3 wayland: Add Xwayland grab keyboard support
This protocol is limited to Xwayland only and is not visible/usable by
any other client.

Mutter uses the following mechanisms to determine if an X11 client
should be granted a grab:

 - is "xwayland-allow-grabs" set?
 - if set, is the client blacklisted?
 - otherwise, has the client set the X11 window property
   _XWAYLAND_MAY_GRAB_KEYBOARD on the window using a client message?
 - if not, is it a client white-listed either via the default system
   list or the settings "xwayland-grab-access-rules"?

https://bugzilla.gnome.org/show_bug.cgi?id=783342
2017-12-18 13:15:20 +01:00
Olivier Fourdan
519a0fd93d settings: Add xwayland grab settings
Add new settings to control which X11 windows are allowed to
issue Xwayland grabs.

https://bugzilla.gnome.org/show_bug.cgi?id=783342
2017-12-18 13:15:17 +01:00
Olivier Fourdan
5f132f3975 xwayland: add _XWAYLAND_MAY_GRAB_KEYBOARD property
Add a new client message "_XWAYLAND_MAY_GRAB_KEYBOARD" that X11 clients
can use to tell mutter this is a well behaving X11 client so it may
grant the keyboard grabs when requested.

An X11 client wishing to be granted Xwayland grabs by gnome-shell/mutter
must send a ClientMessage to the root window with:

 - message_type set to "_XWAYLAND_MAY_GRAB_KEYBOARD"
 - window set to the xid of the window on which the grab is to be issued
 - data.l[0] to a non-zero value

Note: Sending this client message when running a plain native X11
environment would have no effect.

https://bugzilla.gnome.org/show_bug.cgi?id=783342
2017-12-18 13:15:13 +01:00
Olivier Fourdan
1546989845 xwayland: Add MetaWindowXwayland
MetaWindowXwayland derives from MetaWindowX11 to allow for some Xwayland
specific vfunc that wouldn't apply to plain X11 windows, such as
shortcut inhibit routines.

https://bugzilla.gnome.org/show_bug.cgi?id=783342
2017-12-18 13:15:09 +01:00
Rui Matos
1923db97c1 wayland-outputs: Delay wl_output destruction
This tries to avoid wayland clients getting disconnected for binding
to a wl_output that we already destroyed which is a known protocol
race condition, see https://phabricator.freedesktop.org/T7722 .

https://bugzilla.gnome.org/show_bug.cgi?id=789070
2017-12-15 14:54:13 +01:00
Olivier Fourdan
db32047a5d wayland: Add xdg-output support
The xdg-output protocol aims at describing outputs in way which is
more in line with the concept of an output on desktop oriented systems.

For now it just features the position and logical size which describe
the output position and size in the global compositor space.

This is however much useful for Xwayland to advertise the output size
and position to X11 clients which need this to configure their surfaces
in the global compositor space as the compositor may apply a different
scale from what is advertised by the output scaling property (to achieve
fractional scaling, for example).

This was added in wayland-protocols 1.10.

https://bugzilla.gnome.org/show_bug.cgi?id=787363
2017-12-15 14:18:14 +01:00
Marco Trevisan (Treviño)
1a1db9ef8d window-actor: rename destroy function in queue_destroy
Since this might delay the destruction after animation
has succeeded, it's just better to rename this accordingly.

https://bugzilla.gnome.org/show_bug.cgi?id=791006
2017-11-30 22:53:26 -05:00
Marco Trevisan (Treviño)
b1587f0716 compositor: reset top_window_actor and remove it from windows when destroyed
When the top window actor is destroyed, we need to make sure that
all its references are removed or it could be picked again in next
windows sync, causing crashes.
Since the window might or might not be destroyed when removed (depending
weather animations are in progress over it or not), it's just safer
to wait it to be destroyed before cleaning up any of its reference.

https://bugzilla.gnome.org/show_bug.cgi?id=791006
2017-11-30 22:53:26 -05:00
Philip Withnall
93e450f37c backends: Fix ClutterRect initialisations
With Clang, these initialisations were warning about missing brackets.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://bugzilla.gnome.org/show_bug.cgi?id=791022
2017-11-30 13:06:13 +00:00
Jonas Ådahl
fc713ecb70 monitor-unit-tests: Check config loading on lid switches
Check that we apply the correct stored configuration when the lid is
opend and closed while an external monitor is connected.

https://bugzilla.gnome.org/show_bug.cgi?id=788915
2017-11-30 11:48:44 +08:00
Jonas Ådahl
500c13ab6f monitor-unit-tests: Always reset CRTC transform ability
Changing the test monitor managers ability to rotate CRTCs in one test
affected the next test. Avoid leaking such state by resetting it before
each test. To continue passing, some tests needed to be updated
regarding to still pass.

https://bugzilla.gnome.org/show_bug.cgi?id=788915
2017-11-30 11:48:44 +08:00
Jonas Ådahl
050267fe74 monitor-unit-tests: Add test for lid toggle after hot unplug
https://bugzilla.gnome.org/show_bug.cgi?id=788915
2017-11-30 11:48:44 +08:00
Jonas Ådahl
ce25a0171c monitor-unit-tests: Add test for lid closed after hot plug
Add a test case that checks that we don't try to revert to a
laptop-panel-only configuration after closing the lid after an external
monitor is connected.

https://bugzilla.gnome.org/show_bug.cgi?id=788915
2017-11-30 11:48:44 +08:00
Jonas Ådahl
b7518c8651 monitor-manager: Compare keys when checking whether a config is complete
We only counted configured monitors and whether the config was
applicable (could be assigned), howeverwe didn't include disabled
monitors when comparing. This could caused incorrect configurations to
be applied when trying to use the previous configuration.

One scenario where this happened was one a system with one laptop
screen and one external monitor that was hot plugged some point after
start up. When the laptop lid was closed, the 'previous configuration'
being the configuration where only the laptop panel was enabled, passed
'is-complete' check as the number of configured monitors were correct,
and the configuration was applicable.

Avoid this issue by simply comparing the configuration key of the
previous configuration and the configuration key of the current state.
This correctly identifies a laptop panel with the lid closed as
inaccessible, thus doesn't incorrectly revert to the previous
configuration.

https://bugzilla.gnome.org/show_bug.cgi?id=788915
2017-11-30 11:48:44 +08:00
Jonas Ådahl
62dedfbef3 monitor-config-manager: Don't include closed laptop panel in config key
When deriving the list of disabled monitors when creating new monitors
configs, don't include the laptop panel if the lid is currently closed,
as we consider the laptop panel nonexistent when the laptop lid is
closed when it comes to configuration.

The laptop panel connector(s) will either way be appropriately disabled
anyway, as the field listing disabled monitors in the configuration do
not affect actual CRTC/connector assignments.

https://bugzilla.gnome.org/show_bug.cgi?id=788915
2017-11-30 11:48:44 +08:00
Jonas Ådahl
4508978ea5 wayland/xdg-shell: Dismiss a popup on map if parent already dismissed
If a parent doesn't have a window, it means it could have been
dismissed (for example due to a input serial race), but the more recent
popup might win the input serial race and try to map anyway. This would
result in a crash later on when trying to process the placement rule,
as the parent already has no window.

https://bugzilla.gnome.org/show_bug.cgi?id=790358
2017-11-30 10:50:13 +08:00
Jonas Ådahl
c533a06e93 wayland/xdg-shell: Check popup parent type when assigning
We only allow mapping popups on top of surfaces with a xdg_surface
based role. Add a check and fail clients that doesn't follow this rule.

https://bugzilla.gnome.org/show_bug.cgi?id=790358
2017-11-30 10:50:13 +08:00
Jonas Ådahl
5d3b4f0134 wayland/xdg-shell: Fix top-most check when grabbing
Move the top-most-popup correctness check to the finish_popup_setup()
function after checking the serial. If we pass the serial check, we
should have reached a state that if there are any popups they should be
the one from the same client.

Also avoid failing a client that correctly set the top-most popup at map
time, but where at the time of processing the top most popup have
already been dismissed by the compositor for some arbitrary reason.

https://bugzilla.gnome.org/show_bug.cgi?id=790358
2017-11-30 10:50:13 +08:00
Rui Matos
28a9439209 monitor-manager: Refuse to activate closed laptop panels
There's no good reason to allow this and it allows g-c-c to properly
show that such a configuration doesn't work.

https://bugzilla.gnome.org/show_bug.cgi?id=790336
2017-11-22 15:07:11 +01:00
Carlos Garnacho
cf4b5efdd1 backends: Do NULL checks before disconnecting/connecting signals
The displayed cursor may be NULL.

https://bugzilla.gnome.org/show_bug.cgi?id=754806
2017-11-20 13:29:22 +01:00
Carlos Garnacho
3067dab84c backends: Do not set up the root cursor on invisible window pointers
Commit b1a0bf891 broke the previous logic that we would only fallback
to the root cursor if 1) windows are not interactable or 2) no window
cursor is currently set (i.e. not hovering over any window). Now it
will set up the root cursor if it's NULL, which breaks clients
explicitly setting an invisible cursor. This commit restaurates the
previous behavior.

https://bugzilla.gnome.org/show_bug.cgi?id=754806
2017-11-20 13:29:22 +01:00
Carlos Garnacho
1790320ba3 backends: Protect from reentrancy in meta_cursor_sprite_load_from_theme
This function is supposedly not failable, so just move the theme_dirty
flag clearing to the beginning of the function. Protects against cases
where requesting a cursor image may result in it being loaded and set
as a texture, which emits ::texture-changed, which may end up requesting
the cursor image again.

https://bugzilla.gnome.org/show_bug.cgi?id=754806
2017-11-17 17:22:18 +01:00
Carlos Garnacho
f45df4265d backends: Trigger MetaCursorTracker::cursor-changed on texture changes
So we allow gnome-shell's magnifier to update fake cursors while it's
turned on.

https://bugzilla.gnome.org/show_bug.cgi?id=754806
2017-11-17 17:22:18 +01:00
Carlos Garnacho
bcbcd6a68c backends: Add MetaCursorSprite::texture-changed signal
As wayland implements the cursor role, it consists of a persistent
MetaCursorSprite that gets the backing texture changed. This is
inconvenient for the places using MetaCursorTracker to track cursor
changes, as they actually track MetaCursorSprites.

This signal will be used to trigger emission of
MetaCursorTracker::cursor-changed, which will make users able to
update accordingly.

https://bugzilla.gnome.org/show_bug.cgi?id=754806
2017-11-17 17:22:18 +01:00
Carlos Garnacho
b1a0bf8916 backends: Dissociate visibility from current cursor sprite
Just like X11/XFixes behaves, the current cursor is not affected
by its visibility, so it can be queried while invisible (possibly
to be replaced).

For this, keep an extra effective_cursor pointer that will be
either equal to displayed_cursor (maybe a bit of a misnomer now)
or NULL if the cursor is invisible. The MetaCursorRenderer
management is tied to the former, and the ::cursor-changed signal
emission to the latter.

https://bugzilla.gnome.org/show_bug.cgi?id=754806
2017-11-17 17:22:18 +01:00
Carlos Garnacho
6c18bae83c compositor: Fix build
Unused variable definition. The fixup didn't make it to the previous
commit.
2017-11-17 16:58:54 +01:00
Carlos Garnacho
d0531966eb compositor: End MetaDnd grab on plugin grab end
We must emit ::dnd-leave to pair the ::dnd-enter that shall be
emitted whenever the plugin grab begins, otherwise we leave
listeners unable to clean up if the plugin begins and ends a
grab while there is an ongoing DnD operation.

https://bugzilla.gnome.org/show_bug.cgi?id=784545
2017-11-17 14:43:50 +01:00
Olivier Fourdan
3fc2ea8297 wayland/keyboard: Apply sticky keys masks
MetaWaylandKeyboard maintains its own xkb_state used to update Wayland
clients.

Add the necessary hooks to make sure the sticky keys modifier masks set
in clutter-evdev are also applied in MetaWaylandKeyboard's xkb_state so
that Wayland clients also benefit from sticky keys.

https://bugzilla.gnome.org/show_bug.cgi?id=788564
2017-11-16 14:14:31 +01:00
Olivier Fourdan
333b5d12a0 backends: configure keyboard accessibility
Set the relevant flags and values for keyboard accessibility from
gsettings.

https://bugzilla.gnome.org/show_bug.cgi?id=788564
2017-11-16 14:14:31 +01:00
Olivier Fourdan
dc0fc65229 backend/native: implement bell-notify
https://bugzilla.gnome.org/show_bug.cgi?id=788564
2017-11-16 14:14:31 +01:00
Olivier Fourdan
428af6d213 backend/x11: implement bell-notify
https://bugzilla.gnome.org/show_bug.cgi?id=788564
2017-11-16 14:14:31 +01:00
Olivier Fourdan
0461eed0cb wayland: Disable AccessX in Xwayland
Keyboard accessibility features in Wayland are handled in the
compositor, we do not want AccessX in Xwayland to interfere with the
compositor.

https://bugzilla.gnome.org/show_bug.cgi?id=788564
2017-11-16 14:14:31 +01:00
Jonas Ådahl
0add6f62b6 window/wayland: Handle resizing when headless
We tried to get the geometry scale, which may depend on the main
logical monitor assigned to the window. To avoid dereferencing a NULL
logical monitor when headless, instead assume the geometry scale is 1.

https://bugzilla.gnome.org/show_bug.cgi?id=788764
2017-11-10 10:24:10 +08:00
memeka
049418cd03 renderer/native: Also allow EGL_KHR_platform_gbm extension string
Proprietary drivers such as ARM Mali export EGL_KHR_platform_gbm instead
of EGL_MESA_platform_gbm. As such, GBM platform check should be done for
both MESA and non-MESA drivers.

https://bugzilla.gnome.org/show_bug.cgi?id=780668
2017-11-09 18:16:27 +08:00
Benoit Gschwind
3ee1999c70 backend: Reset current device id when current device removed
Bluetooth mouse usually goes in sleep state after a timeout, when that
happen the mouse is disconnected and on_device_removed function is
called. Before the patch if a touch device is available the
on_device_removed function hide the cursor. The issue is that the cursor
does not reappear once the bluetooth mouse is reconnected because
MetaBackend::current_device_id is not invalidated when on_device_removed
was called.

The patch set MetaBackend::current_device_id to 0 if the current device
is removed. This will make update_last_device to be triggered as soon as
another input device is used or the bluetooth mouse reconnect, as
consequence that the cursor reappear. The id 0 is never given to devices
and can safely used as undefine id.

https://bugzilla.gnome.org/show_bug.cgi?id=761067
2017-11-09 17:42:45 +08:00
Carlos Garnacho
eb236649fc backends: Plug leaks
The DRM properties container must be destroyed with
drmModeFreeObjectProperties, and the connectors must be freed on every
caller. Also make it sure that gbm_device structs are destroyed with the
MetaRendererNativeGpuData that owns them.

https://bugzilla.gnome.org/show_bug.cgi?id=789984
2017-11-07 11:02:00 +01:00
Carlos Garnacho
0a36a4545f core: Plug leaks
The MetaWorkspaceLogicalMonitorData structs are leaked, and so is the
stamps hashtable in MetaDisplay.

https://bugzilla.gnome.org/show_bug.cgi?id=789984
2017-11-07 10:48:45 +01:00
Carlos Garnacho
180985018b wayland: Plug leak
The remote DBus error is leaked.

https://bugzilla.gnome.org/show_bug.cgi?id=789984
2017-11-07 10:48:45 +01:00
Carlos Garnacho
c2fad2dc7c compositor: Keep reference to the screen on the MetaBackground
This is not a leak per se, but it seems too easy to make valgrind
SIGSEGV due to MetaBackground disconnecting signals from an already
destroyed MetaScreen when trying to SIGTERM gnome-shell. Keeping a
reference fixes this.

https://bugzilla.gnome.org/show_bug.cgi?id=789984
2017-11-06 20:51:58 +01:00
Jonas Ådahl
b6200ac3ff wayland/keyboard: Don't transfer layout group when replacing xkb state
The layout group determines what actual keyboard layout in the keymap
to use when translating modifier state and key codes to key syms.
When changing a keymap to another, the layout groups has no relation to
the layout groups in the old keymap, thus there is no reason to
transfer it to the new state.

This fixes an issue where the xkb state in meta-wayland-keyboard.c got
desynchronized with the xkb state in clutter-device-manager-evdev.c.

https://bugzilla.gnome.org/show_bug.cgi?id=789300
2017-11-02 12:10:10 +08:00
Jonas Ådahl
626621a53a renderer-native-gles3: Add cpp error if gl.h was included
On some architectures, including both GLES3/gl3.h GL/gl.h will cause
compilation issues due to incompatible type definitions. To avoid
running into that issue while building on other architectures, make
sure we haven't included GL/gl.h by accident.

https://bugzilla.gnome.org/show_bug.cgi?id=788695
2017-10-30 19:52:42 +08:00
Jonas Ådahl
fb3a64491e renderer-native-gles3: Remove unnecessary includes
They caused conflicts on i686 as GL/gl.h was included by cogl.

https://bugzilla.gnome.org/show_bug.cgi?id=788695
2017-10-30 19:52:42 +08:00
Jonas Ådahl
294f9419f7 renderer-native-gles3: Don't pass GPU when rendering
It wasn't used for anything, so don't pass it.

https://bugzilla.gnome.org/show_bug.cgi?id=788695
2017-10-30 19:52:42 +08:00