1
0
Fork 0
Commit graph

316 commits

Author SHA1 Message Date
Rui Matos
9abc071283 backend-x11: Fallback to a default keymap if getting it from X fails
This shouldn't fail but apparently sometimes it does and in that case
having a possibly wrong idea of the keymap is still better than
crashing.

https://bugzilla.gnome.org/show_bug.cgi?id=754979
2015-09-25 19:09:48 +02:00
Florian Müllner
67d3a7a2d7 meta-monitor-manager: Remove bogus condition from check
An unsigned number is never smaller than 0, so we don't have to
check for it.
2015-09-24 03:08:23 +02:00
Florian Müllner
bc00f118f3 Avoid shadowing existing variables 2015-09-24 03:08:22 +02:00
Florian Müllner
27b37407d0 Don't duplicate declarations from G_DEFINE_TYPE 2015-09-24 03:01:51 +02:00
Jonas Ådahl
b7aca07844 Revert "launcher: simplify getting session dbus proxy"
Signals are sent to a specific ID, so we can't use "self" here. After
this revert, VT switching works again.

This reverts commit 8e22bf5bc9.

https://bugzilla.gnome.org/show_bug.cgi?id=753434
2015-09-17 12:17:45 +08:00
Florian Müllner
dc780d2c44 launcher: Don't pass variable as format string
We know the variable only contains one or another string literal,
but keep compilers happy as well.
2015-09-16 17:38:10 +02:00
Jonas Ådahl
0373b854c1 MetaCursorRenderer: Rely on update_cursor for redrawing
Calling queue_redraw() in _force_update() is not needed because
update_cursor() will do this when needed, i.e. when switching between
hardware cursor and texture cursor, or when drawing with texture cursor.

There is also no need to force _native_force_update() because
update_cursor() will cover this as well when needed. When not changing
cursor but only the gbm_bo, the "dirty" boolean on the gbm_bo will
trigger a redraw.

https://bugzilla.gnome.org/show_bug.cgi?id=744932
2015-09-13 21:26:22 +08:00
Jonas Ådahl
79c86ae890 Support scaling of cursor sprites given what output they are on
This commits refactors cursor handling code and plugs in logic so that
cursor sprites changes appearance as it moves across the screen.
Renderers are adapted to handle the necessary functionality.

The logic for changing the cursor sprite appearance is done outside of
MetaCursorSprite, and actually where depends on what type of cursor it
is. In mutter we now have two types of cursors that may have their
appearance changed:

 - Themed cursors (aka root cursors)
 - wl_surface cursors

Themed cursors are created by MetaScreen and when created, when
applicable(*), it will extend the cursor via connecting to a signal
which is emitted everytime the cursor is moved. The signal handler will
calculate the expected scale given the monitor it is on and reload the
theme in a correct size when needed.

wl_surface cursors are created when a wl_surface is assigned the
"cursor" role, i.e. when a client calls wl_pointer.set_cursor. A
cursor role object is created which is connected to the cursor object
by the position signal, and will set a correct texture scale given what
monitor the cursor is on and what scale the wl_surface's active buffer
is in. It will also push new buffers to the same to the cursor object
when new ones are committed to the surface.

This commit also makes texture loading lazy, since the renderer doesn't
calculate a rectangle when the cursor position changes.

The native backend is refactored to be triple-buffered; see the comment
in meta-cursor-renderer-native.c for further explanations.

* when we are running as a Wayland compositor

https://bugzilla.gnome.org/show_bug.cgi?id=744932
2015-09-13 21:26:22 +08:00
Jonas Ådahl
e407f5bbae MetaCursorSprite: Squash MetaCurorImage into MetaCursorSprite
It fills little purpose on separating into a MetaCursorImage struct, so
lets squash in the three fields into the MetaCursorSprite object.

https://bugzilla.gnome.org/show_bug.cgi?id=744932
2015-09-13 21:26:22 +08:00
Jonas Ådahl
8900bd2f5c backends/x11: Draw our own cursor sprite when running nested
Use a specialized cursor renderer when running as a nested Wayand
compositor. This new renderer sets an empty X11 cursor and draws the
cursor as part of the stage using the generic cursor renderer drawing
path.

https://bugzilla.gnome.org/show_bug.cgi?id=744932
2015-09-13 21:26:22 +08:00
Ting-Wei Lan
5066eaf691 build: Fix non-wayland build
This fixes build error caused by commit 614d6bd. We can simply remove
the usage of meta-wayland.c functions in non-wayland build because
META_BACKEND_X11_MODE_NESTED is only used in wayland.

https://bugzilla.gnome.org/show_bug.cgi?id=753948
2015-09-08 01:50:03 +08:00
Marek Chalupa
79f755bf0f launcher: find the right drm device
Instead of hard-coding /dev/dri/card0, find the device
that has boot_vga flag set or has been explicitly
assigned a seat id other than seat0

https://bugzilla.gnome.org/show_bug.cgi?id=753434
2015-09-07 08:42:21 -04:00
Marek Chalupa
1845bfe1b6 launcher: refactor handling errors in meta_launcher_new
Fill in missing error checks and use g_error, since any
error in this phase would lead to crash later anyway.
This way we'll at least know what went wrong.

Although it was not the patch's original intention, it fixes
https://bugzilla.gnome.org/show_bug.cgi?id=754520

https://bugzilla.gnome.org/show_bug.cgi?id=753434
2015-09-07 08:40:49 -04:00
Marek Chalupa
8e22bf5bc9 launcher: simplify getting session dbus proxy
Use path "/org/freedesktop/login1/session/self" instead of
getting session id and building the path manually

https://bugzilla.gnome.org/show_bug.cgi?id=753434
2015-09-07 08:40:20 -04:00
Marek Chalupa
c13ddafdb8 native: remove obsolete comment
There's not weston-launch anymore

https://bugzilla.gnome.org/show_bug.cgi?id=753434
2015-09-07 08:39:38 -04:00
Owen W. Taylor
614d6bd0f8 Nested X11: use KeymapNotify events to fix key state on FocusIn
If the user Alt-Tabs out of the window, we will be left thinking
the Alt key is still pressed since we don't see a release for it.

Solve this and other related issues for the nested X11 compositor
by selecting for KeymapStateMask which causes a KeymapNotify event
to be sent after each FocusIn, and when we get these events, update
the internal XKB state and send any necessary modifiers events to
clients.

https://bugzilla.gnome.org/show_bug.cgi?id=753948
2015-09-03 16:02:25 -04:00
Jonas Ådahl
d3fdaa3232 MetaCursorSprite: Put renderer specific code in the renderer
There were lots of code handling the native renderer specific cases;
move these parts to the renderer. Note that this causes the X11 case to
always generate the texture which is a waste of memory, but his
regression will be fixed in a following commit.

The lazy loading of the texture was removed because it was eventually
always loaded anyway indirectly by the renderer to calculate the
current rect.

https://bugzilla.gnome.org/show_bug.cgi?id=744932
2015-08-28 09:55:12 +08:00
Jonas Ådahl
165050f8f9 backends: Get rid of meta-cursor-private.h
There is nothing special about the private API which only consists of
getters for renderer specific backing buffer. Lets them to the regular
.h file and treat them as part of the normal API.

https://bugzilla.gnome.org/show_bug.cgi?id=744932
2015-08-28 09:54:57 +08:00
Jonas Ådahl
b01f95cfdd Make MetaCursorSprite a GObject
To easier track lifetime and utilize other GObject features, make
MetaCursorSprite a GObject.

https://bugzilla.gnome.org/show_bug.cgi?id=744932
2015-08-28 09:52:30 +08:00
Jonas Ådahl
4b667d1e09 Rename MetaCursorReference to MetaCursorSprite
It isn't really a reference to a MetaCursor enum, but a reference
counted cursor sprite, and enum value.

https://bugzilla.gnome.org/show_bug.cgi?id=744932
2015-08-28 09:52:30 +08:00
Jonas Ådahl
975feb9202 MetaCursorRenderer: Use G_DECLARE_DERIVABLE_TYPE to declare the type
https://bugzilla.gnome.org/show_bug.cgi?id=744932
2015-08-19 16:43:44 +08:00
Jasper St. Pierre
a5417ebee1 cursor: Move check for cursor NULL-ness
Before, it used to be in the screen, but now,
meta_cursor_reference_from_theme can never fail. Move it to where we
load the images from the cursor name.
2015-08-18 13:59:29 -07:00
Rui Matos
299ed424d3 compositor: Handle fences in the frontend X connection
Since mutter has two X connections and does damage handling on the
frontend while fence triggering is done on the backend, we have a race
between XDamageSubtract() and XSyncFenceTrigger() causing missed
redraws in the GL_EXT_X11_sync_object path.

If the fence trigger gets processed first by the server, any client
drawing that happens between that and the damage subtract being
processed and is completely contained in the last damage event box
that mutter got, won't be included in the current frame nor will it
cause a new damage event.

A simple fix for this would be XSync()ing on the frontend connection
after doing all the damage subtracts but that would add a round trip
on every frame again which defeats the asynchronous design of X
fences.

Instead, if we move fence handling to the frontend we automatically
get the right ordering between damage subtracts and fence triggers.

https://bugzilla.gnome.org/show_bug.cgi?id=728464
2015-08-13 14:14:46 +02:00
Florian Müllner
cba2ab445e backend-x11: Don't assert on something that might happen
While we shouldn't normally receive crossing events for any windows
except the stage when running nested, we do in case we hold a pointer
grab - just ignore those events instead of taking down the user's
session.
2015-08-10 17:00:57 +02:00
Rui Matos
39763d4add compositor: Add support for GL_EXT_x11_sync_object
If GL advertises this extension we'll use it to synchronize X with GL
rendering instead of relying on the XSync() behavior with open source
drivers.

Some driver bugs were uncovered while working on this so if we have
had to reboot the ring a few times, something is probably wrong and
we're likely to just make things worse by continuing to try.  Let's
err on the side of caution, disable ourselves and fallback to the
XSync() path in the compositor.

https://bugzilla.gnome.org/show_bug.cgi?id=728464
2015-08-07 17:27:42 +02:00
Jonas Ådahl
7ce06928e2 native: Actually close input device fds
Don't only release it, also close the fd so that we don't leak it.

https://bugzilla.gnome.org/show_bug.cgi?id=752753
2015-08-05 10:28:15 +08:00
Rui Matos
2fb8da0d5a backends/monitor-manager: Validate EDID strings
Some monitors return a bunch of bytes on their display descriptor
which aren't valid utf8 and thus we fail to serialize them later on
for the DisplayConfig DBus API.

Let's fall back to the stringified product code and serial number in
that case.

https://bugzilla.gnome.org/show_bug.cgi?id=752673
2015-07-21 16:42:53 +02:00
Matthias Clasen
1b22da0039 Monitor-config: Fix a copy-paste error
The code was checking width twice, instead of width and height,
as was clearly the intention. Coverity pointed this out.

https://bugzilla.gnome.org/show_bug.cgi?id=752551
2015-07-20 17:33:28 -04:00
Carlos Garnacho
8329e97502 backends: Trigger animated cursor animations on the native backend
We will need to update the timeout on either cursor changes, or
right when ticking to the next cursor frame.

https://bugzilla.gnome.org/show_bug.cgi?id=752342
2015-07-20 22:06:44 +02:00
Carlos Garnacho
74ca936a00 backend: Add meta_cursor_renderer_force_update()
There will be times where additional updates will be needed, such
as animated cursors. We should update the texture and redraw in
that case.

https://bugzilla.gnome.org/show_bug.cgi?id=752342
2015-07-20 22:06:44 +02:00
Carlos Garnacho
141760057b backend: Store XcursorImages for theme cursors
There's a chance the icon will be animated, so store the XcursorImages
instead of the individual XcursorImage, and handle that as a nimages=1
special case.

API to "tick" a cursor animation, and retrieve current frame timing
information has been added.

https://bugzilla.gnome.org/show_bug.cgi?id=752342
2015-07-20 22:06:44 +02:00
Jonas Ådahl
441efd17ce MetaMonitorInfo: Provide scale information
Tracking back from the monitor to the output every time we need to
figure out the scale of a window on a monitor is inconvenient, so
propagate the scale from the output to the monitor it is associated
with.

https://bugzilla.gnome.org/show_bug.cgi?id=744934
2015-07-16 11:53:40 +08:00
Jonas Ådahl
bede9970de nested: Allow configuration of dummy output configuration
Enable a user to test and debug multi output configurations on Wayland
without having the available hardware by enabling some basic
configuration of the dummy monitor manager.

Currently available configuration options are:

MUTTER_DEBUG_NUM_DUMMY_MONITORS - to set the number of monitors
MUTTER_DEBUG_DUMMY_MONITOR_SCALES - to configure the monitor scales

See src/backends/meta-monitor-manager-dummy.c for detailed description
of the available configuration parameters.

https://bugzilla.gnome.org/show_bug.cgi?id=747089
2015-07-15 14:55:55 +08:00
Peter Hutterer
5f1bcc124f input-settings-x11: check properties for correctness before changing them
Before submitting a new scroll mode, click method or sendevents mode check if
the value is supported by the device. This avoids BadValue errors when setting
two-finger scrolling on single-finger touchpad devices since we can't easily
handle BadValue (see 9747277b)

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-07-14 16:42:33 -05:00
Jasper St. Pierre
8979e52a6c Install enum types 2015-07-05 22:01:59 -07:00
Cosimo Cecchi
659b8ed471 monitor-manager-xrandr: don't set underscan property when not supported
We should not be setting random output properties like this.
Use the function we just introduced to only set the underscan flag when
it's actually supported.
2015-07-01 18:22:48 -07:00
Cosimo Cecchi
94bce5a00f monitor-manager: add a property to discover if underscan is supported
So that clients such as the control center can decide to hide an
underscanning checkbutton when the output does not support it.

Support in the KMS / native backend to come later...
2015-07-01 18:20:57 -07:00
Jasper St. Pierre
8da5761ffc x11/xrandr: Use xcb to set properties on outputs
It seems that fglrx sometimes gives us absolute junk when requesting the
outputs, and if we don't trap errors, we'll just crash when trying to
configure a junk output. Use xcb so errors simply get ignored.
2015-06-28 13:25:49 -07:00
Peter Hutterer
b55f792302 input-settings-x11: don't create non-existing atoms
If the atom doesn't exist it won't exist on the device either so we can
shortcut the property retrieval/modification. Creating atoms by name but not
doing anything with them also confuses kcm_touchpad

https://bugzilla.redhat.com/show_bug.cgi?id=1199825

https://bugzilla.gnome.org/show_bug.cgi?id=751471
2015-06-26 21:52:45 -07:00
Jasper St. Pierre
2cbaa6660c backend-x11: Fix our awful hack for crossing events, too
For enter / leave events, which we use in the UI code, we need to make
sure that these coordinates are root-relative as well, otherwise the
cursor when entering frames might be incorrect.
2015-06-24 10:35:38 -07:00
Carlos Garnacho
82a7060cdb x11: Fix touch events on nested wayland
If we're running as a nested compositor, we must not attempt to
passive grab on the root window, and we should be setting the
touch event mask on the stage window.

https://bugzilla.gnome.org/show_bug.cgi?id=751036
2015-06-16 20:39:46 +02:00
Jasper St. Pierre
6aead0c67c backend-x11: Use a mode switch to determine whether we're nested or not
The "meta_is_wayland_compositor" checks were getting a bit difficult to read.
2015-06-16 08:13:13 -07:00
Jasper St. Pierre
9747277b7e Revert "input-settings-x11: Use xcb to change input settings"
This reverts commit 989f9630a4.

xcb is not smart enough to properly submit requests for
XIChangeProperty. Let's revert this until we can fix xcb.
2015-06-12 00:49:39 -04:00
Jasper St. Pierre
989f9630a4 input-settings-x11: Use xcb to change input settings
This way, we won't be hit with BadValue errors if we set it to a value
outside the X device's range. This can happen for touchpads without
two-finger scrolling, for instance.
2015-06-11 21:13:21 -04:00
Thomas Hellstrom
320e2d452f mutter/wayland: Add some missing output names
Sync with the drm_mode.h include file.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>

https://bugzilla.gnome.org/show_bug.cgi?id=750363
2015-06-03 13:28:19 -07:00
Thomas Hellstrom
4d5dd01b7d mutter/wayland: Improved preferred mode selection for the native backend
Instead of selecting the first drm mode as the preferred mode, select the
first drm mode marked as preferred. If there are no modes marked as
preferred, revert to the old behaviour and select the first mode.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>

https://bugzilla.gnome.org/show_bug.cgi?id=750363
2015-06-03 13:28:19 -07:00
Thomas Hellstrom
103c88bd72 mutter/wayland: Have the native backend read drm layout properties
Read the drm layout properties suggested_X, suggested_Y and
hotplug_mode_update and transfer them to the meta layer.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>

https://bugzilla.gnome.org/show_bug.cgi?id=750363
2015-06-03 13:28:19 -07:00
Dave Airlie
9f65edd4f5 backend/x11: add support for setting randr 1.5 monitors
This interface allows us to propogate back the constructed
monitors to randr using the randr 1.5 protocol. Apps
should pick it up from there.
2015-06-01 09:38:13 -07:00
Dave Airlie
ea2496c80a monitors: construct tiled monitors info
The monitors info structure is created from the tiled outputs
and this is used as the central storage for info about a monitor
as opposed to the output state.

It appears at least the EDID mm w/h is for the whole monitor and
not per tile.
2015-06-01 09:38:13 -07:00
Dave Airlie
0c30ceddbe monitors: add tiled support to the linear config
This makes sure when we generate a linear config, that
tiles get placed in the correct position relative to each other.
2015-06-01 09:38:13 -07:00