1
0
Fork 0
Commit graph

241 commits

Author SHA1 Message Date
Carlos Garnacho
8188cddcf7 backends: Add meta_monitor_manager_get_monitor_at_point()
This function returns the monitor_info index corresponding to the given
coordinates, or -1 if none is found at that point. The native backend
has been changed in places where it could make use of this function.

https://bugzilla.gnome.org/show_bug.cgi?id=746896
2015-03-30 14:00:31 +02:00
Ray Strode
9f17c05a15 wayland: manually activate/deactivate stage when taking/dropping grab
clutter currently never emits activated or deactivated signals on
the stage object when using the EGL backend. Since the stage never
gets activated, accessibility tools, like orca, don't work.

This commit makes mutter take on the responsibility, by tracking
when the stage gains/loses focus, and then synthesizing stage
CLUTTER_STAGE_STATE_ACTIVATED state events.

A limitation of this approach is that clutter's own notion of
the stage activeness won't reflect mutter's notion of the
stage activeness.  This isn't a problem, in practice, and can
be addressed in the medium-term after making changes to
clutter.

https://bugzilla.gnome.org/show_bug.cgi?id=746670
2015-03-28 11:20:48 -04:00
Ondrej Holy
f9e91bf007 backends/native: Fix scroll method enums
The enums are swapped currently, because for edge scroll is enabled two finger
scroll and similary for two finger scroll is enabled edge scroll, what is
apparently wrong.

https://bugzilla.gnome.org/show_bug.cgi?id=746870
2015-03-27 13:08:11 +01:00
Jonas Ådahl
aac5a5dcaf MetaMonitorManager: Fix comment
https://bugzilla.gnome.org/show_bug.cgi?id=744932
2015-03-25 12:30:11 +08:00
Carlos Garnacho
3a2920d4bc backends/x11: Implement set_click_method configuration option
https://bugzilla.gnome.org/show_bug.cgi?id=746290
2015-03-16 18:05:51 +01:00
Carlos Garnacho
ad13fa3bb3 backends/native: Implement set_click_method configuration option
https://bugzilla.gnome.org/show_bug.cgi?id=746290
2015-03-16 18:05:51 +01:00
Carlos Garnacho
9b50119d31 backend: Add set_click_method MetaInputSettings vfunc
This will configure the libinput_config_click_method for touchpads.

https://bugzilla.gnome.org/show_bug.cgi?id=746290
2015-03-16 18:05:51 +01:00
Rui Matos
43058a3698 monitor-manager-kms: Tell cogl to ignore CRTCs when DPMS isn't ON
Otherwise cogl will try to page flip and fail.

https://bugzilla.gnome.org/show_bug.cgi?id=746098
2015-03-16 16:32:56 +01:00
Carlos Garnacho
3471ef3441 backend: Update cursor visibility based on device availability
On startup, the cursor is kept hidden if there's any touchscreen available.
If the device that was last interacted is removed, we check on available
pointing devices though, so we don't possibly hide the pointer if there are
further mice/touchpads/etc.

Devices being added don't update cursor visibility, we wait for the user
interacting with those instead.

https://bugzilla.gnome.org/show_bug.cgi?id=712775
2015-03-13 21:04:01 +01:00
Carlos Garnacho
af9d8f1931 backends/x11: Call meta_backend_update_last_device() from XI_DeviceChanged
On X11, calling this function on meta_display_handle_events() will not catch
mouse events happening over clients, so poke directly in the backend for
XI_DeviceChanged events, which mutter will get on device switches.

The code has been slightly refactored so we deal with XIEvents at a single
handle_input_event() function.

https://bugzilla.gnome.org/show_bug.cgi?id=712775
2015-03-13 21:01:11 +01:00
Carlos Garnacho
9e3bac0237 backend: Add meta_backend_update_last_device()
This function can be used to trigger changes depending on the device type
that is currently emitting the events. So far, it is used to switch cursor
visibility on/off on touchscreen interaction.

A "last-device-updated" signal has also been added, in order allow hooking
other behavior changes (eg. OSK) when the last device changes.

https://bugzilla.gnome.org/show_bug.cgi?id=712775
2015-03-13 21:01:11 +01:00
Marek Chalupa
5636784604 native: make sure the pointer is in the visible area after init
The initial pointer position is set by clutter. At the moment it
is the point 16x16 on the screen. But this point is not always
in the visible area on monitors (the monotors can be arranged in
many different ways).

https://bugzilla.gnome.org/show_bug.cgi?id=745752
2015-03-09 14:26:34 +01:00
Rui Matos
9a3b178da1 backend-native: Ensure the pointer is visible on monitors-changed
Otherwise the pointer might be "lost" outside the visible area. Note
that the constraining code only ensures the pointer doesn't leave the
visible area but if the pointer is already outside because the rug was
pulled under it then it doesn't do anything.

https://bugzilla.gnome.org/show_bug.cgi?id=745121
2015-03-09 14:26:17 +01:00
Rui Matos
9c6e6ea381 monitor-manager-kms: Fix a crash getting a crtc-less output's scale
https://bugzilla.gnome.org/show_bug.cgi?id=745476
2015-03-02 18:48:56 +01:00
Rui Matos
db9645fcb3 monitor-manager-kms: Cope with non-existent connectors and encoders
DRM objects like connectors and encoders might change at any time, in
particular they might become invalid between drmModeGetResources() and
getting the actual objects in which case they'll be NULL. Be defensive
against that.

Note that, if this happens, we should get another udev event soon
which will cause us to update our state.

https://bugzilla.gnome.org/show_bug.cgi?id=745476
2015-03-02 18:48:55 +01:00
Rui Matos
6af48d75a4 monitor-manager-kms: Don't store a list of encoders
It's not needed outside of read_current() and current_encoder is
totally unused.

https://bugzilla.gnome.org/show_bug.cgi?id=745476
2015-03-02 18:48:53 +01:00
Marek Chalupa
6234f7d1db native: fix pointer constraining
fix copy-paste mistake in computing bottom constrain.
Also save few instructions by moving setting of
always-the-same value off loop.

https://bugzilla.gnome.org/show_bug.cgi?id=727337
2015-03-02 16:00:49 +01:00
Jonas Ådahl
301a65e05a backends/dummy: Set scale of dummy output
To make the nested compositor mode work again after "backends/native:
Calculate the output scale in here", set the scale when creating the
dummy output.

https://bugzilla.gnome.org/show_bug.cgi?id=745401
2015-03-02 10:58:16 +08:00
Jasper St. Pierre
78d8525699 backends/native: Calculate the output scale in here
It makes more sense as a backend thing, not a frontend thing.
2015-02-26 00:13:28 -08:00
Jasper St. Pierre
23c00688b4 launcher: Fix a gcc warning
self could be returned uninitialized.
2015-02-26 00:13:16 -08:00
Ray Strode
cbad65f657 native: don't leak logind session proxy
It's currently getting leaked in error paths

https://bugzilla.gnome.org/show_bug.cgi?id=745141
2015-02-25 10:56:50 -05:00
Jasper St. Pierre
af9072e725 backend: Add a hack to force the dummy monitor manager
This is helpful when testing mutter under Xephyr.
2015-02-17 23:45:02 -08:00
Rui Matos
7f19db1f7b monitor-manager: Expose a method to get a monitor from an output
This method will be used by gnome-shell to resolve an output ID
(exposed from the org.gnome.Mutter.DisplayConfig DBus API) to a
logical monitor.

https://bugzilla.gnome.org/show_bug.cgi?id=743745
2015-01-30 13:13:49 -05:00
Rui Matos
3f2d658f20 monitor-manager: Expose MetaMonitorManager to introspection
This just exposes the type and the singleton getter necessary to make
it available to introspection. We'll expose more functionality as it
becomes needed.

https://bugzilla.gnome.org/show_bug.cgi?id=743745
2015-01-30 13:13:49 -05:00
Rui Matos
ad90b7dd2f monitor-manager: Initialize MetaOutput even when we can't get the EDID
Otherwise we'll crash later when building a MetaConfiguration.

https://bugzilla.gnome.org/show_bug.cgi?id=743412
2015-01-27 14:42:45 +01:00
Jasper St. Pierre
7e7c8ecbd4 backend-x11: Also spoof Enter/Leave notifies as well
So that we track when the user enters/exits the frame window
appropriately. This fixes a rogue cursor appearing when the window
doesn't define one.
2015-01-19 21:56:32 -08:00
Jonas Ådahl
db384a656c backends/native: Implement support for pointer barriers
When running as a dispay server pointer barriers are a server side
feature and requires no client interaction of any sort. This patch
implements pointer barriers that can be used when running as a display
server on the native backend. Running as a display server using the X11
backend is currently not supported.

https://bugzilla.gnome.org/show_bug.cgi?id=706655
2015-01-19 02:27:59 -08:00
Carlos Garnacho
1dea1813b1 input-settings: Handle device-to-output mapping
For each device that can be mapped (touchscreens, tablets), the output
will be fetched from settings and matched with the currently connected
ones. If a match is found, the device matrix will be found out from the
output configuration and set on the device.

This is also updated both individually for newly connected devices, and
collectively on output configuration changes.

https://bugzilla.gnome.org/show_bug.cgi?id=739397
2015-01-18 13:32:28 -08:00
Carlos Garnacho
71c4138933 monitor-manager: Add method to find an output matrix
This will be useful to determine input device matrices for touchscreens
and tablets.

https://bugzilla.gnome.org/show_bug.cgi?id=739397
2015-01-18 13:32:28 -08:00
Carlos Garnacho
049f67df0a native: Remove previous listener for keyboard settings
The settings-daemon peripherals schemas are going away, and this is
now handled through MetaInputSettings.

https://bugzilla.gnome.org/show_bug.cgi?id=739397
2015-01-18 13:32:28 -08:00
Carlos Garnacho
2d878d3f55 backends/native: Add libinput-based MetaInputSettings implementation
The libinput_device is fetched from the ClutterInputDevice, and configured
through the libinput_device_*config* API.

https://bugzilla.gnome.org/show_bug.cgi?id=739397
2015-01-18 13:32:28 -08:00
Carlos Garnacho
3c06f2dc90 backends/x11: Implement X11-specific MetaInputSettings
This goes through modifying XI2 device properties, either common ones (eg.
set on every device) or those specific to the libinput X11 driver. Keyboard
repeat/rate are set through core and XKB APIs.

https://bugzilla.gnome.org/show_bug.cgi?id=739397
2015-01-18 13:32:28 -08:00
Carlos Garnacho
460e1fd7ca backends: Add MetaInputSettings
This object internally keeps track of the relevant input configuration,
and goes through its vmethods in order to apply the configuration on the
backend-specific devices.

So far, only mouse/touchpad settings are actually attached to GSettings
changes. ::set_matrix(), meant for tablets/touchscreens, is not hooked
yet.

One caveat is that meta_input_settings_create() may return NULL if the
backend does not own the windowing system (wayland nested on X11 being
the one case), and thus device settings can't be changed freely.

https://bugzilla.gnome.org/show_bug.cgi?id=739397
2015-01-18 13:32:28 -08:00
Jasper St. Pierre
f083935c6e barrier: Fix type cast macros 2015-01-18 13:32:28 -08:00
Jasper St. Pierre
ef32bbdc99 x11/barrier: Fix build
We were missing the get_type() function.
2015-01-17 17:42:48 -08:00
Jonas Ådahl
5f91a62f6f barriers: Separate implementation from public API
This patch removes the X11 specific code from MetaBarrier and creates an
abstraction layer MetaBarrierImpl. The existing X11 implementation is
moved to a new GObject MetaBarrierImplX11 implementing the abstract
interface MetaBarrierImpl which is instantiated by MetaBarrier when
supported.

While at it, move it to backends/ and properly name the files.

https://bugzilla.gnome.org/show_bug.cgi?id=706655
2015-01-17 17:22:57 -08:00
Carlos Garnacho
625d3de2ee backends: Make KMS EDID information equal to X11's
EDID parsing has been refactored to a common meta_output_parse_edid()
function, which ensures the extracted information is the same on both KMS
and X11 backend, so it can be used consistently on eg. settings values.

https://bugzilla.gnome.org/show_bug.cgi?id=742882
2015-01-14 12:16:18 +01:00
Marek Chalupa
b6d070b06f wayland: Seal SHM buffers before access
If wayland client lies about size of given buffer, compositor could touch bad
memory and get SIGBUS. Wayland provides simple API to fix it - so fix it!

[1] http://cgit.freedesktop.org/wayland/wayland/tree/src/wayland-server.h#n416
[2] http://lists.freedesktop.org/archives/wayland-devel/2013-November/012159.html

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>

https://bugzilla.gnome.org/show_bug.cgi?id=727893
2015-01-09 16:39:37 -08:00
Jasper St. Pierre
9c73e21113 xrandr: Remove mode fudge code for HSkew
This was part of a downstream patch that Endless has where we hid some
secret parameters inside the HSkew field. It wasn't meant as upstream
logic.
2015-01-08 15:04:50 -08:00
Jasper St. Pierre
34ba868b4c monitor-manager-xrandr: Fix a minor typo in an error message 2015-01-05 15:23:17 -08:00
Jasper St. Pierre
b9fb4a5887 backend: Use a GHashTable for device monitors
The array code has been tricky to maintain and leaky. Let's just use a
GHashTable to simplify our lives.
2014-12-31 08:53:57 -08:00
Jasper St. Pierre
57af975154 monitor-manager-dummy: Fill in connector_type 2014-12-29 17:15:23 -08:00
Jasper St. Pierre
c5940580ed monitor-manager: Use connector_type instead of name sniffing 2014-12-29 17:15:23 -08:00
Jasper St. Pierre
8296d4cdce monitor-config: Fix build 2014-12-29 17:15:23 -08:00
Jasper St. Pierre
c1db9d9181 monitor-config: Replace output name heuristics with connector_type
It's more difficult to replace the MetaOutputKey usage, so just
do this for now.
2014-12-29 16:46:06 -08:00
Jasper St. Pierre
9d2cd8ff87 monitor-config: Use existing key_is_laptop
We already have this code elsewhere.
2014-12-29 16:41:13 -08:00
Jasper St. Pierre
d514e8ab41 monitor-manager: Add a connector-type property
This is so gnome-settings-daemon
2014-12-29 16:30:54 -08:00
Jasper St. Pierre
4450b5bb14 Revert "backends: Include Xfixes for cursor events and manipulation"
This reverts commit 34421e90c3.

These aren't needed at all.
2014-12-28 22:41:42 -08:00
Ikey Doherty
34421e90c3 backends: Include Xfixes for cursor events and manipulation
Signed-off-by: Ikey Doherty <michael.i.doherty@intel.com>

https://bugzilla.gnome.org/show_bug.cgi?id=737463
2014-12-28 22:40:39 -08:00
Rui Matos
68542ae1ef Revert "monitor-manager-xrandr: Don't do extra work on RRScreenChangeNotify"
This reverts commit 47e339b46e. The
approach that was used to reduce the amount of work we do on RR events
to the necessary minimum is flawed. It assumes that, when the first
event we see where the retrieved XRRScreenResources.timestamp is
bigger than the previous, we already have all the data we need to
rebuild our view of the world.

That isn't true however, because the X server sends
RRScreenChangeNotify events for every step of the configuration
change, i.e. it lacks an atomic reconfiguration API. In particular, if
the X screen size is one of the changes, when we rebuild our state and
emit monitors-changed, the X screen size might still be the previous
one and since we stop updating ourselves until another reconfiguration
happens (noticed by looking at XRRScreenResources.timestamp) we end up
with the wrong idea of the X screen size.

https://bugzilla.gnome.org/show_bug.cgi?id=738630
2014-12-28 17:21:50 -08:00