1
0
Fork 0
Commit graph

23707 commits

Author SHA1 Message Date
Jonas Ådahl
ebafc256a0 renderer/native: Check calculated transform when creating view
The "backends: Move MetaOutput::crtc field into private struct"
accidentally changed the view transform calculation code to assume that
"MetaCrtc::transform" corresponds to the transform of the CRTC; so is
not the case yet; one must calculate the transform from the logical
monitor, and check whether it is supported by the CRTC using
meta_monitor_manager_is_transform_handled(). This commit restores the
old behaviour that doesn't use MetaCrtc::transform when calculating the
view transform.

Fixes: https://gitlab.gnome.org/GNOME/mutter/issues/216
2018-08-24 11:51:36 +00:00
Carlos Garnacho
aaed7c9a4f clutter: Set can_show_preedit flag on ClutterText
It is certainly able to visualize preedit text inline, so it must
announce itself as such.
2018-08-23 20:03:51 +00:00
Carlos Garnacho
fa8930817e clutter: Refactor ClutterText IM focus in into separate function
A just focused ClutterInputFocus must set itself up correctly on
all situations. Refactor this into a function, so it can be used
for the case where a ClutterText gets editable while focused.
2018-08-23 20:03:51 +00:00
Sebastian Keller
e741adb82e backends/x11: Only free cursor if it was created successfully
XcursorLibraryLoadCursor can return 'None' if the current cursor theme
is missing the requested icon. If XFreeCursor is then called on this
cursor, it generates a BadCursor error causing gnome-shell to crash.

Fixes https://gitlab.gnome.org/GNOME/mutter/issues/254
2018-08-21 16:39:41 +02:00
Iain Lane
deb541ef5a monitor-manager-kms: Check if GPUs can have outputs
We need a way for mutter to exit if no available GPUs are going to work.
For example if gdm starts gnome-shell and we're using a DRM driver that
doesn't work with KMS then we should exit so that GDM can try with Xorg,
rather than operating in headless mode.

Related: https://gitlab.gnome.org/GNOME/mutter/issues/223
2018-08-21 13:16:22 +00:00
Iain Lane
29cc526e2e gpu-kms: Handle drmModeGetResources() failing
Avoid dereferencing the NULL return value if it fails. We still create
the MetaGpu, but we treat it as if it has no outputs.

Closes: https://gitlab.gnome.org/GNOME/mutter/issues/223
2018-08-21 13:16:21 +00:00
Robert Mader
6a92c6f83f wayland/actor-surface: Intersect input/opaque region with surface region
As per specification

> The compositor ignores the parts of the input region that
> fall outside of the surface.

> The compositor ignores the parts of the opaque region that
> fall outside of the surface

This fixes culling problems under certain conditions.
2018-08-21 12:24:02 +02:00
Daniel van Vugt
b8340f1355 clutter-text: Avoid clipping the wrong framebuffer
`ClutterText` painting for editable single_line_mode actors like `StEntry`
is always clipped by:

`cogl_framebuffer_push_rectangle_clip (fb, 0, 0, alloc_width, alloc_height)`

So it's difficult to get the rectangle wrong. However in cases where the
target framebuffer has changed (`cogl_push_framebuffer`) such as when
updating `ClutterOffscreenEffect` we had the wrong old value of `fb`. And
so would be clipping the wrong framebuffer, effectively not clipping at all.
2018-08-20 18:07:32 +00:00
Robert Mader
c7db234c11 wayland/xdg-shell: Intersect set geometry with subsurface tree geometry
Currently xdg-shell applies a geometry set with set_window_geometry
unconditionally. But the specification requires:

> When applied, the effective window geometry will be
> the set window geometry clamped to the bounding rectangle of the
> combined geometry of the surface of the xdg_surface and the
> associated subsurfaces.

This is especially important to implement viewporter and
transformation.
2018-08-20 14:37:10 +00:00
Robert Mader
db22c13c4f wayland: Use surface size helper functions
Use meta_wayland_surface_get_width / meta_wayland_surface_get_width
to determine the size of a surface.
2018-08-20 14:37:10 +00:00
Robert Mader
ad864083f9 wayland/surface: Add get_width() and get_height() helper functions
With viewporter / transformations it get's more complicated to
figure out the dimensions of a surface. Bundle it in this helper-
functions.
2018-08-20 14:37:09 +00:00
Florian Müllner
5f99eeb926 Bump version to 3.29.91
Update NEWS.
2018-08-20 15:28:24 +02:00
Andrea Azzarone
e1513b6b00 clutter/x11: Detect auto-repeated key events
Detect auto-repeated key events using the XIKeyRepeat flag.
2018-08-20 10:16:33 +00:00
Andrea Azzarone
0cc3cd62ba keybindings: Ignore auto-repeat events for some keybindings
Detect auto-repeat events in process_event and ignore them if the
keybinding has the META_KEY_BINDING_IGNORE_AUTOREPEAT flag.

Fixes: gnome-shell#373
2018-08-20 10:16:33 +00:00
Andrea Azzarone
0f40541bb2 clutter/enum: Add CLUTTER_EVENT_FLAG_REPEATED for auto-repeated events 2018-08-20 10:16:33 +00:00
Bruce Cowan
db604dda89 Update British English translation 2018-08-19 16:46:41 +00:00
Jonas Ådahl
21ce6f96f1 wayland/keyboard: Create a separate keymap shm file per resource
By using the shm file when sending the keymap to all clients, we
effectively allows any client to change the keymap, as any client has
the ability to change the content of the file. Sending a read-only file
descriptor, or making the file itself read-only before unlinking, can
be worked around by the client by using chmod(2) and open(2) on
/proc/<pid>/<fd>.

Using memfd could potentially solve this issue, but as the usage of
mmap with MAP_SHARED is wide spread among clients, such a change can
not be introduced without causing wide spread compatibility issues.

So, to avoid allowing clients to interfere with each other, create a
separate shm file for each wl_keyboard resource when sending the
keymap. We could eventually do this per client, but in most cases,
there will only be one wl_keyboard resource per client anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=784206
2018-08-17 16:34:05 +02:00
Jonas Ådahl
323a806d35 wayland/keyboard: Indentation fix 2018-08-17 16:34:05 +02:00
Fabio Tomat
84ac28cbee Update Friulian translation 2018-08-17 03:49:35 +00:00
Piotr Drąg
2860adcf65 Update MSGID_BUGS_ADDRESS in po/Makevars 2018-08-16 20:23:26 +02:00
Jonas Ådahl
2dbacfa8d6 wayland/keyboard: Accept key down serial after key up for popups
If a client maps a popup in response to a key-down event, but the
mapping doesn't occur until after the user has already released the same
button, we'd immediately dismiss the popup. This is problematic, as one
often presses and releases a key quite quickly, meaning any popup mapped
on key-down are likely to be dismissed.

Avoid this race condition by accepting serials for key down events, if
the most recent key-up event had the same keycode.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/180
2018-08-15 08:51:14 +00:00
Carlos Garnacho
85e5b160ee wayland: Implement text-input from wayland-protocols
This protocol supersedes the internal gtk_text_input protocol that
was in place. Functionally it is very similar, with just some more
verbosity in both ways (text_change_cause, .done event), and some
improvements wrt the pre-edit text styling.
2018-08-14 15:43:21 +00:00
Carlos Garnacho
9510fbcbac wayland: Make gtk-text-input "legacy"
It is superseded by zwp_text_input_v3.
2018-08-14 15:43:21 +00:00
Jonas Ådahl
7c06e21e5a idle-monitor: Store either 1 or 0 in the inhibited gboolean
Wrap the flag checking in !!(..) to make sure we always either store
TRUE or FALSE in the gboolean.
2018-08-14 15:14:05 +00:00
Jeff Smith
1bfa20929b backends/x11: Improve grab-device clock updates
meta_backend_x11_grab_device is performing X server clock comparison
using the MAX macro, which comes down to a simple greater-than.

Use XSERVER_TIME_IS_BEFORE, which is a better macro for X server
clock comparisons, as it accounts for 32-bit wrap-around.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/174
2018-08-13 21:00:33 +02:00
Emin Tufan Çetin
bafc43ca26 Update Turkish translation 2018-08-12 10:20:43 +00:00
Yi-Jyun Pan
d37528f693 Update Chinese (Taiwan) translation 2018-08-12 10:18:57 +00:00
Jonas Ådahl
37eeda0320 Revert "gpu-kms: Handle drmModeGetResources() failing"
This reverts commit acf70a3561
2018-08-10 16:31:03 +00:00
Iain Lane
acf70a3561 gpu-kms: Handle drmModeGetResources() failing
Avoid dereferencing the NULL return value if it fails. We still create
the MetaGpu, but we treat it as if it has no outputs.

Closes: https://gitlab.gnome.org/GNOME/mutter/issues/223
2018-08-10 16:35:17 +01:00
Jonas Ådahl
24aef44baf virtual-input/evdev: Translate from button internal codes to evdev
Sending button events to a ClutterVirtualInputDevice, the API expects
button codes to be of the internal clutter type. The evdev
implementation incorrectly assumed it was already prepared evdev event
codes, which was not the case. Fix the evdev implementation to translate
from the internal representation to evdev before passing it along to
ClutterSeatEvdev.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/190
2018-08-09 13:04:07 +00:00
Alex Villacís Lasso
f7af32a3ea renderer/native: Fallback to non-planar API if gbm_bo_get_handle_for_plane fails
Commit c0d9b08ef9 replaced the old GBM API calls
with the multi-plane GBM API. However, the call to gbm_bo_get_handle_for_plane
fails for some DRI drivers (in particular i915). Due to missing error checks,
the subsequent call to drmModeAddFB[2] fails and the screen output locks up.

This commit adds the missing error checks and falls back to the old GBM API
(non-planar) if necessary.

v5: test success of gbm_bo_get_handle_for_plane instead of errno

This commit adopts solution proposed by Daniel van Vugt to check the return
value of gbm_bo_get_handle_for_plane on plane 0 and fall back to old
non-planar method if the call fails. This removes the errno check (for
ENOSYS) that could abort if mesa ever sets a different value.

Related to: https://gitlab.gnome.org/GNOME/mutter/issues/127
2018-08-09 12:36:34 +00:00
Olivier Fourdan
252dd52439 wayland: Clean up xwayland grabs even if surface is gone
If the surface is gone before `meta_xwayland_keyboard_grab_end()` is
called, we would bail out early leaving an empty grab, which will cause
a segfault as soon as a key is pressed later on.

Make sure we clean up the keyboard grab even if the surface is gone.

Closes: https://gitlab.gnome.org/GNOME/mutter/issues/255
2018-08-06 11:22:51 +00:00
Jan Grulich
c216397974 Update libpipewire requirements
PipeWire 0.2.2+ now provides libpipewire-0.2 and not libpipewire-0.1 anymore
2018-08-06 10:05:36 +02:00
Aurimas Černius
841dc09d21 Updated Lithuanian translation 2018-08-05 23:42:47 +03:00
Piotr Drąg
192b7887c3 Update Polish translation 2018-08-04 20:09:59 +02:00
Mario Blättermann
1fd8fe65c5 Update German translation 2018-08-04 18:00:54 +00:00
Matej Urbančič
a87c447b72 Updated Slovenian translation 2018-08-03 17:23:46 +02:00
Matej Urbančič
c624fcbb8b Updated Slovenian translation 2018-08-03 12:13:42 +02:00
Daniel van Vugt
b393f3d540 clutter/actor: Inherit clone branch depth from parent
Children added to a parent after that parent (or its ancestors)
have already been cloned now inherit the clone branch depth of
the parent. Otherwise `clutter_actor_is_in_clone_paint` on the child
could return FALSE when it should have been returning TRUE.
2018-08-01 11:53:10 +08:00
Florian Müllner
3e3bc3e67f Bump version to 3.29.90
Update NEWS.
2018-08-01 02:44:57 +02:00
Florian Müllner
11d5e00003 plugin: Add back prototypes to META_PLUGIN_DECLARE()
G_DEFINE_DYNAMIC_TYPE() doesn't include those, so they are still
needed.
2018-08-01 02:44:57 +02:00
Florian Müllner
f0c9c25cf8 wayland-private: Make display_name non-const
The string used to point to memory owned by libwayland-server, but
with the ability to override the display name, we took over ownership
by copying the string as necessary.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/176
2018-07-31 23:40:01 +02:00
Florian Müllner
7fdaf7721c Don't cast free function passed to g_clear_pointer
The function is intentionally provided as macro to not require a
cast. Recently the macro was improved to check that the passed in
pointer matches the free function, so the cast to GDestroyNotify
is now even harmful.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/176
2018-07-31 23:40:01 +02:00
Florian Müllner
c403785d36 Stop using g_type_class_add_private()
It is now deprecated in favor of the G_ADD_PRIVATE() macro (usually
called via G_DEFINE_WITH_PRIVATE()).

https://gitlab.gnome.org/GNOME/mutter/merge_requests/176
2018-07-31 23:40:01 +02:00
Florian Müllner
4fe594bf9c clutter: Stop using g_type_class_add_private()
It is now deprecated in favor of the G_ADD_PRIVATE() macro (usually
called via G_DEFINE_WITH_PRIVATE()).

https://gitlab.gnome.org/GNOME/mutter/merge_requests/176
2018-07-31 23:40:01 +02:00
Florian Müllner
ec451b4674 plugin: Add META_DECLARE_PLUGIN_WITH_CODE() variant
Thanks to G_DEFINE_DYNAMIC_TYPE_EXTENDED(), this is a trivial addition that
will allow using G_IMPLEMENT_INTERFACE_DYNAMIC() or G_ADD_PRIVATE_DYNAMIC()
when declaring a plugin.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/176
2018-07-31 23:40:01 +02:00
Florian Müllner
43eb724b94 plugin: Simplify META_PLUGIN_DECLARE() macro
It's mostly boilerplate that G_DEFINE_DYNAMIC_TYPE() can take care
of, so use that internally.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/176
2018-07-31 23:40:01 +02:00
Florian Müllner
3d75b48d50 prefs: Remove override system
With the support for per-desktop default values in GSettings, we
no longer need the mutter-specific override mechanism.

https://bugzilla.gnome.org/show_bug.cgi?id=786496
2018-07-31 18:38:53 +00:00
Jonas Ådahl
4d465eac08 monitor: Use current monitor mode to check whether active
For historical reasons meta_monitor_is_active() checked whether it is
active by checking whether the main output have a CRTC assigned and
whether that CRTC has a current mode. At a later point, the MetaMonitor
got its own mode abstraction (MetaMonitorMode), but
meta_monitor_is_active() was never updated to use this.

An issue with checking the main output's CRTC state is that, if there is
some CRTC mode combination that for some reason isn't properly detected
by the MetaMonitorMode abstraction (e.g. some tiling configuration not
yet handled), meta_monitor_is_active() would return TRUE, even though no
(abstracted) mode was set. This would cause confusion here and there,
leading to NULL pointer dereferences due to the assumption that if a
monitor is active, it has an active mode.

Instead, change meta_monitor_is_active() to directly check the current
monitor mode, and log a warning if the main output still happen to have
a CRTC with a mode assigned to it. This way, when an not undrestood CRTC
mode combination is encountered, instead of dereferencing NULL pointers,
simply assume the monitor is not active, which means that it will not be
managed or rendered by mutter at all.

https://gitlab.gnome.org/GNOME/mutter/issues/130
2018-07-31 13:37:03 +02:00
Daniel van Vugt
db5abbb225 wayland: Remove unused GList *l 2018-07-31 11:47:51 +08:00