1
0
Fork 0
Commit graph

595 commits

Author SHA1 Message Date
Hyungwon Hwang
5fafaf92df dnd: Implement MetaDnd
Implement MetaDnd for emitting DnD signals to plugins such as gnome-shell. The
xdnd handling code comes from gnome-shell, and it is hidden behind MetaDnd now.

https://bugzilla.gnome.org/show_bug.cgi?id=765003
2017-03-07 08:28:36 +08:00
Jonas Ådahl
4e4b24e7a8 backends/x11: Fallback to the first logical monitor when out of focus
When running nested, the pointer can be outside of the stage, meaning
outside of any logical monitor. Handle this when getting the current
logical monitor by falling back to the first logical monitor when the
pointer coordinate is outside of any logical monitor.

https://bugzilla.gnome.org/show_bug.cgi?id=779001
2017-03-06 22:39:03 +08:00
Miguel A. Vico
4fdc551209 MetaRendererNative: Properly handle EGLOutput acquire errors
Whenever an EGLOutput consumer is temporary unable to handle
eglStreamConsumerAcquire() operations (e.g. during a VT-switch),
an EGL_RESOURCE_BUSY_EXT error is generated.

This change adds the appropriate error handling to flip_egl_stream() in
order to recover from such errors.

https://bugzilla.gnome.org/show_bug.cgi?id=779112
2017-03-04 18:34:17 +08:00
Miguel A. Vico
58043cbc8b egl: Add EGL_RESOURCE_BUSY_EXT error
This change adds both the error code and description for
EGL_RESOURCE_BUSY_EXT, recently added to the EGL_EXT_stream_acquire_mode
extension:

  https://github.com/aritger/eglstreams-kms-example/blob/master/proposed-extensions/EGL_EXT_stream_acquire_mode.txt

https://bugzilla.gnome.org/show_bug.cgi?id=779112
2017-03-04 18:34:17 +08:00
Miguel A. Vico
09fa27cd09 egl: Add stream-related error descriptions
This change adds descriptions for the following errors to
get_egl_error_str():

  - EGL_BAD_STREAM_KHR
  - EGL_BAD_STATE_KHR
  - EGL_BAD_DEVICE_EXT
  - EGL_BAD_OUTPUT_LAYER_EXT

https://bugzilla.gnome.org/show_bug.cgi?id=779112
2017-03-04 18:34:17 +08:00
Jonas Ådahl
d8ee96c6cb egl: Pass EGL errors via custom error domain
Introduce META_EGL_ERROR and have the error code be EGL error codes.

https://bugzilla.gnome.org/show_bug.cgi?id=779112
2017-03-04 18:34:17 +08:00
Owen W. Taylor
383ba566bd Call cogl_xlib_renderer_set_threaded_swap_wait_enabled()
Set up things so that if the INTEL_swap_event extension is not present,
but the driver is known to have good thread support, we use an extra
thread and call glXWaitVideoSync() in the thread. This allows idles
to work properly, even when Mutter is constantly redrawing new frames;
otherwise, without INTEL_swap_event, we'll just block in glXSwapBuffers().

https://bugzilla.gnome.org/show_bug.cgi?id=779039
2017-02-21 16:25:02 -05:00
Rui Matos
966725fcb4 meta-input-settings: Avoid setting key repeat delay or interval to 0
Since doing so causes either errors or misbehavior.

https://bugzilla.gnome.org/show_bug.cgi?id=776919
2017-02-16 16:49:44 +01:00
Rui Matos
90923903ae MetaInputSettings: allow edge scrolling without 2fg capable devices
We should only force edge scrolling off if two finger is enabled *and*
we actually have two finger capable devices.

https://bugzilla.gnome.org/show_bug.cgi?id=778554
2017-02-16 16:49:44 +01:00
Carlos Garnacho
2d18b18fe5 backends: Allow opening /sys/ files on MetaLauncher
libinput may want to access those for fetching LED status, as those are
requested readonly, just forward the request to plain open().

https://bugzilla.gnome.org/show_bug.cgi?id=778472
2017-02-16 13:48:55 +01:00
Jonas Ådahl
bd2ca79a48 backends/x11: Only apply keymap when not running nested
https://bugzilla.gnome.org/show_bug.cgi?id=777800
2017-02-15 14:04:16 +08:00
Jonas Ådahl
6d64123849 backends/x11: Split up X11 backend into Cm and Nested
Split up the X11 backend into two parts, one for running as a
Compositing Manager, and one for running as a nested Wayland
compositor.

This commit also cleans up the compositor configuration calculation,
attempting to make it more approachable.

https://bugzilla.gnome.org/show_bug.cgi?id=777800
2017-02-15 14:04:16 +08:00
Carlos Garnacho
7e3fbfbdd2 wayland: Notify tablet mode switches
This will show a fancy OSD so the change is immediately visible.

https://bugzilla.gnome.org/show_bug.cgi?id=771098
2017-02-10 20:11:19 +01:00
Carlos Garnacho
ff453c1143 backends: Notify tablet mapping changes in the UI
This takes over the older code in g-s-d.

https://bugzilla.gnome.org/show_bug.cgi?id=771098
2017-02-10 20:11:19 +01:00
Carlos Garnacho
efd9d467f2 backends: Add action label to mode switch buttons
https://bugzilla.gnome.org/show_bug.cgi?id=771098
2017-02-10 20:11:19 +01:00
Carlos Garnacho
fff7da2a96 backends: Have meta_input_settings_handle_pad_button() take an event
As all the relevant backends are expected to provide
ClutterPadButtonEvents, it makes no sense to split the information,
plus all other event fields are now available and might be needed
in the future.

https://bugzilla.gnome.org/show_bug.cgi?id=771098
2017-02-10 20:11:19 +01:00
Carlos Garnacho
45c9786434 backends/native: Implement keep-aspect
Using ClutterInputDeviceEvdev::output-aspect-ratio. This only applies
to devices which are not calibratable, so again we need to implement
this at the toolkit level.

https://bugzilla.gnome.org/show_bug.cgi?id=774115
2017-02-10 16:31:50 +01:00
Carlos Garnacho
cfbc4fe4d0 backends/native: Use libinput calibration matrix for calibration
We couldn't properly merge output-mapping matrix and calibration into
one. Now that libinput calibration matrix is free to use, we can
actually implement tablet calibration with it.

https://bugzilla.gnome.org/show_bug.cgi?id=774115
2017-02-10 16:31:50 +01:00
Carlos Garnacho
dae5f06069 backends/native: Use ClutterInputDeviceEvdev::device-matrix for map-to-output
The libinput calibration matrix should only be used for calibration purposes,
this ClutterInputDeviceEvdev property has been added in place.

https://bugzilla.gnome.org/show_bug.cgi?id=774115
2017-02-10 16:31:50 +01:00
Jonas Ådahl
962e1d5a69 MetaCursorRendererNative: Always force set hw cursor the first time
The initial state of the hardware cursor is not known, so always force
update it the first time we update the cursor. Do this by changing the
'force' flag of update_hw_cursor() to an 'invalidated' hw cursor state.

https://bugzilla.gnome.org/show_bug.cgi?id=771056
2017-02-07 11:19:52 +08:00
Carlos Garnacho
9c79a1631d backends: Pass seat ID to evdev ClutterDeviceManager
Clutter assumed seat0 which is most usually, but not always correct.
Add an evdev-backend specific function to allow passing the seat
that will be used for ClutterDeviceManager construction, which we
already obtain in MetaLauncher.

https://bugzilla.gnome.org/show_bug.cgi?id=778092
2017-02-02 23:39:02 +01:00
Jonas Ådahl
e357b4a46a monitor-store: Add support for monitor underscanning
Add a <monitor> subelement <underscanning> for configuring
output underscanning.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:56 +08:00
Jonas Ådahl
097ca01411 legacy-monitor-config: Init is_underscanning config field from output
Don't loose the is_underscanning field when creating a new configuration.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:56 +08:00
Jonas Ådahl
e8197e8e05 monitor-config-manager: Add underscanning to MetaMonitorConfig
Set the underscanning state via the monitor config struct so that it
can be configured.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:56 +08:00
Jonas Ådahl
7fc6b8a746 legacy-monitor-config: Fix primary output state
The MetaOutput::is_primary state was not correctly managed in two cases:

 * for tiled monitors, the primary state got overridden when setting
   the preferred resolution
 * for laptop lid, it was not set if the laptop panel happened to be
   the first output

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:56 +08:00
Jonas Ådahl
9b4e1903e1 monitor-config-manager: Prefer to use stored config
If not explicitly set by the backend, prefer to use the stored config
instead of creating a new one, if available.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:56 +08:00
Jonas Ådahl
1ad386bc28 Introduce MetaMonitorConfigStore
MetaMonitorConfigStore provides an XML storage mechanism for
MetaMonitorConfigManager. It stores configuration files defined in the
same level as the MetaMonitorsConfig format, i.e. refers to high level
"monitors" and "monitor modes" instead of connectors and CRTCs.

Only reading custom files are implemented and so far unused.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:56 +08:00
Jonas Ådahl
20cd885443 backend: Only center pointer when not headless
When we are headless, there is no logical monitor to try to center the
pointer on, so just skip it.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:56 +08:00
Jonas Ådahl
3f994646f2 monitor-config-manager: Handle headless setup gracefully
Handle headless setup gracefully by having no logical monitors. This
commit only makes the monitor management code deal with it; other areas
may still not be able to handle it.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:56 +08:00
Jonas Ådahl
4b33f05eda monitor-config-manager: Add MetaMonitorsConfig creation helper
Add a meta_monitors_config_new() helper. It's exposed outside of
meta-monitor-config-manager.c already, as it'll be used externally in a
later commit.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:55 +08:00
Jonas Ådahl
f19cb6a610 monitor-config-manager: Handle laptop lid being closed
Handle configuring when the laptop lid is closed. This is so far
handled by creating a linear configuration while ignoring the laptop
panel. Changing the current configuration will come later.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:55 +08:00
Jonas Ådahl
f7b6271d86 monitor-manager: Move UpClient signal listening into monitor manager
Move the UpClients notify::lid-is-closed signal handling into
MetaMonitorManager, and put the getter behind a vfunc. This means
Placing it behind a vfunc allows custom backends to implement it
differently; for example the test backend can mock the state.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:55 +08:00
Jonas Ådahl
a0af7e94a6 monitor-config-manager: Add support for suggested configuration
Create a suggested configuration, if such configuration is provided.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:55 +08:00
Jonas Ådahl
f607b03456 monitor: Add API to query suggested position
Adds an API to get the position suggested by the backend. This
translates to position advertised by some VM:s, used to hint at a
position making the position more natural (i.e. placed similarly to how
it may be placed on the host desktop).

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:55 +08:00
Jonas Ådahl
644ee666f6 Introduce new monitor configuration system
The new monitor configuration system (MetaMonitorConfigManager) aims to
replace the current MetaMonitorConfig. The main difference between the
two is that MetaMonitorConfigManager works with higher level input
(MetaMonitor, MetaMonitorMode) instead of directly looking at the CRTC
and connector state. It still produces CRTC and connector configuration
later applied by the respective backends.

Other difference the new system aims to introduce is that the
configuration system doesn't manipulate the monitor manager state; that
responsibility is left for the monitor manager to handle (it only
manages configuration and creates CRTC/connector assignments, it
doesn't apply anything).

The new configuration system allows backends to not rely on deriving the
current configuration from the CRTC/connector state, as this may no longer be
possible (i.e. when using KMS and multiple framebuffers).

The MetaMonitorConfigManager system is so far disabled by default, as
it does not yet have all the features of the old system, but eventually
it will replace MetaMonitorConfig which will at that point be removed.
This will make it possible to remove old hacks introduced due to
limitations in the old system.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:55 +08:00
Jonas Ådahl
ee0677a021 monitor-manager: Let backend implementations handle inital config
How the initial configuration is done depends on the backend, so let
them do it themself.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:55 +08:00
Jonas Ådahl
0b4d80d74f wayland/output: Operate on monitors instead of outputs
Operate on MetaMonitor's instead of MetaOutput's, as the latter may be
only a subset of an actual "monitor" when referring to the physical
computer equipment.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:55 +08:00
Jonas Ådahl
9ceeddd952 monitor: Track current monitor mode
Track what monitor mode is the current. This is derived from the mode
of the corresponding CRTC's.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:55 +08:00
Jonas Ådahl
e1849ccbfa monitor: Add getter for vendor and serial
https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:55 +08:00
Jonas Ådahl
6262b46928 wayland/output: Pass 'unknown' subpixel order when mismatch
When a logical monitor constains monitors with different subpixel
ordering, make the wl_output have the subpixel order 'unknown' so that
clients don't make assumptions given only a subset of the monitors of
the given region.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:55 +08:00
Jonas Ådahl
8752f40792 monitor-manager-kms: Some harmless style fixes
https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:55 +08:00
Jonas Ådahl
8c5600e81b monitor-manager-kms: Handle EDID blob not being ready immediately
Sometimes we hit a race on hot-plug where we try to read the KMS
resources and the EDID blob is not yet ready. This would normally
result in a ENOENT when retrieving the blob. Handle this by retrying
after 50 milliseconds after a hot-plug event. Do this up to 10 times,
and after that give up trying to get the EDID blob and continue with
best effort.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:55 +08:00
Jonas Ådahl
4c1b48d0cc monitor: Add API to get monitor mode from spec
https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:55 +08:00
Jonas Ådahl
536ae8430b monitor-manager: Add API to get monitor from monitor spec
https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:55 +08:00
Jonas Ådahl
aaddf44d45 monitor-manager: Add API to find primary monitor
https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:55 +08:00
Jonas Ådahl
0c42faf34d monitor-manager: Some trivial style fixes
https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:54 +08:00
Jonas Ådahl
be13d0f8ee monitor: Allow monitor mode foreach crtc iterator failable
Allow the function used to iterate over the CRTC modes of a monitor
mode to fail, causing the iteration to fail as well.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:54 +08:00
Jonas Ådahl
b70187c2d9 monitor-manager: Move meta_monitor_manager_ function to right place
Move a meta_monitor_manager_ function to meta-monitor-manager.c where
it belongs.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:54 +08:00
Jonas Ådahl
c041851fa5 monitor-manager: Rename read_current_config to read_current_state
The function meta_monitor_manager_read_current_config() was renamed to
meta_monitor_manager_read_current_state() as it does not read any
configuration, but reads the current state as described by the backend.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:54 +08:00
Jonas Ådahl
b59a8b1de3 monitor-manager: Move configuration paths behind 'legacy' functions
In preparation of replacing the configuration system with one working
with high level monitors instead of low level outputs etc, move
configuarion handling code into obviously named function (containing
the word 'legacy'.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:54 +08:00