1
0
Fork 0
Commit graph

6625 commits

Author SHA1 Message Date
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
Carlos Garnacho
89f5ca3301 backends: Unref variants obtained from g_variant_iter_get_next_value()
Those are being leaked.

https://bugzilla.gnome.org/show_bug.cgi?id=789553
2017-10-27 13:22:12 +02:00
Jonas Ådahl
07745b3082 wayland/surface: Disconnect actor handlers before unassigning role
The handlers depend on a role being assigned. Destroying the window
causes it to become unmapped, which would sometimes trigger one of the
handlers, resulting in an is-assigned assert hitting in one of the
handlers. Avoid this by disconnecting the handlers earlier, so that
there is no risk that any them being triggered before the role is
assigned.

https://bugzilla.gnome.org/show_bug.cgi?id=789552
2017-10-27 19:08:38 +08:00
Daniel van Vugt
054c25f693 wayland: Allow Xwayland to leave core dumps
For historical Xorg-reasons, Xwayland would disable its own core dumps by
default. This is a problem because Xwayland crashing is the biggest cause of
gnome-shell crashes [1][2], and we still have no idea why due to there being
no dumps from Xwayland. So enable core dumping from Xwayland.

https://bugzilla.gnome.org/show_bug.cgi?id=789086

[1] https://bugs.launchpad.net/bugs/1505409
[2] https://bugs.launchpad.net/bugs/1556601
2017-10-26 19:50:40 -05:00
Carlos Garnacho
01de04d8c9 wayland: Update pointer confinement on surface actor relocations
In the unlikely case that a surface is moved by the compositor while
holding a pointer confinement, we also need to update the pointer
position when the surface actor gets moved.

https://bugzilla.gnome.org/show_bug.cgi?id=782344
2017-10-26 12:53:20 +02:00
Carlos Garnacho
08e4cb54a8 wayland: Trigger wl_output updates on actor position changes
Both notify::position on the surface actor and position-changed on
MetaWindow are listened to, in order to trigger wl_output updates for
wl_surfaces whenever the surfaces move across them.

Both signals are necessary in order to cater for toplevel and subsurface
relocations (Because it's the parent window actor what changes position
in this last case).

Also, shuffle signal disconnection, so each signal goes away with
the object reference held by MetaWaylandSurface.

https://bugzilla.gnome.org/show_bug.cgi?id=782344
2017-10-26 12:51:44 +02:00
Carlos Garnacho
c71faffb71 backends/native: Fix handling of trackball settings
The org.gnome.desktop.peripherals.trackball.scroll-wheel-emulation-button
setting contains buttons X11-style. Work out the BTN evcode that applies
to it when applying the setting on the libinput device.

https://bugzilla.gnome.org/show_bug.cgi?id=787804
2017-10-26 12:48:15 +02:00
Marco Trevisan (Treviño)
91e3a0b3a9 MetaWindowActor: assert that we have plugin manager on simple effect
It looks that there are some extensions that run a Mainloop on startup,
causing to dispatch a clutter paint before the compositor is even available.
In such scenario a MetaWindow could try to start a simple effect
using a compositor plugin which is not there yet.

Then in order to catch these bugs we can now assert that the expected
conditions are valid, so that gnome-shell will provide a dumpstack to
debug the real offending JS code.

https://bugzilla.gnome.org/show_bug.cgi?id=789223
2017-10-24 04:42:54 -05:00
Marco Trevisan (Treviño)
ab5ac21104 window: rename get_flatpack_id into get_sandboxed_app_id
This function can be more generic now.

https://bugzilla.gnome.org/show_bug.cgi?id=789277
2017-10-21 13:36:16 -05:00
Marco Trevisan (Treviño)
0ebea2be9c Revert "MetaWindowActor: don't start any effect when no compositor is available"
This reverts commit 35fcf4a4ae.
2017-10-20 03:25:31 -05:00
Marco Trevisan (Treviño)
6f54bab0a8 Revert "MetaPluginManager: don't try to deference a NULL pointer when processing events"
This reverts commit 74565380aa.
2017-10-20 03:23:28 -05:00
Marco Trevisan (Treviño)
5d7deab6da Revert "display: trap X errors in get_current_time_roundtrip"
This reverts commit cc772ddd61.
2017-10-20 03:22:59 -05:00
Marco Trevisan (Treviño)
35fcf4a4ae MetaWindowActor: don't start any effect when no compositor is available
There are cases when no compositor is available (yet) but a MetaWindow tries
to start a simple effect using a compositor plugin which is not available.
In that case we should just ignore any request and protect ourselves from
crashes.

https://bugzilla.gnome.org/show_bug.cgi?id=789223
2017-10-20 16:10:18 +08:00
Marco Trevisan (Treviño)
74565380aa MetaPluginManager: don't try to deference a NULL pointer when processing events
This function might be called by components with invalid plugin manager
(as it might happen to MetaWindow when the compositor isn't initialized
properly), so we need to protect ourselves from crashes.

https://bugzilla.gnome.org/show_bug.cgi?id=789223
2017-10-20 16:10:18 +08:00
Marco Trevisan (Treviño)
fa37496ffb MetaLogicalMonitor: free the monitors list on finalize
https://bugzilla.gnome.org/show_bug.cgi?id=789227
2017-10-20 16:10:18 +08:00
Marco Trevisan (Treviño)
cc772ddd61 display: trap X errors in get_current_time_roundtrip
Only return the actual timestamp if we get one.

https://bugzilla.gnome.org/show_bug.cgi?id=788971
2017-10-20 16:10:18 +08:00
Rui Matos
3caefd8fda compositor: Avoid a crash if the top window actor is finalized
Since we're not holding a reference, the top window actor might be
finalized when we paint resulting in a use after free crash.

https://bugzilla.gnome.org/show_bug.cgi?id=788493
2017-10-19 18:37:34 +02:00
Jonas Ådahl
12381d57d1 monitor-unit-tests: Check non-first preferred modes
Check that if there are multiple modes with the same ID (resolution,
refresh rate and handled flags) we correctly add the preferred mode to
the list of monitor modes.

https://bugzilla.gnome.org/show_bug.cgi?id=789153
2017-10-19 10:17:14 +08:00
Jonas Ådahl
4ad8c4b86b monitor/normal: Prefer modes with same flags as preferred mode
When generating MetaMonitorMode's, prefer CRTC modes that has the same
set of flags as the preferred mode. This not only is probably a better
set of configurable modes, but it'll guarantee that the preferred mode
is added.

This fixes a crash when the preferred mode was not the first mode with
the same resolution, refresh rate and set of handled modes.

https://bugzilla.gnome.org/show_bug.cgi?id=789153
2017-10-19 10:16:50 +08:00